diff options
| -rw-r--r-- | KEYBINDS.md | 128 | ||||
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | dot_config/sway/executable_emoji-wofi.sh | 4 | ||||
| -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 | ||||
| -rw-r--r-- | dot_config/yazi/yazi.toml | 12 | ||||
| -rw-r--r-- | dot_local/bin/executable_dictate | 6 | ||||
| -rw-r--r-- | dot_local/bin/executable_ocr | 5 |
14 files changed, 126 insertions, 110 deletions
diff --git a/KEYBINDS.md b/KEYBINDS.md index de3ccef..59a5db3 100644 --- a/KEYBINDS.md +++ b/KEYBINDS.md @@ -304,46 +304,46 @@ Mod key: `Super` (Mod4). Only personal additions beyond sway defaults listed. ### Personal keybinds (sway/config) -| Key | Action | -| ----------------------- | ------------------------------------------------- | -| `XF86AudioRaiseVolume` | Volume +5% | -| `XF86AudioLowerVolume` | Volume -5% | -| `XF86AudioMute` | Mute toggle | -| `Super+m` | Mic mute toggle | -| `Super+Shift+m` | Speaker mute toggle | -| `XF86AudioPlay` | Play/pause | -| `XF86AudioNext` | Next track | -| `XF86AudioPrev` | Previous track | -| `XF86MonBrightnessUp` | Brightness +5% (brightnessctl) | -| `XF86MonBrightnessDown` | Brightness -5% (brightnessctl) | -| `XF86AudioMicMute` | Mic mute toggle | -| `XF86Bluetooth` | Bluetooth power toggle (bluetoothctl) | -| `XF86ScreenSaver` | Lock screen + pause media (same as Super+Shift+s) | -| `XF86Sleep` | Suspend system (systemctl suspend) | -| `XF86WLAN` | Toggle Wi-Fi (rfkill) | -| `XF86RFKill` | Toggle all radios (rfkill) | -| `Print` | Region screenshot (grim+slurp) | -| `Shift+Print` | Full screenshot (grim) | -| `Super+i` | Dictate toggle (whisper.cpp → wtype + clipboard) | -| `Super+Shift+o` | OCR region (tesseract → clipboard) | -| `Super+Shift+s` | Lock screen + pause media | -| `Super+n` | Dismiss visible notification (also marks it seen) | -| `Super+Shift+n` | Dismiss all visible notifications (mark all seen) | -| `Super+Ctrl+n` | Restore last dismissed; pop it back into the pending set | +| Key | Action | +| ----------------------- | ----------------------------------------------------------------------------------------- | +| `XF86AudioRaiseVolume` | Volume +5% | +| `XF86AudioLowerVolume` | Volume -5% | +| `XF86AudioMute` | Mute toggle | +| `Super+m` | Mic mute toggle | +| `Super+Shift+m` | Speaker mute toggle | +| `XF86AudioPlay` | Play/pause | +| `XF86AudioNext` | Next track | +| `XF86AudioPrev` | Previous track | +| `XF86MonBrightnessUp` | Brightness +5% (brightnessctl) | +| `XF86MonBrightnessDown` | Brightness -5% (brightnessctl) | +| `XF86AudioMicMute` | Mic mute toggle | +| `XF86Bluetooth` | Bluetooth power toggle (bluetoothctl) | +| `XF86ScreenSaver` | Lock screen + pause media (same as Super+Shift+s) | +| `XF86Sleep` | Suspend system (systemctl suspend) | +| `XF86WLAN` | Toggle Wi-Fi (rfkill) | +| `XF86RFKill` | Toggle all radios (rfkill) | +| `Print` | Region screenshot (grim+slurp) | +| `Shift+Print` | Full screenshot (grim) | +| `Super+i` | Dictate toggle (whisper.cpp → wtype + clipboard) | +| `Super+Shift+o` | OCR region (tesseract → clipboard) | +| `Super+Shift+s` | Lock screen + pause media | +| `Super+n` | Dismiss visible notification (also marks it seen) | +| `Super+Shift+n` | Dismiss all visible notifications (mark all seen) | +| `Super+Ctrl+n` | Restore last dismissed; pop it back into the pending set | | `XF86Favorites` | Notification history picker (Enter re-shows + marks seen, Alt-c copies, Alt-d marks seen) | -| `Super+p` | Clipboard history picker (wofi; Enter pastes, Alt-d deletes) | -| `Super+Shift+p` | Clipboard history delete entry (Enter deletes) | -| `Super+period` | Emoji picker (bemoji → wofi; types + copies) | -| `Super+Tab` | Next workspace | -| `Super+Shift+Tab` | Previous workspace | -| `Super+]` | Focus next window in container (monocle cycling) | -| `Super+[` | Focus prev window in container (monocle cycling) | -| `XF86Display` | Toggle display mode (laptop-off/side-by-side) | -| `XF86Tools` | Floating pulsemixer (audio mixer TUI) | -| `XF86Keyboard` | Floating glow pager for `~/dotfiles/KEYBINDS.md` | -| `Super+z` then `w` | Display QR for clipboard (wqr) | -| `Super+z` then `r` | Scan QR via webcam, copy to clipboard (rqr) | -| `Super+t` | Toggle Thunderbird (tiled on current workspace) | +| `Super+p` | Clipboard history picker (wofi; Enter pastes, Alt-d deletes) | +| `Super+Shift+p` | Clipboard history delete entry (Enter deletes) | +| `Super+period` | Emoji picker (bemoji → wofi; types + copies) | +| `Super+Tab` | Next workspace | +| `Super+Shift+Tab` | Previous workspace | +| `Super+]` | Focus next window in container (monocle cycling) | +| `Super+[` | Focus prev window in container (monocle cycling) | +| `XF86Display` | Toggle display mode (laptop-off/side-by-side) | +| `XF86Tools` | Floating pulsemixer (audio mixer TUI) | +| `XF86Keyboard` | Floating glow pager for `~/dotfiles/KEYBINDS.md` | +| `Super+z` then `w` | Display QR for clipboard (wqr) | +| `Super+z` then `r` | Scan QR via webcam, copy to clipboard (rqr) | +| `Super+t` | Toggle Thunderbird (tiled on current workspace) | ## Typing / Input @@ -353,17 +353,17 @@ behave as-is; accents only fire through AltGr or Compose. ### AltGr (Right Alt) — one or two keystrokes -| Keys | Output | -| ----------------- | --------------------------------------- | -| `AltGr+5` | `€` | -| `AltGr+'` then v | `á é í ó ú ý` (dead acute) | -| `AltGr+~` then v | `ã õ ñ` (dead tilde) | -| `AltGr+^` then v | `â ê î ô û` (dead circumflex) | -| `` AltGr+` `` v | `à è ì ò ù` (dead grave) | -| `AltGr+,` then c | `ç` (dead cedilla) | -| `AltGr+Shift+1` | `¡` | -| `AltGr+Shift+/` | `¿` | -| `AltGr+s` | `ß` | +| Keys | Output | +| ---------------- | ----------------------------- | +| `AltGr+5` | `€` | +| `AltGr+'` then v | `á é í ó ú ý` (dead acute) | +| `AltGr+~` then v | `ã õ ñ` (dead tilde) | +| `AltGr+^` then v | `â ê î ô û` (dead circumflex) | +| `` AltGr+` `` v | `à è ì ò ù` (dead grave) | +| `AltGr+,` then c | `ç` (dead cedilla) | +| `AltGr+Shift+1` | `¡` | +| `AltGr+Shift+/` | `¿` | +| `AltGr+s` | `ß` | Capitals: hold Shift while pressing the target letter (`AltGr+'` then `Shift+a` → `Á`). @@ -373,17 +373,17 @@ Capitals: hold Shift while pressing the target letter (`AltGr+'` then Standard sequences from the system Compose table plus custom PT-PT extras in `~/.XCompose`. Press and release Compose, then the sequence. -| Sequence | Output | -| ------------------- | ------------------ | -| `Compose ' a` | `á` (any vowel) | -| `Compose ~ a` | `ã` / `õ` / `ñ` | -| `Compose ^ a` | `â` / `ê` / `ô` | -| `Compose , c` | `ç` | -| `Compose < <` | `«` (PT-PT) | -| `Compose > >` | `»` (PT-PT) | -| `Compose = e` | `€` | -| `Compose o _` | `º` | -| `Compose a _` | `ª` | -| `Compose - - -` | `—` (em dash) | -| `Compose - - .` | `–` (en dash) | -| `Compose . . .` | `…` | +| Sequence | Output | +| --------------- | --------------- | +| `Compose ' a` | `á` (any vowel) | +| `Compose ~ a` | `ã` / `õ` / `ñ` | +| `Compose ^ a` | `â` / `ê` / `ô` | +| `Compose , c` | `ç` | +| `Compose < <` | `«` (PT-PT) | +| `Compose > >` | `»` (PT-PT) | +| `Compose = e` | `€` | +| `Compose o _` | `º` | +| `Compose a _` | `ª` | +| `Compose - - -` | `—` (em dash) | +| `Compose - - .` | `–` (en dash) | +| `Compose . . .` | `…` | @@ -18,7 +18,7 @@ My Arch Linux configuration, managed with [chezmoi](https://www.chezmoi.io/). | Category | Choice | | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| OS & base | [Arch Linux](https://archlinux.org/), [paru](https://github.com/Morganamilo/paru) for AUR, [sudo-rs](https://github.com/trifectatechfoundation/sudo-rs) for privilege escalation | +| OS & base | [Arch Linux](https://archlinux.org/), [paru](https://github.com/Morganamilo/paru) for AUR, [sudo-rs](https://github.com/trifectatechfoundation/sudo-rs) for privilege escalation | | Dotfile manager | [chezmoi](https://www.chezmoi.io/) (dotfiles and `/etc` both deployed via `chezmoi apply`) | | Task runner | [just](https://just.systems/) — every maintenance action is a recipe (see below) | | Shell | [zsh](https://www.zsh.org/), relocated to `$XDG_CONFIG_HOME/zsh`; plugins via [zinit](https://github.com/zdharma-continuum/zinit) | diff --git a/dot_config/sway/executable_emoji-wofi.sh b/dot_config/sway/executable_emoji-wofi.sh index 0633401..8d37240 100644 --- a/dot_config/sway/executable_emoji-wofi.sh +++ b/dot_config/sway/executable_emoji-wofi.sh @@ -3,5 +3,5 @@ # (U+1F3FB..U+1F3FF) before handing the emoji list to wofi. set -eu -LC_ALL=C.UTF-8 grep -vP '[\x{1F3FB}-\x{1F3FF}]' \ - | wofi --dmenu --prompt Emoji --style "$HOME/.config/wofi/style.css" +LC_ALL=C.UTF-8 grep -vP '[\x{1F3FB}-\x{1F3FF}]' | + wofi --dmenu --prompt Emoji --style "$HOME/.config/wofi/style.css" 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') diff --git a/dot_config/yazi/yazi.toml b/dot_config/yazi/yazi.toml index 128c06c..4cac20e 100644 --- a/dot_config/yazi/yazi.toml +++ b/dot_config/yazi/yazi.toml @@ -7,17 +7,13 @@ title_format = "Yazi: {cwd}" # Override the default `open` opener so xdg-open is detached from yazi # (otherwise yazi treats the viewer as an unfinished task and prompts on quit). [opener] -open = [ - { run = 'xdg-open "$@"', desc = "Open", orphan = true }, -] -view-md = [ - { run = 'okular "$@"', desc = "View with Okular", orphan = true }, -] +open = [{ run = 'xdg-open "$@"', desc = "Open", orphan = true }] +view-md = [{ run = 'okular "$@"', desc = "View with Okular", orphan = true }] # Open markdown with okular directly (bypasses xdg-open / mimeapps). [open] prepend_rules = [ - { name = "*.md", use = "view-md" }, - { name = "*.markdown", use = "view-md" }, + { name = "*.md", use = "view-md" }, + { name = "*.markdown", use = "view-md" }, { mime = "text/markdown", use = "view-md" }, ] diff --git a/dot_local/bin/executable_dictate b/dot_local/bin/executable_dictate index ae8b14c..dbf89b6 100644 --- a/dot_local/bin/executable_dictate +++ b/dot_local/bin/executable_dictate @@ -65,9 +65,9 @@ stop_and_transcribe() { text="$( whisper-cli -m "$model" -f "$wav_file" \ - -l "$lang" -nt -np -t "$(nproc)" 2>"$log_file" \ - | tr -s '[:space:]' ' ' \ - | sed -e 's/^ //; s/ $//' + -l "$lang" -nt -np -t "$(nproc)" 2>"$log_file" | + tr -s '[:space:]' ' ' | + sed -e 's/^ //; s/ $//' )" if [ -z "$text" ]; then diff --git a/dot_local/bin/executable_ocr b/dot_local/bin/executable_ocr index 6f6191f..5ce8b08 100644 --- a/dot_local/bin/executable_ocr +++ b/dot_local/bin/executable_ocr @@ -15,7 +15,10 @@ set -eu lang="${TESSERACT_LANG:-eng+por}" if [ "${1:-}" ]; then - [ -r "$1" ] || { notify-send -u critical "📋 OCR" "Cannot read: $1"; exit 1; } + [ -r "$1" ] || { + notify-send -u critical "📋 OCR" "Cannot read: $1" + exit 1 + } text="$(tesseract "$1" - -l "$lang" 2>/dev/null || true)" else region="$(slurp 2>/dev/null)" || exit 0 |
