~mark/.config/sway/cd ..cat config
# various sections of sway config
# ===== input =====
input * {
xkb_layout de
tap enabled
dwt disabled
dwtp disabled
natural_scroll disabled
drag_lock disabled
# accel_profile flat
# pointer_accel -0.6
# pointer_accel 0
}
# ===== keybinds =====
# Start a temp terminal
bindsym $mod+Shift+Return exec $term -e d26r temp bash
# screen-message
bindsym $mod+s exec sm -i -a 1 -f '#203' ' 🧌 '
# mic shortcuts: start with open mic (hold Alt+x to mute),
# press Alt+Shift+x to switch to/from ptt (hold Alt+x to unmute).
# also decreases speaker volume in ptt mode while unmuted.
exec pactl set-source-mute @DEFAULT_SOURCE@ no
bindsym --no-repeat Mod1+Shift+x exec bash -c 'if [[ -f /tmp/mark-micmute-ptt ]]; then rm /tmp/mark-micmute-ptt; pactl set-source-mute @DEFAULT_SOURCE@ no; else touch /tmp/mark-micmute-ptt; pactl set-source-mute @DEFAULT_SOURCE@ yes; fi'
bindsym --no-repeat Mod1+x exec bash -c 'if [[ -f /tmp/mark-micmute-ptt ]]; then pactl set-sink-volume mark_combine_out_5 50%; sleep 0.1; pactl set-source-mute @DEFAULT_SOURCE@ no; else pactl set-source-mute @DEFAULT_SOURCE@ yes; fi'
bindsym --no-repeat --release Mod1+x exec bash -c 'sleep 0.05; if [[ -f /tmp/mark-micmute-ptt ]]; then pactl set-sink-volume mark_combine_out_5 100%; sleep 0.05; pactl set-source-mute @DEFAULT_SOURCE@ yes; else pactl set-source-mute @DEFAULT_SOURCE@ no; fi'
# Toggle the current focus between tiling and floating mode
bindsym $mod+Shift+f floating toggle
# default bind
bindsym $mod+Shift+space floating toggle
# ===== layout keybinds =====
# bindsym $mod+w layout tabbed # default, would put all windows of the same container into tabs
bindsym $mod+w splitv ; layout tabbed # puts the current window as the only tab, next opened windows join it in its spot
bindsym $mod+e layout toggle split # default, unchanged
bindsym $mod+Shift+w split none # undo splith/splitv/split+tab
# ===== bar =====
bar {
position bottom
# [...]
}
cat swaylock_mark
#!/bin/sh
# mark this file as executable,
# then change your sway config (.config/sway/)
# by replacing swaylock with this script:
#
# [...]
# bindsym $mod+Shift+s exec ~/.config/sway/swaylock_mark
# [...]
swayidle -w timeout 2 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' &
swaylock --color 000000
kill $(jobs -p)
cat swaystatus_mark
#!/bin/bash
# mark this file as executable,
# then change your sway config (.config/sway/):
#
# [...]
# bar {
# [...]
#
# # When the status_command prints a new line to stdout, swaybar updates.
# status_command ~/.config/sway/swaystatus_mark
#
# [...]
# }
# [...]
while true; do
BatteryStatus="$(upower -i /org/freedesktop/UPower/devices/battery_BAT0)"
echo "$BatteryStatus" >&2
Perc="$(echo "$BatteryStatus" | grep -i 'percentage' | grep -ioE '\-?[01-9,.]+%')"
Watt="$(echo "$BatteryStatus" | grep -i 'energy-rate' | grep -ioE '\-?[01-9,.]+ ?W' | grep -ioE '\-?[01-9]+' | head -n 1)"
Remaining="$(echo "$BatteryStatus" | grep -i 'time to empty' | grep -ioE '\-?[01-9,.]+.*')"
Time="$(date +'%H:%M:%S | %F')"
printf '%s, %sW → %s | %s \n' "$Perc" "$Watt" "$Remaining" "$Time"
snooze -H '*' -M '*' -S '/5' || sleep 5
done