From ef8b2e1fcd216ce6aed21f11e011246b033a9138 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 28 Jan 2026 06:18:25 -0600 Subject: fix(hyprland): add persistent logging and fix waybar/script issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add persistent logging for waybar, dunst, hypridle, gammastep to ~/.local/var/log/ - Create start-hyprland wrapper script for Hyprland logging - Fix waybar-layout and toggle-scratchpad to auto-detect Hyprland socket - Add swap-icon-label: false to waybar group, remove height setting - Fix GTK CSS margin units (1 → 1px) to silence deprecation warning - Add battery detection in archsetup to exclude module on desktops - Update cursor theme to Bibata-Modern-Ice size 24 --- dotfiles/hyprland/.local/bin/start-hyprland | 11 +++++++++++ dotfiles/hyprland/.local/bin/toggle-scratchpad | 11 +++++++++++ dotfiles/hyprland/.local/bin/waybar-layout | 16 ++++++++-------- 3 files changed, 30 insertions(+), 8 deletions(-) create mode 100755 dotfiles/hyprland/.local/bin/start-hyprland (limited to 'dotfiles/hyprland/.local') diff --git a/dotfiles/hyprland/.local/bin/start-hyprland b/dotfiles/hyprland/.local/bin/start-hyprland new file mode 100755 index 0000000..a5d191d --- /dev/null +++ b/dotfiles/hyprland/.local/bin/start-hyprland @@ -0,0 +1,11 @@ +#!/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/toggle-scratchpad b/dotfiles/hyprland/.local/bin/toggle-scratchpad index bb10ef7..b3da6b4 100755 --- a/dotfiles/hyprland/.local/bin/toggle-scratchpad +++ b/dotfiles/hyprland/.local/bin/toggle-scratchpad @@ -9,6 +9,17 @@ if [ -z "$NAME" ]; then 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) diff --git a/dotfiles/hyprland/.local/bin/waybar-layout b/dotfiles/hyprland/.local/bin/waybar-layout index 6c45877..62470aa 100755 --- a/dotfiles/hyprland/.local/bin/waybar-layout +++ b/dotfiles/hyprland/.local/bin/waybar-layout @@ -3,17 +3,17 @@ # Shows current layout with nerd font icons # Layouts: master -> tab group (monocle) -> scrolling -> floating -# Get current layout -LAYOUT=$(hyprctl getoption general:layout -j | jq -r '.str') - -# Check if workspace has allfloat enabled -ALLFLOAT=$(hyprctl activeworkspace -j | jq -r '.hasfullscreenwindow') +# Check if hyprctl is reachable +if ! hyprctl version >/dev/null 2>&1; then + echo '{"text": "󰕰", "tooltip": "Hyprland not connected"}' + exit 0 +fi -# Check if active window is floating -FLOATING=$(hyprctl activewindow -j 2>/dev/null | jq -r '.floating // false') +# 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 | jq -r '.rules // []') +WSRULES=$(hyprctl activeworkspace -j 2>/dev/null | jq -r '.rules // []') # Determine icon and tooltip if [ "$LAYOUT" = "master" ] && echo "$WSRULES" | grep -q "allfloat"; then -- cgit v1.2.3