diff options
| author | 2026-05-13 13:43:32 +0100 | |
|---|---|---|
| committer | 2026-05-13 13:43:32 +0100 | |
| commit | 0c15212f4f2389f743b17cb6ceff50f1f9267a1b (patch) | |
| tree | 9db73d86cfebc23b3032b32a1cc3be7b1e8bef38 /dot_config/waybar | |
| parent | 2970b9dddc6b89705a6836fa0864fb841925ff6f (diff) | |
| download | dotfiles-0c15212f4f2389f743b17cb6ceff50f1f9267a1b.tar.gz dotfiles-0c15212f4f2389f743b17cb6ceff50f1f9267a1b.tar.bz2 dotfiles-0c15212f4f2389f743b17cb6ceff50f1f9267a1b.zip | |
style: apply formatter drift across repo
Pre-existing whitespace/style drift caught by `just check`. Touch
nothing semantic — pure formatter output (shfmt -i 2 -ci -s, ruff,
prettier, taplo). Excludes dot_config/clangd/config.yaml whose manual
indentation is intentionally preserved.
Diffstat (limited to 'dot_config/waybar')
| -rw-r--r-- | dot_config/waybar/executable_clip-picker.sh | 14 | ||||
| -rw-r--r-- | dot_config/waybar/executable_dismiss-visible.sh | 4 | ||||
| -rw-r--r-- | dot_config/waybar/executable_mako-history.py | 17 | ||||
| -rw-r--r-- | dot_config/waybar/executable_mako-status.sh | 9 | ||||
| -rw-r--r-- | dot_config/waybar/executable_restore-pending.sh | 6 | ||||
| -rw-r--r-- | dot_config/waybar/executable_tb-unread.sh | 22 | ||||
| -rw-r--r-- | dot_config/waybar/executable_webcam-status.sh | 2 | ||||
| -rw-r--r-- | dot_config/waybar/executable_wifi-toggle.sh | 5 |
8 files changed, 48 insertions, 31 deletions
diff --git a/dot_config/waybar/executable_clip-picker.sh b/dot_config/waybar/executable_clip-picker.sh index 11ebf4c..d7f5b61 100644 --- a/dot_config/waybar/executable_clip-picker.sh +++ b/dot_config/waybar/executable_clip-picker.sh @@ -15,10 +15,10 @@ style=$HOME/.config/wofi/style.css set +e selection=$( - cliphist list \ - | wofi --dmenu --hide-search --prompt Clip \ - --define key_custom_0=Alt-d \ - ${style:+--style "$style"} + cliphist list | + wofi --dmenu --hide-search --prompt Clip \ + --define key_custom_0=Alt-d \ + ${style:+--style "$style"} ) rc=$? set -e @@ -26,7 +26,7 @@ set -e [ -z "$selection" ] && exit 0 case "$mode:$rc" in - pick:0) printf '%s' "$selection" | cliphist decode | wl-copy ;; - pick:10) printf '%s' "$selection" | cliphist delete ;; - delete:0|delete:10) printf '%s' "$selection" | cliphist delete ;; + pick:0) printf '%s' "$selection" | cliphist decode | wl-copy ;; + pick:10) printf '%s' "$selection" | cliphist delete ;; + delete:0 | delete:10) printf '%s' "$selection" | cliphist delete ;; esac diff --git a/dot_config/waybar/executable_dismiss-visible.sh b/dot_config/waybar/executable_dismiss-visible.sh index 32d4a8a..9264c46 100644 --- a/dot_config/waybar/executable_dismiss-visible.sh +++ b/dot_config/waybar/executable_dismiss-visible.sh @@ -18,8 +18,8 @@ command -v makoctl >/dev/null 2>&1 || exit 0 # This makoctl has no -f; extract ids from the text dump. list_ids() { - makoctl list 2>/dev/null \ - | sed -n 's/^Notification \([0-9][0-9]*\):.*/\1/p' + makoctl list 2>/dev/null | + sed -n 's/^Notification \([0-9][0-9]*\):.*/\1/p' } case "$mode" in diff --git a/dot_config/waybar/executable_mako-history.py b/dot_config/waybar/executable_mako-history.py index 89618d0..b072091 100644 --- a/dot_config/waybar/executable_mako-history.py +++ b/dot_config/waybar/executable_mako-history.py @@ -123,15 +123,22 @@ def run_wofi(input_text: str, lines: int) -> tuple[int, str]: "wofi", "--dmenu", "--hide-search", - "--prompt", "Notifications", - "--define", "key_custom_0=Alt-c", - "--define", "key_custom_1=Alt-d", - "--lines", str(lines), + "--prompt", + "Notifications", + "--define", + "key_custom_0=Alt-c", + "--define", + "key_custom_1=Alt-d", + "--lines", + str(lines), ] if style.exists(): cmd += ["--style", str(style)] proc = subprocess.run( - cmd, input=input_text, text=True, capture_output=True, + cmd, + input=input_text, + text=True, + capture_output=True, ) return proc.returncode, proc.stdout.strip() diff --git a/dot_config/waybar/executable_mako-status.sh b/dot_config/waybar/executable_mako-status.sh index de9b215..12e4d82 100644 --- a/dot_config/waybar/executable_mako-status.sh +++ b/dot_config/waybar/executable_mako-status.sh @@ -20,11 +20,14 @@ state=${XDG_RUNTIME_DIR:-/tmp}/mako-dismissed # starts with "Notification N: <summary>". Visible bubbles live in # `list`, closed ones in `history`; their id-spaces are disjoint. extract_ids() { - makoctl "$1" 2>/dev/null \ - | sed -n 's/^Notification \([0-9][0-9]*\):.*/\1/p' + makoctl "$1" 2>/dev/null | + sed -n 's/^Notification \([0-9][0-9]*\):.*/\1/p' } -all_ids=$( { extract_ids list; extract_ids history; } | sort -un) +all_ids=$({ + extract_ids list + extract_ids history +} | sort -un) # Prune stale ids (no longer present in mako) from the dismissed file. if [ -s "$state" ] && [ -n "$all_ids" ]; then diff --git a/dot_config/waybar/executable_restore-pending.sh b/dot_config/waybar/executable_restore-pending.sh index 028de0e..3a08c4f 100644 --- a/dot_config/waybar/executable_restore-pending.sh +++ b/dot_config/waybar/executable_restore-pending.sh @@ -11,9 +11,9 @@ command -v makoctl >/dev/null 2>&1 || exit 0 # mako's history is most-recent-first; the next restore() target is the # top of the list at the time of the call. -top_id=$(makoctl history 2>/dev/null \ - | sed -n 's/^Notification \([0-9][0-9]*\):.*/\1/p' \ - | head -n1 || true) +top_id=$(makoctl history 2>/dev/null | + sed -n 's/^Notification \([0-9][0-9]*\):.*/\1/p' | + head -n1 || true) makoctl restore || true if [ -n "${top_id:-}" ] && [ -s "$state" ]; then diff --git a/dot_config/waybar/executable_tb-unread.sh b/dot_config/waybar/executable_tb-unread.sh index 3c3e1c7..200cb70 100644 --- a/dot_config/waybar/executable_tb-unread.sh +++ b/dot_config/waybar/executable_tb-unread.sh @@ -13,20 +13,24 @@ PASS_PW=email/protonmail-bridge/pass HOST=127.0.0.1 PORT=1143 -emit() { printf '%s\n' "$1"; exit 0; } +emit() { + printf '%s\n' "$1" + exit 0 +} # Cheap reachability probe — avoids a 30s python TLS timeout when the bridge # is down (e.g. before it has finished unlocking on a fresh login). -ncat -z -w 1 "$HOST" "$PORT" 2>/dev/null || \ +ncat -z -w 1 "$HOST" "$PORT" 2>/dev/null || emit '{"text":"","tooltip":"bridge unreachable","class":"error","alt":"error"}' -user=$(pass show "$PASS_USER" 2>/dev/null) || \ +user=$(pass show "$PASS_USER" 2>/dev/null) || emit '{"text":"","tooltip":"missing pass entry: '"$PASS_USER"'","class":"error","alt":"error"}' -pw=$(pass show "$PASS_PW" 2>/dev/null) || \ +pw=$(pass show "$PASS_PW" 2>/dev/null) || emit '{"text":"","tooltip":"missing pass entry: '"$PASS_PW"'","class":"error","alt":"error"}' -n=$(PROTONMAIL_BRIDGE_USER="$user" PROTONMAIL_BRIDGE_PASS="$pw" \ - python3 - "$HOST" "$PORT" <<'PY' 2>/dev/null || true +n=$( + PROTONMAIL_BRIDGE_USER="$user" PROTONMAIL_BRIDGE_PASS="$pw" \ + python3 - "$HOST" "$PORT" <<'PY' 2>/dev/null || true import imaplib, os, ssl, sys host, port = sys.argv[1], int(sys.argv[2]) ctx = ssl.create_default_context() @@ -45,7 +49,7 @@ PY ) case "$n" in - '') emit '{"text":"","tooltip":"IMAP query failed","class":"error","alt":"error"}' ;; - 0) emit '{"text":"","tooltip":"Inbox: no unread","class":"empty","alt":"empty"}' ;; - *) emit "$(printf '{"text":" %s","tooltip":"Inbox: %s unread","class":"unread","alt":"unread"}' "$n" "$n")" ;; + '') emit '{"text":"","tooltip":"IMAP query failed","class":"error","alt":"error"}' ;; + 0) emit '{"text":"","tooltip":"Inbox: no unread","class":"empty","alt":"empty"}' ;; + *) emit "$(printf '{"text":" %s","tooltip":"Inbox: %s unread","class":"unread","alt":"unread"}' "$n" "$n")" ;; esac diff --git a/dot_config/waybar/executable_webcam-status.sh b/dot_config/waybar/executable_webcam-status.sh index 1b812a6..f55a2d0 100644 --- a/dot_config/waybar/executable_webcam-status.sh +++ b/dot_config/waybar/executable_webcam-status.sh @@ -6,7 +6,7 @@ set -eu devs=$(echo /dev/video[0-9]*) case "$devs" in - '/dev/video[0-9]*') exit 0 ;; # no devices present + '/dev/video[0-9]*') exit 0 ;; # no devices present esac # fuser exits 0 when at least one device has an opener, 1 otherwise. Stderr diff --git a/dot_config/waybar/executable_wifi-toggle.sh b/dot_config/waybar/executable_wifi-toggle.sh index 68e77ab..2eb27bc 100644 --- a/dot_config/waybar/executable_wifi-toggle.sh +++ b/dot_config/waybar/executable_wifi-toggle.sh @@ -14,7 +14,10 @@ device=$(busctl --system --json=short call "$svc" / \ | select(.value["net.connman.iwd.Device"].Name.data == $iface) | .key') -[ -n "$device" ] || { notify-send -u critical "wifi" "iwd device $iface not found"; exit 1; } +[ -n "$device" ] || { + notify-send -u critical "wifi" "iwd device $iface not found" + exit 1 +} powered=$(busctl --system --json=short get-property "$svc" "$device" \ net.connman.iwd.Device Powered | jq -r '.data') |
