diff options
| author | 2026-05-14 10:58:37 +0100 | |
|---|---|---|
| committer | 2026-05-14 10:58:37 +0100 | |
| commit | 726005786ab398e89673bf8c141e50645f676c57 (patch) | |
| tree | c6157391bfb7b41e4db1309b78b17f680f0c50c3 /dot_config/sway | |
| parent | db4c6bdcd2af6aa2b95f587974f34c0246f62cb8 (diff) | |
| download | dotfiles-726005786ab398e89673bf8c141e50645f676c57.tar.gz dotfiles-726005786ab398e89673bf8c141e50645f676c57.tar.bz2 dotfiles-726005786ab398e89673bf8c141e50645f676c57.zip | |
style: apply shfmt/prettier/just fmt drift
Pure formatter output from shfmt (2-space indent, '|' line breaks),
prettier (KEYBINDS.md), and 'just fmt' (justfile blank line).
No behavior change.
Diffstat (limited to 'dot_config/sway')
| -rw-r--r-- | dot_config/sway/executable_brightness-osd.sh | 11 | ||||
| -rwxr-xr-x | dot_config/sway/executable_display-toggle.sh | 16 | ||||
| -rw-r--r-- | dot_config/sway/executable_power-menu.sh | 31 | ||||
| -rw-r--r-- | dot_config/sway/executable_vol-osd.sh | 19 |
4 files changed, 44 insertions, 33 deletions
diff --git a/dot_config/sway/executable_brightness-osd.sh b/dot_config/sway/executable_brightness-osd.sh index 74d6baa..cc802ad 100644 --- a/dot_config/sway/executable_brightness-osd.sh +++ b/dot_config/sway/executable_brightness-osd.sh @@ -6,11 +6,14 @@ set -eu fifo=${XDG_RUNTIME_DIR:-/tmp}/wob.sock case "${1:-}" in - up) brightnessctl set +5% >/dev/null ;; - down) brightnessctl set 5%- >/dev/null ;; - *) echo "usage: $0 up|down" >&2; exit 2 ;; + up) brightnessctl set +5% >/dev/null ;; + down) brightnessctl set 5%- >/dev/null ;; + *) + echo "usage: $0 up|down" >&2 + exit 2 + ;; esac cur=$(brightnessctl g) max=$(brightnessctl m) -printf '%d\n' "$(( cur * 100 / max ))" >"$fifo" +printf '%d\n' "$((cur * 100 / max))" >"$fifo" diff --git a/dot_config/sway/executable_display-toggle.sh b/dot_config/sway/executable_display-toggle.sh index 07fa59e..39e3367 100755 --- a/dot_config/sway/executable_display-toggle.sh +++ b/dot_config/sway/executable_display-toggle.sh @@ -15,14 +15,14 @@ STATE_FILE="${XDG_RUNTIME_DIR:-/tmp}/display-mode" OUTPUTS_CONF="${XDG_CONFIG_HOME:-$HOME/.config}/sway/outputs.conf" write_conf() { - # $1 = mode (laptop-off | side-by-side | laptop-only) - # remaining args are the sway `output ...` directives, one per arg. - { - printf '# Auto-generated by display-toggle.sh; do not edit.\n' - printf '# Current mode: %s\n' "$1" - shift - for line in "$@"; do printf '%s\n' "$line"; done - } >"$OUTPUTS_CONF" + # $1 = mode (laptop-off | side-by-side | laptop-only) + # remaining args are the sway `output ...` directives, one per arg. + { + printf '# Auto-generated by display-toggle.sh; do not edit.\n' + printf '# Current mode: %s\n' "$1" + shift + for line in "$@"; do printf '%s\n' "$line"; done + } >"$OUTPUTS_CONF" } OUTPUTS=$(swaymsg -t get_outputs -r) diff --git a/dot_config/sway/executable_power-menu.sh b/dot_config/sway/executable_power-menu.sh index edb5949..bb5cafa 100644 --- a/dot_config/sway/executable_power-menu.sh +++ b/dot_config/sway/executable_power-menu.sh @@ -3,19 +3,24 @@ set -eu choice=$(printf '%s\n' \ - " Lock" \ - " Suspend" \ - " Logout" \ - " Reboot" \ - " Poweroff" \ - | wofi --dmenu --hide-search --prompt='power' \ - --style "$HOME/.config/wofi/style.css") + " Lock" \ + " Suspend" \ + " Logout" \ + " Reboot" \ + " Poweroff" | + wofi --dmenu --hide-search --prompt='power' \ + --style "$HOME/.config/wofi/style.css") case "$choice" in - *Lock) playerctl -a pause; exec swaylock -f -e -c 000000 ;; - *Suspend) playerctl -a pause; exec systemctl suspend ;; - *Logout) exec swaymsg exit ;; - *Reboot) exec systemctl reboot ;; - *Poweroff) exec systemctl poweroff ;; + *Lock) + playerctl -a pause + exec swaylock -f -e -c 000000 + ;; + *Suspend) + playerctl -a pause + exec systemctl suspend + ;; + *Logout) exec swaymsg exit ;; + *Reboot) exec systemctl reboot ;; + *Poweroff) exec systemctl poweroff ;; esac - diff --git a/dot_config/sway/executable_vol-osd.sh b/dot_config/sway/executable_vol-osd.sh index 46f35b7..7e324e0 100644 --- a/dot_config/sway/executable_vol-osd.sh +++ b/dot_config/sway/executable_vol-osd.sh @@ -7,17 +7,20 @@ fifo=${XDG_RUNTIME_DIR:-/tmp}/wob.sock sink='@DEFAULT_SINK@' case "${1:-}" in - up) pactl set-sink-volume "$sink" +5% ;; - down) pactl set-sink-volume "$sink" -5% ;; - mute) pactl set-sink-mute "$sink" toggle ;; - *) echo "usage: $0 up|down|mute" >&2; exit 2 ;; + up) pactl set-sink-volume "$sink" +5% ;; + down) pactl set-sink-volume "$sink" -5% ;; + mute) pactl set-sink-mute "$sink" toggle ;; + *) + echo "usage: $0 up|down|mute" >&2 + exit 2 + ;; esac muted=$(pactl get-sink-mute "$sink" | awk '{print $2}') if [ "$muted" = "yes" ]; then - printf '0\n' >"$fifo" + printf '0\n' >"$fifo" else - pactl get-sink-volume "$sink" | - awk '/Volume:/ { for (i=1;i<=NF;i++) if ($i ~ /%/) { gsub(/%/,"",$i); print $i; exit } }' \ - >"$fifo" + pactl get-sink-volume "$sink" | + awk '/Volume:/ { for (i=1;i<=NF;i++) if ($i ~ /%/) { gsub(/%/,"",$i); print $i; exit } }' \ + >"$fifo" fi |
