diff options
Diffstat (limited to 'dot_config')
| -rw-r--r-- | dot_config/nvim/lua/plugins/ai.lua | 5 | ||||
| -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 | ||||
| -rwxr-xr-x | dot_config/waybar/executable_update-status.sh | 18 |
6 files changed, 57 insertions, 43 deletions
diff --git a/dot_config/nvim/lua/plugins/ai.lua b/dot_config/nvim/lua/plugins/ai.lua index 995f6a0..6578037 100644 --- a/dot_config/nvim/lua/plugins/ai.lua +++ b/dot_config/nvim/lua/plugins/ai.lua @@ -3,7 +3,10 @@ require("copilot").setup({ panel = { enabled = false }, -- Pinned Node 24 runtime; system nodejs (26.x) is incompatible with -- copilot-language-server. See ~/.local/share/chezmoi/run_onchange_after_install-copilot-node.sh - copilot_node_command = vim.fs.joinpath(vim.env.XDG_DATA_HOME or (vim.env.HOME .. "/.local/share"), "copilot-node/bin/node"), + copilot_node_command = vim.fs.joinpath( + vim.env.XDG_DATA_HOME or (vim.env.HOME .. "/.local/share"), + "copilot-node/bin/node" + ), server_opts_overrides = { settings = { telemetry = { 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 diff --git a/dot_config/waybar/executable_update-status.sh b/dot_config/waybar/executable_update-status.sh index 471116f..2317256 100755 --- a/dot_config/waybar/executable_update-status.sh +++ b/dot_config/waybar/executable_update-status.sh @@ -26,16 +26,16 @@ emit_empty() { [ -r "$LOG" ] || emit_empty # Pacman log lines look like: [2026-05-07T08:30:00+0000] [PACMAN] starting full system upgrade -last=$(grep -F '[PACMAN] starting full system upgrade' "$LOG" \ - | tail -n1 \ - | sed -n 's/^\[\([^]]*\)\].*/\1/p') +last=$(grep -F '[PACMAN] starting full system upgrade' "$LOG" | + tail -n1 | + sed -n 's/^\[\([^]]*\)\].*/\1/p') [ -n "$last" ] || emit_empty last_epoch=$(date -d "$last" +%s 2>/dev/null) || emit_empty now=$(date +%s) -elapsed=$(( now - last_epoch )) -hours=$(( elapsed / 3600 )) -days=$(( hours / 24 )) +elapsed=$((now - last_epoch)) +hours=$((elapsed / 3600)) +days=$((hours / 24)) [ "$hours" -lt 24 ] && emit_empty @@ -65,12 +65,12 @@ last_notified=0 if [ -f "$STATE" ]; then last_notified=$(cat "$STATE" 2>/dev/null || printf 0) case "$last_notified" in - ''|*[!0-9]*) last_notified=0 ;; + '' | *[!0-9]*) last_notified=0 ;; esac fi -if [ $(( now - last_notified )) -ge 86400 ] \ - && command -v notify-send >/dev/null 2>&1; then +if [ $((now - last_notified)) -ge 86400 ] && + command -v notify-send >/dev/null 2>&1; then notify-send \ --app-name=system-update \ --urgency="$urgency" \ |
