diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-02 12:16:38 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-02 12:16:38 -0500 |
| commit | 8c32bbbf9fab115dc51afa17c081e0763cbee717 (patch) | |
| tree | 246b46b53c956cfea07bc9d1c2b81f9f8de53d65 /dotfiles/hyprland/.local/bin | |
| parent | 3f370d6c19c83430547d1771b0e6fa669dc7d5c5 (diff) | |
| download | archsetup-8c32bbbf9fab115dc51afa17c081e0763cbee717.tar.gz archsetup-8c32bbbf9fab115dc51afa17c081e0763cbee717.zip | |
refactor: drop in-repo dotfiles/, move stow tooling to the dotfiles repo
Since the installer clones DOTFILES_REPO into ~/.dotfiles and stows from there, the in-repo dotfiles/ tree was dead weight. Nothing reads it at install time. I removed it (831 files) now that both machines are migrated.
The Makefile's stow / restow / reset / unstow / import targets and the dotfile-script unit suites moved to the dotfiles repo. They sit alongside the scripts they manage and run standalone (cd ~/.dotfiles && make ...). This Makefile keeps the VM-integration targets and the installer-helper suite (safe-rm-rf).
I updated CLAUDE.md and README.md so stow operations run from ~/.dotfiles, and the dotfile-management, theme, and unit-test sections point at the standalone repo. The README was already describing the old in-repo model from before the installer switched to cloning. This brings it in line.
Diffstat (limited to 'dotfiles/hyprland/.local/bin')
24 files changed, 0 insertions, 933 deletions
diff --git a/dotfiles/hyprland/.local/bin/airplane-mode b/dotfiles/hyprland/.local/bin/airplane-mode deleted file mode 100755 index 4f5ed9c..0000000 --- a/dotfiles/hyprland/.local/bin/airplane-mode +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/sh -# airplane-mode — toggle a low-power "airplane" state for a laptop. -# -# Engage: record the current state of each lever, then apply low-power values: -# - wifi off (nmcli; bluetooth is left alone, on purpose — earbuds) -# - CPU energy-performance preference -> power (intel_pstate, via sysfs) -# - display brightness dimmed -# - stop network-only services (VPNs, sync, discovery, inbound SSH) -# Disengage: read the recorded state and restore exactly what was there. A -# lever already in its low-power position before engaging (e.g. wifi already -# off, a service already stopped) is left untouched on disengage. -# -# State lives at $XDG_RUNTIME_DIR/airplane-state as key=value lines. The -# waybar-airplane indicator reads `mode` from it. -# -# Env knobs (defaults are the real system; tests override them): -# AIRPLANE_EPP_GLOB glob of EPP sysfs files -# AIRPLANE_BRIGHTNESS_LOW brightnessctl target while engaged -# AIRPLANE_SYSTEM_SERVICES system units to stop (sudo) -# AIRPLANE_USER_SERVICES --user units to stop - -STATE_FILE="${XDG_RUNTIME_DIR:-/tmp}/airplane-state" -SUDO="${AIRPLANE_SUDO:-sudo}" -EPP_GLOB="${AIRPLANE_EPP_GLOB:-/sys/devices/system/cpu/cpu*/cpufreq/energy_performance_preference}" -BRIGHTNESS_LOW="${AIRPLANE_BRIGHTNESS_LOW:-35%}" -SYSTEM_SERVICES="${AIRPLANE_SYSTEM_SERVICES:-tailscaled.service proton.VPN.service avahi-daemon.service cups.service wsdd.service geoclue.service sshd.service fail2ban.service}" -USER_SERVICES="${AIRPLANE_USER_SERVICES:-syncthing.service}" - -read_key() { sed -n "s/^$1=//p" "$STATE_FILE" 2>/dev/null | head -n1; } - -set_epp() { - # Write $1 to every EPP file. Needs root; glob expands inside the subshell. - $SUDO sh -c "for f in $EPP_GLOB; do [ -e \"\$f\" ] && echo $1 > \"\$f\"; done" 2>/dev/null -} - -first_epp() { - for f in $EPP_GLOB; do - [ -e "$f" ] && { cat "$f"; return; } - done -} - -engage() { - # --- record current state --- - wifi_was=$(nmcli radio wifi 2>/dev/null) - epp_was=$(first_epp) - bright_was=$(brightnessctl get 2>/dev/null) - - stopped_system="" - for s in $SYSTEM_SERVICES; do - if systemctl is-active --quiet "$s" 2>/dev/null; then - $SUDO systemctl stop "$s" 2>/dev/null && stopped_system="$stopped_system $s" - fi - done - stopped_user="" - for s in $USER_SERVICES; do - if systemctl --user is-active --quiet "$s" 2>/dev/null; then - systemctl --user stop "$s" 2>/dev/null && stopped_user="$stopped_user $s" - fi - done - - # --- apply low-power settings --- - nmcli radio wifi off 2>/dev/null - set_epp power - brightnessctl set "$BRIGHTNESS_LOW" >/dev/null 2>&1 - - # --- persist what we recorded --- - { - echo "mode=on" - echo "wifi=$wifi_was" - echo "epp=$epp_was" - echo "brightness=$bright_was" - echo "stopped_system=$stopped_system" - echo "stopped_user=$stopped_user" - } > "$STATE_FILE" - - notify info "Airplane mode" "ON — wifi off, low power" 2>/dev/null -} - -disengage() { - wifi_was=$(read_key wifi) - epp_was=$(read_key epp) - bright_was=$(read_key brightness) - stopped_system=$(read_key stopped_system) - stopped_user=$(read_key stopped_user) - - # Only restore a lever that was NOT already in its low-power state. - [ "$wifi_was" = "enabled" ] && nmcli radio wifi on 2>/dev/null - [ -n "$epp_was" ] && set_epp "$epp_was" - [ -n "$bright_was" ] && brightnessctl set "$bright_was" >/dev/null 2>&1 - - for s in $stopped_system; do - $SUDO systemctl start "$s" 2>/dev/null - done - for s in $stopped_user; do - systemctl --user start "$s" 2>/dev/null - done - - echo "mode=off" > "$STATE_FILE" - notify info "Airplane mode" "OFF — settings restored" 2>/dev/null -} - -case "$(read_key mode)" in - on) disengage ;; - *) engage ;; -esac - -# Refresh the waybar indicator immediately (custom/airplane listens on signal 10). -pkill -RTMIN+10 waybar 2>/dev/null - -exit 0 diff --git a/dotfiles/hyprland/.local/bin/cycle-layout b/dotfiles/hyprland/.local/bin/cycle-layout deleted file mode 100755 index 310c182..0000000 --- a/dotfiles/hyprland/.local/bin/cycle-layout +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# Cycle through Hyprland layouts -# Cycle: master -> scrolling -> monocle -> floating -> master - -LAYOUT=$(hyprctl getoption general:layout -j | jq -r '.str') -FLOATING=$(hyprctl activewindow -j 2>/dev/null | jq -r '.floating // false') - -# Check if we're in "all floating" mode by checking layout -case "$LAYOUT" in - master) - hyprctl keyword general:layout scrolling - ;; - scrolling) - hyprctl keyword general:layout monocle - ;; - monocle) - # Switch to master but float all windows - hyprctl keyword general:layout master - hyprctl dispatch workspaceopt allfloat - ;; - *) - # Return to master tiled - hyprctl dispatch workspaceopt allfloat - hyprctl keyword general:layout master - hyprctl keyword master:orientation left - ;; -esac diff --git a/dotfiles/hyprland/.local/bin/hypr-refocus-scratchpad b/dotfiles/hyprland/.local/bin/hypr-refocus-scratchpad deleted file mode 100755 index 7a4bb38..0000000 --- a/dotfiles/hyprland/.local/bin/hypr-refocus-scratchpad +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# Refocus visible scratchpad after a window closes. -# Without this, closing a regular window while a scratchpad is visible -# leaves focus on the regular workspace instead of the scratchpad. - -SOCKET="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" - -socat -U - "UNIX-CONNECT:$SOCKET" | while read -r line; do - if [[ "$line" == closewindow* ]]; then - # Check if a special workspace is active on the current monitor - special=$(hyprctl monitors -j | python3 -c " -import json, sys -for m in json.load(sys.stdin): - sw = m.get('specialWorkspace', {}) - if sw.get('id', 0) != 0: - print(sw['name']) - break -" 2>/dev/null) - if [[ -n "$special" ]]; then - # Focus the top window on the special workspace - hyprctl dispatch focuswindow "workspace:$special" &>/dev/null - fi - fi -done diff --git a/dotfiles/hyprland/.local/bin/layout-cycle b/dotfiles/hyprland/.local/bin/layout-cycle deleted file mode 100755 index dcc7b6b..0000000 --- a/dotfiles/hyprland/.local/bin/layout-cycle +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# Cycle Hyprland layout forward (next) or backward (prev) -# Usage: layout-cycle next | layout-cycle prev - -LAYOUTS="master scrolling monocle" -CURRENT=$(hyprctl getoption general:layout -j | jq -r '.str') -DIR="${1:-next}" - -set -- $LAYOUTS -COUNT=$# -INDEX=0 - -i=0 -for layout in $LAYOUTS; do - if [ "$layout" = "$CURRENT" ]; then - INDEX=$i - break - fi - i=$((i + 1)) -done - -if [ "$DIR" = "next" ]; then - INDEX=$(( (INDEX + 1) % COUNT )) -else - INDEX=$(( (INDEX - 1 + COUNT) % COUNT )) -fi - -i=0 -for layout in $LAYOUTS; do - if [ $i -eq $INDEX ]; then - hyprctl keyword general:layout "$layout" - break - fi - i=$((i + 1)) -done diff --git a/dotfiles/hyprland/.local/bin/layout-navigate b/dotfiles/hyprland/.local/bin/layout-navigate deleted file mode 100755 index 89af45f..0000000 --- a/dotfiles/hyprland/.local/bin/layout-navigate +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# Layout-aware navigation for Hyprland -# Usage: layout-navigate <direction> [move] -# direction: next|prev -# move: if present, move window instead of focus - -DIR="$1" -MOVE="$2" - -ACTIVE_JSON=$(hyprctl activewindow -j) -FLOATING=$(echo "$ACTIVE_JSON" | jq -r '.floating') -WS_NAME=$(echo "$ACTIVE_JSON" | jq -r '.workspace.name') -LAYOUT=$(hyprctl getoption general:layout -j | jq -r '.str') - -# If the active window is in a special workspace (scratchpad overlay) and we -# are navigating focus (not moving), hide the overlay first. layoutmsg/cyclenext -# cannot cross the overlay→regular boundary, so without this the $mod+J key -# gets trapped inside the scratchpad. -case "$WS_NAME" in - special:*) - if [ "$MOVE" != "move" ]; then - hyprctl dispatch togglespecialworkspace "${WS_NAME#special:}" - # Re-read state: focus has moved to the regular workspace. - ACTIVE_JSON=$(hyprctl activewindow -j) - FLOATING=$(echo "$ACTIVE_JSON" | jq -r '.floating') - fi - ;; -esac - -# If current window is floating, use cyclenext to reach tiled windows -if [ "$FLOATING" = "true" ] && [ "$MOVE" != "move" ]; then - if [ "$DIR" = "next" ]; then - hyprctl dispatch cyclenext tiled - else - hyprctl dispatch cyclenext prev tiled - fi - exit 0 -fi - -case "$LAYOUT" in - scrolling) - # J (next) goes left, K (prev) goes right - if [ "$MOVE" = "move" ]; then - if [ "$DIR" = "next" ]; then - hyprctl dispatch swapwindow l - else - hyprctl dispatch swapwindow r - fi - else - if [ "$DIR" = "next" ]; then - hyprctl dispatch layoutmsg focus l - else - hyprctl dispatch layoutmsg focus r - fi - fi - ;; - *) - # master, dwindle, etc. - if [ "$MOVE" = "move" ]; then - if [ "$DIR" = "next" ]; then - hyprctl dispatch layoutmsg swapnext - else - hyprctl dispatch layoutmsg swapprev - fi - else - if [ "$DIR" = "next" ]; then - hyprctl dispatch layoutmsg cyclenext - else - hyprctl dispatch layoutmsg cycleprev - fi - fi - ;; -esac diff --git a/dotfiles/hyprland/.local/bin/layout-resize b/dotfiles/hyprland/.local/bin/layout-resize deleted file mode 100755 index 70742c5..0000000 --- a/dotfiles/hyprland/.local/bin/layout-resize +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# Layout-aware resize for Hyprland -# Usage: layout-resize <grow|shrink> - -DIR="$1" -LAYOUT=$(hyprctl getoption general:layout -j | jq -r '.str') - -case "$LAYOUT" in - scrolling) - if [ "$DIR" = "grow" ]; then - hyprctl dispatch resizeactive 50 0 - else - hyprctl dispatch resizeactive -50 0 - fi - ;; - *) - # master, dwindle, etc. - if [ "$DIR" = "grow" ]; then - hyprctl dispatch layoutmsg mfact 0.05 - else - hyprctl dispatch layoutmsg mfact -0.05 - fi - ;; -esac diff --git a/dotfiles/hyprland/.local/bin/monitor-dashboard b/dotfiles/hyprland/.local/bin/monitor-dashboard deleted file mode 100755 index ad456d4..0000000 --- a/dotfiles/hyprland/.local/bin/monitor-dashboard +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -# monitor-dashboard - system monitor -exec btop diff --git a/dotfiles/hyprland/.local/bin/pinentry-fuzzel b/dotfiles/hyprland/.local/bin/pinentry-fuzzel deleted file mode 100755 index 5c64968..0000000 --- a/dotfiles/hyprland/.local/bin/pinentry-fuzzel +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/sh - -ENABLE_LOGGING="TRUE" -logger() { - if [ "$ENABLE_LOGGING" == "TRUE" ]; then - /usr/bin/logger -t "${0} [$]" "$@"; - fi -} - -# Decode URL-encoded characters (%0A = newline, %20 = space, etc.) -decode() { - printf '%b' "$(echo "$1" | sed 's/%\([0-9A-Fa-f][0-9A-Fa-f]\)/\\x\1/g')" -} - -# Base command and misc variables -DESC="" -PROMPT="" -COUNTFILE="/tmp/pinentry-fuzzel-count-$$" - -# Check if this is a repeat prompt (within 5 seconds of last) -LASTFILE="/tmp/pinentry-fuzzel-last" -NOW=$(date +%s) -if [ -f "$LASTFILE" ]; then - LAST=$(cat "$LASTFILE") - if [ $((NOW - LAST)) -lt 5 ]; then - REPEAT=1 - else - REPEAT=0 - fi -else - REPEAT=0 -fi -echo "$NOW" > "$LASTFILE" - -echo "OK Please go ahead" -while read cmd rest; do - logger "RAW=< ${cmd} ${rest} >" - logger "cmd=<${cmd}> rest=<${rest}>" - - case $cmd in - GETINFO) - case "$rest" in - flavor) - echo "D fuzzel" - echo "OK" - ;; - version) - echo "D 0.1" - echo "OK" - ;; - ttyinfo) - echo "D - - -" - echo "OK" - ;; - pid) - echo "D $$" - echo "OK" - ;; - esac - ;; - - SETDESC) - DESC=$(decode "$rest") - echo "OK" - ;; - - SETERROR) - logger "ERROR $rest" - # Silently acknowledge errors (e.g., empty passphrase on escape) - echo "OK" - ;; - - SETPROMPT) - PROMPT=$(decode "$rest") - # Remove trailing colon if present (we add our own) - PROMPT="${PROMPT%:}" - echo "OK" - ;; - - GETPIN | getpin) - if [ "$REPEAT" -eq 0 ]; then - LABEL="password: " - else - LABEL="reenter: " - fi - PASS=$(fuzzel --prompt "$LABEL" --width 35 --lines 0 --cache /dev/null --password --dmenu --border-color=d47c59ff) - if [ -z "$PASS" ]; then - # User cancelled - return error to GPG - rm -f "$LASTFILE" - echo "ERR 83886179 Operation cancelled" - else - echo "D $PASS" - echo "OK" - fi - ;; - - BYE|bye) - echo "OK closing connection" - logger "EXITING" - exit 0 - ;; - - *) - echo "OK" - ;; - esac -done diff --git a/dotfiles/hyprland/.local/bin/screenshot b/dotfiles/hyprland/.local/bin/screenshot deleted file mode 100755 index 45925c6..0000000 --- a/dotfiles/hyprland/.local/bin/screenshot +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# Screenshot tool with fuzzel menu -# Usage: screenshot [region|fullscreen] - -DIR="$HOME/pictures/screenshots" -mkdir -p "$DIR" -FILE="$DIR/$(date +%Y-%m-%d_%H%M%S).png" - -# Capture -case "${1:-region}" in - region) grim -g "$(slurp)" "$FILE" || exit 1 ;; - fullscreen) grim "$FILE" || exit 1 ;; -esac - -# Menu -CHOICE=$(printf ' Copy Path\n Copy Image\n Annotate' | \ - fuzzel --dmenu --prompt "Screenshot: " --width 20 --lines 3) - -case "$CHOICE" in - *"Copy Path"*) echo -n "$FILE" | wl-copy --type text/plain ;; - *"Copy Image"*) wl-copy --type image/png < "$FILE" ;; - *"Annotate"*) satty --filename "$FILE" --output-filename "$FILE" --copy-command wl-copy ;; -esac diff --git a/dotfiles/hyprland/.local/bin/set-theme b/dotfiles/hyprland/.local/bin/set-theme deleted file mode 100755 index 075e47b..0000000 --- a/dotfiles/hyprland/.local/bin/set-theme +++ /dev/null @@ -1,129 +0,0 @@ -#!/bin/sh -# Theme switcher for Hyprland desktop -# Usage: set-theme <theme-name> -# set-theme --toggle -# set-theme --current -# Available themes: dupre, hudson - -THEME_DIR="$HOME/.config/themes" -CURRENT_FILE="$HOME/.config/current-theme" - -# Get current theme -get_current() { - if [ -f "$CURRENT_FILE" ]; then - cat "$CURRENT_FILE" - else - echo "hudson" # default - fi -} - -# List available themes -list_themes() { - for dir in "$THEME_DIR"/*/; do - basename "$dir" - done -} - -# Apply a theme -apply_theme() { - theme="$1" - - if [ ! -d "$THEME_DIR/$theme" ]; then - echo "Error: Theme '$theme' not found in $THEME_DIR" - echo "Available themes: $(list_themes | tr '\n' ' ')" - exit 1 - fi - - echo "Applying theme: $theme" - - # Copy configs that don't support sourcing - cp "$THEME_DIR/$theme/foot.ini" "$HOME/.config/foot/foot.ini" - cp "$THEME_DIR/$theme/fuzzel.ini" "$HOME/.config/fuzzel/fuzzel.ini" - cp "$THEME_DIR/$theme/waybar.css" "$HOME/.config/waybar/style.css" - cp "$THEME_DIR/$theme/dunstrc" "$HOME/.config/dunst/dunstrc" - cp "$THEME_DIR/$theme/hyprlock.conf" "$HOME/.config/hypr/hyprlock.conf" - cp "$THEME_DIR/$theme/Xresources" "$HOME/.Xresources" - - # Apply Xresources (for X11 apps and Emacs) - xrdb -merge "$HOME/.Xresources" 2>/dev/null - - # Apply Hyprland colors directly via hyprctl - case "$theme" in - dupre) - # Window borders - hyprctl keyword general:col.active_border "rgba(d7af5fff)" - hyprctl keyword general:col.inactive_border "rgba(474544ff)" - ;; - hudson) - # Window borders - hyprctl keyword general:col.active_border "rgba(daa520ff)" - hyprctl keyword general:col.inactive_border "rgba(444444ff)" - ;; - esac - - # Save current theme - echo "$theme" > "$CURRENT_FILE" - - # Set default wallpaper - swww img ~/pictures/wallpaper/trondheim-norway.jpg 2>/dev/null - - # Reload applications - killall -SIGUSR2 waybar 2>/dev/null - pkill dunst && dunst & - - # Notify user - notify-send "Theme" "Switched to $theme" -t 2000 - - echo "Theme '$theme' applied. Open new terminals to see changes." -} - -# Toggle between themes -toggle_theme() { - current=$(get_current) - case "$current" in - dupre) apply_theme "hudson" ;; - hudson) apply_theme "dupre" ;; - *) apply_theme "dupre" ;; - esac -} - -# Show picker with fuzzel -pick_theme() { - themes=$(list_themes) - current=$(get_current) - selected=$(echo "$themes" | fuzzel --dmenu --prompt "Theme (current: $current): ") - if [ -n "$selected" ]; then - apply_theme "$selected" - fi -} - -# Main -case "$1" in - --toggle|-t) - toggle_theme - ;; - --current|-c) - get_current - ;; - --list|-l) - list_themes - ;; - --pick|-p) - pick_theme - ;; - --help|-h) - echo "Usage: set-theme <theme-name>" - echo " set-theme --toggle Toggle between themes" - echo " set-theme --current Show current theme" - echo " set-theme --list List available themes" - echo " set-theme --pick Pick theme with fuzzel" - echo "" - echo "Available themes: $(list_themes | tr '\n' ' ')" - ;; - "") - pick_theme - ;; - *) - apply_theme "$1" - ;; -esac diff --git a/dotfiles/hyprland/.local/bin/start-hyprland b/dotfiles/hyprland/.local/bin/start-hyprland deleted file mode 100755 index a5d191d..0000000 --- a/dotfiles/hyprland/.local/bin/start-hyprland +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Wrapper to launch Hyprland with persistent logging -# Shadows /usr/bin/start-hyprland when ~/.local/bin is in PATH - -LOG_DIR="$HOME/.local/var/log" -TIMESTAMP=$(date +%Y-%m-%d-%H%M%S) -LOG_FILE="$LOG_DIR/hyprland-$TIMESTAMP.log" - -mkdir -p "$LOG_DIR" - -exec /usr/bin/start-hyprland "$@" > "$LOG_FILE" 2>&1 diff --git a/dotfiles/hyprland/.local/bin/stash-others b/dotfiles/hyprland/.local/bin/stash-others deleted file mode 100755 index 5af6743..0000000 --- a/dotfiles/hyprland/.local/bin/stash-others +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# Stash all unfocused windows on current workspace to special:stash - -focused=$(hyprctl activewindow -j | jq -r '.address') -workspace=$(hyprctl activewindow -j | jq -r '.workspace.id') - -# Get all windows on current workspace except the focused one -hyprctl clients -j | jq -r --arg focused "$focused" --argjson ws "$workspace" \ - '.[] | select(.workspace.id == $ws and .address != $focused) | .address' | \ -while read -r addr; do - hyprctl dispatch movetoworkspacesilent special:stash,address:"$addr" -done diff --git a/dotfiles/hyprland/.local/bin/stash-restore b/dotfiles/hyprland/.local/bin/stash-restore deleted file mode 100755 index ddaa5a4..0000000 --- a/dotfiles/hyprland/.local/bin/stash-restore +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# Restore all windows from special:stash to current workspace -# Preserves current master window position using batch commands - -workspace=$(hyprctl activeworkspace -j | jq -r '.id') -original_focus=$(hyprctl activewindow -j | jq -r '.address') - -# Get all windows in special:stash -stashed=$(hyprctl clients -j | jq -r '.[] | select(.workspace.name == "special:stash") | .address') - -if [ -z "$stashed" ]; then - exit 0 -fi - -# Restore each window, then swap original back to master (batched for atomicity) -for addr in $stashed; do - hyprctl --batch "dispatch movetoworkspacesilent $workspace,address:$addr ; dispatch focuswindow address:$original_focus ; dispatch layoutmsg swapwithmaster master" -done diff --git a/dotfiles/hyprland/.local/bin/stash-window b/dotfiles/hyprland/.local/bin/stash-window deleted file mode 100755 index 1ffab8c..0000000 --- a/dotfiles/hyprland/.local/bin/stash-window +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -# Stash the focused window to a special workspace - -hyprctl dispatch movetoworkspacesilent special:stash diff --git a/dotfiles/hyprland/.local/bin/toggle-scratchpad b/dotfiles/hyprland/.local/bin/toggle-scratchpad deleted file mode 100755 index b3da6b4..0000000 --- a/dotfiles/hyprland/.local/bin/toggle-scratchpad +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# Toggle a special workspace from waybar click -# Tracks state to handle focus-loss auto-close issue -# Usage: toggle-scratchpad <name> - -NAME="$1" -if [ -z "$NAME" ]; then - echo "Usage: toggle-scratchpad <name>" - exit 1 -fi - -# Auto-detect current Hyprland socket if env var is stale -if ! hyprctl version >/dev/null 2>&1; then - # Find the most recent Hyprland instance with a socket - for dir in /run/user/"$(id -u)"/hypr/*/; do - if [ -S "${dir}.socket.sock" ]; then - export HYPRLAND_INSTANCE_SIGNATURE="$(basename "$dir")" - break - fi - done -fi - -STATEFILE="/tmp/scratchpad-$NAME-open" -NOW=$(date +%s) - -# If state file exists and recent, scratchpad was open and just closed by focus loss -# Don't reopen it - user intended to close -if [ -f "$STATEFILE" ]; then - LAST=$(cat "$STATEFILE") - AGE=$((NOW - LAST)) - rm -f "$STATEFILE" - if [ "$AGE" -lt 2 ]; then - # Was just open, user clicked to close - don't reopen - exit 0 - fi -fi - -# Opening the scratchpad - mark timestamp -echo "$NOW" > "$STATEFILE" -hyprctl dispatch togglespecialworkspace "$NAME" diff --git a/dotfiles/hyprland/.local/bin/toggle-touchpad b/dotfiles/hyprland/.local/bin/toggle-touchpad deleted file mode 100755 index ed11674..0000000 --- a/dotfiles/hyprland/.local/bin/toggle-touchpad +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# Toggle the laptop touchpad on/off - -TOUCHPAD="pixa3854:00-093a:0274-touchpad" -STATE_FILE="${XDG_RUNTIME_DIR:-/tmp}/touchpad-state" - -# Default to enabled if no state file -if [ ! -f "$STATE_FILE" ]; then - echo "enabled" > "$STATE_FILE" -fi - -state=$(cat "$STATE_FILE") - -if [ "$state" = "enabled" ]; then - hyprctl keyword "device[$TOUCHPAD]:enabled" false >/dev/null - echo "disabled" > "$STATE_FILE" - notify info "Touchpad" "Disabled" --silent -else - hyprctl keyword "device[$TOUCHPAD]:enabled" true >/dev/null - echo "enabled" > "$STATE_FILE" - notify info "Touchpad" "Enabled" --silent -fi - -# Refresh the waybar indicator immediately (custom/touchpad listens on signal 9). -pkill -RTMIN+9 waybar 2>/dev/null diff --git a/dotfiles/hyprland/.local/bin/touchpad-auto b/dotfiles/hyprland/.local/bin/touchpad-auto deleted file mode 100755 index 830a8f2..0000000 --- a/dotfiles/hyprland/.local/bin/touchpad-auto +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# Auto-disable touchpad when an external mouse is connected, re-enable when removed. -# Watches Hyprland socket for device add/remove events. - -TOUCHPAD="pixa3854:00-093a:0274-touchpad" -STATE_FILE="${XDG_RUNTIME_DIR:-/tmp}/touchpad-state" - -has_external_mouse() { - hyprctl devices -j | jq -e '[.mice[] | select(.name != "'"$TOUCHPAD"'" and .name != "pixa3854:00-093a:0274-mouse" and (.name | test("frmw") | not))] | length > 0' >/dev/null 2>&1 -} - -set_touchpad() { - hyprctl keyword "device[$TOUCHPAD]:enabled" "$1" >/dev/null - if [ "$1" = "true" ]; then - echo "enabled" > "$STATE_FILE" - else - echo "disabled" > "$STATE_FILE" - fi - # Refresh the waybar indicator (custom/touchpad listens on signal 9). - pkill -RTMIN+9 waybar 2>/dev/null -} - -# Set initial state -if has_external_mouse; then - set_touchpad false -else - set_touchpad true -fi - -# BT mice may auto-reconnect after boot — recheck after delay -(sleep 10 && if has_external_mouse; then set_touchpad false; fi) & - -# Watch for device events -socat -u "UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" - | while read -r line; do - case "$line" in - mouseadded\>\>*|mouseremoved\>\>*) - sleep 0.5 - if has_external_mouse; then - set_touchpad false - else - set_touchpad true - fi - ;; - configreloaded\>\>*) - sleep 0.5 - if has_external_mouse; then - set_touchpad false - else - set_touchpad true - fi - ;; - esac -done diff --git a/dotfiles/hyprland/.local/bin/waybar-airplane b/dotfiles/hyprland/.local/bin/waybar-airplane deleted file mode 100755 index 21f869c..0000000 --- a/dotfiles/hyprland/.local/bin/waybar-airplane +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# Airplane-mode indicator for waybar. -# Reads the state file the airplane-mode toggle maintains; emits one JSON line -# (text + tooltip + class) for the custom/airplane module. The file holds -# key=value lines; only `mode` (on/off) matters here. Anything other than -# "on" reads as off, so a missing or garbled state file fails safe (airplane -# mode shown as inactive — i.e. radios assumed on). -# -# Laptop-only: airplane mode is meaningless on a desktop, so the module hides -# itself (emits nothing → waybar drops it) on machines with no battery. - -STATE_FILE="${XDG_RUNTIME_DIR:-/tmp}/airplane-state" -PS_DIR="${AIRPLANE_POWER_SUPPLY_DIR:-/sys/class/power_supply}" - -# Laptop check: a battery present means this is a portable machine. -is_laptop() { - for b in "$PS_DIR"/BAT*; do - [ -e "$b" ] && return 0 - done - return 1 -} - -is_laptop || exit 0 - -mode=$(sed -n 's/^mode=//p' "$STATE_FILE" 2>/dev/null | head -n1) - -# Same clear plane glyph in both states; the class drives the color (gold when -# engaged, default gray when not) so there's no slash to obscure the wings. -if [ "$mode" = "on" ]; then - echo "{\"text\": \"<span size='large'></span>\", \"tooltip\": \"Airplane mode ON — wifi off, low power\", \"class\": \"active\"}" -else - echo "{\"text\": \"<span size='large'></span>\", \"tooltip\": \"Airplane mode OFF\", \"class\": \"inactive\"}" -fi diff --git a/dotfiles/hyprland/.local/bin/waybar-date b/dotfiles/hyprland/.local/bin/waybar-date deleted file mode 100755 index 260b239..0000000 --- a/dotfiles/hyprland/.local/bin/waybar-date +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# Waybar date module with two-month calendar tooltip -DATE=$(date '+%a, %b %d %Y') -TODAY=$(date '+%-d') -MONTH=$(date '+%B %Y') - -# Generate current month (with today highlighted) stacked above next month -NEXT_M=$(date -d 'next month' '+%-m') -NEXT_Y=$(date -d 'next month' '+%Y') -CUR=$(cal | sed "s/\b${TODAY}\b/<span color='#daa520'><b><u>${TODAY}<\/u><\/b><\/span>/" | sed '/^[[:space:]]*$/d') -NEXT=$(cal "$NEXT_M" "$NEXT_Y" | sed '/^[[:space:]]*$/d') -HIGHLIGHTED=$(printf '%s\n\n%s' "$CUR" "$NEXT") - -TOOLTIP="<tt>${HIGHLIGHTED}</tt>" - -# Escape for JSON -TOOLTIP=$(echo "$TOOLTIP" | sed ':a;N;$!ba;s/\n/\\n/g') - -printf '{"text": "%s", "tooltip": "%s"}\n' "$DATE" "$TOOLTIP" diff --git a/dotfiles/hyprland/.local/bin/waybar-disk b/dotfiles/hyprland/.local/bin/waybar-disk deleted file mode 100755 index 6050653..0000000 --- a/dotfiles/hyprland/.local/bin/waybar-disk +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# Waybar disk usage module with warning/critical states -PCT=$(df --output=pcent / | tail -1 | tr -d ' %') -CLASS="" -[ "$PCT" -ge 80 ] && CLASS="warning" -[ "$PCT" -ge 90 ] && CLASS="critical" -printf '{"text": "%s%%", "class": "%s", "tooltip": "Root: %s%% used"}\n' "$PCT" "$CLASS" "$PCT" diff --git a/dotfiles/hyprland/.local/bin/waybar-layout b/dotfiles/hyprland/.local/bin/waybar-layout deleted file mode 100755 index 083e9ef..0000000 --- a/dotfiles/hyprland/.local/bin/waybar-layout +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# Hyprland layout indicator for waybar -# Shows current layout with nerd font icons -# Layouts: master -> scrolling -> monocle -> floating - -# Check if hyprctl is reachable -if ! hyprctl version >/dev/null 2>&1; then - echo '{"text": "<span size='"'"'large'"'"'></span>", "tooltip": "Hyprland not connected"}' - exit 0 -fi - -# Get current layout (redirect stderr to suppress connection errors) -LAYOUT=$(hyprctl getoption general:layout -j 2>/dev/null | jq -r '.str // "unknown"') - -# Check workspace rules for allfloat -WSRULES=$(hyprctl activeworkspace -j 2>/dev/null | jq -r '.rules // []') - -# Determine icon and tooltip -if [ "$LAYOUT" = "master" ] && echo "$WSRULES" | grep -q "allfloat"; then - ICON="" - TOOLTIP="Floating" -elif [ "$LAYOUT" = "scrolling" ]; then - ICON="" - TOOLTIP="Scrolling" -elif [ "$LAYOUT" = "monocle" ]; then - ICON="" - TOOLTIP="Monocle" -elif [ "$LAYOUT" = "master" ]; then - ICON="" - TOOLTIP="Master" -else - ICON="" - TOOLTIP="$LAYOUT" -fi - -echo "{\"text\": \"<span size='large'>$ICON</span>\", \"tooltip\": \"$TOOLTIP\"}" diff --git a/dotfiles/hyprland/.local/bin/waybar-netspeed b/dotfiles/hyprland/.local/bin/waybar-netspeed deleted file mode 100755 index c285ac5..0000000 --- a/dotfiles/hyprland/.local/bin/waybar-netspeed +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# Network status indicator for waybar -# Shows: WiFi icon (signal strength) + SSID, or Ethernet icon + interface -# Tooltip: upload/download speeds - -INTERFACE=$(ip route | awk '/default/ {print $5; exit}') - -if [ -z "$INTERFACE" ]; then - echo '{"text": " Offline", "tooltip": "No network connection", "class": "disconnected"}' - exit 0 -fi - -# Measure network speed (requires 1 second delay) -RX1=$(cat /sys/class/net/$INTERFACE/statistics/rx_bytes) -TX1=$(cat /sys/class/net/$INTERFACE/statistics/tx_bytes) -sleep 1 -RX2=$(cat /sys/class/net/$INTERFACE/statistics/rx_bytes) -TX2=$(cat /sys/class/net/$INTERFACE/statistics/tx_bytes) - -RX_RATE=$((RX2 - RX1)) -TX_RATE=$((TX2 - TX1)) - -format_speed() { - local bytes=$1 - if [ $bytes -ge 1073741824 ]; then - printf "%.2f GB/s" $(echo "scale=2; $bytes / 1073741824" | bc) - elif [ $bytes -ge 1048576 ]; then - printf "%.2f MB/s" $(echo "scale=2; $bytes / 1048576" | bc) - elif [ $bytes -ge 1024 ]; then - printf "%.2f KB/s" $(echo "scale=2; $bytes / 1024" | bc) - else - printf "%d B/s" $bytes - fi -} - -UP=$(format_speed $TX_RATE) -DOWN=$(format_speed $RX_RATE) - -# Determine connection type and get appropriate icon/label -if [ -d "/sys/class/net/$INTERFACE/wireless" ]; then - # WiFi connection - LABEL=$(iw dev "$INTERFACE" info 2>/dev/null | awk '/ssid/ {print $2}') - [ -z "$LABEL" ] && LABEL="WiFi" - - # Get signal strength in dBm - SIGNAL_DBM=$(iw dev "$INTERFACE" link 2>/dev/null | awk '/signal:/ {print $2}') - - # Select icon based on signal dBm - if [ -z "$SIGNAL_DBM" ]; then - ICON="" # No signal - elif [ "$SIGNAL_DBM" -ge -50 ]; then - ICON="" # Excellent - elif [ "$SIGNAL_DBM" -ge -60 ]; then - ICON="" # Good - elif [ "$SIGNAL_DBM" -ge -70 ]; then - ICON="" # Fair - elif [ "$SIGNAL_DBM" -ge -80 ]; then - ICON="" # Weak - else - ICON="" # No signal - fi -else - # Ethernet connection - ICON="" - LABEL="$INTERFACE" -fi - -TOOLTIP="Up: $UP\nDown: $DOWN" - -echo "{\"text\": \"<span size='large'>$ICON</span> $LABEL\", \"tooltip\": \"$TOOLTIP\", \"class\": \"connected\"}" diff --git a/dotfiles/hyprland/.local/bin/waybar-touchpad b/dotfiles/hyprland/.local/bin/waybar-touchpad deleted file mode 100755 index d3adddd..0000000 --- a/dotfiles/hyprland/.local/bin/waybar-touchpad +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# Touchpad on/off indicator for waybar. -# Reads the state file that toggle-touchpad and touchpad-auto maintain; emits -# one JSON line (text + tooltip + class) for the custom/touchpad module. -# Anything other than "disabled" reads as enabled, so a missing or garbled -# state file fails safe (pointer shown rather than hidden). - -STATE_FILE="${XDG_RUNTIME_DIR:-/tmp}/touchpad-state" -state=$(cat "$STATE_FILE" 2>/dev/null || echo enabled) - -if [ "$state" = "disabled" ]; then - echo "{\"text\": \"<span size='large'></span>\", \"tooltip\": \"Touchpad disabled\", \"class\": \"disabled\"}" -else - echo "{\"text\": \"<span size='large'></span>\", \"tooltip\": \"Touchpad enabled\", \"class\": \"enabled\"}" -fi diff --git a/dotfiles/hyprland/.local/bin/waybar-worldclock b/dotfiles/hyprland/.local/bin/waybar-worldclock deleted file mode 100755 index be483ed..0000000 --- a/dotfiles/hyprland/.local/bin/waybar-worldclock +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# Waybar world clock module with configurable timezone tooltip -CONF="${HOME}/.config/waybar/worldclock.conf" - -# Local time for bar display -TEXT=$(date '+%I:%M %p %Z') -LOCAL_TZ=$(readlink /etc/localtime | sed 's|.*/zoneinfo/||') - -# Build tooltip from config file -if [ -f "$CONF" ]; then - LINES="" - while IFS='|' read -r tz label; do - # Skip comments and blank lines - case "$tz" in \#*|"") continue ;; esac - TIME=$(TZ="$tz" date '+%a %I:%M %p %Z') - LINE=$(printf "%-16s %s" "$label" "$TIME") - # Highlight local timezone in gold - if [ "$tz" = "$LOCAL_TZ" ]; then - LINE="<span color='#daa520'>${LINE}</span>" - fi - if [ -z "$LINES" ]; then - LINES="$LINE" - else - LINES=$(printf "%s\n%s" "$LINES" "$LINE") - fi - done < "$CONF" - TOOLTIP="<tt>${LINES}</tt>" -else - TOOLTIP="No worldclock.conf found" -fi - -# Escape for JSON -TOOLTIP=$(echo "$TOOLTIP" | sed ':a;N;$!ba;s/\n/\\n/g') - -printf '{"text": "%s", "tooltip": "%s"}\n' "$TEXT" "$TOOLTIP" |
