summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-01-28 06:18:25 -0600
committerCraig Jennings <c@cjennings.net>2026-01-28 06:18:25 -0600
commitef8b2e1fcd216ce6aed21f11e011246b033a9138 (patch)
tree5034869cb702b6d2830beb905d840060d4eff355
parentc42e4829181fbe65985b467c23ae41351b5aef9a (diff)
fix(hyprland): add persistent logging and fix waybar/script issues
- 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
-rwxr-xr-xarchsetup12
-rw-r--r--dotfiles/common/.Xresources4
-rw-r--r--dotfiles/common/.config/gtk-3.0/gtk.css2
-rw-r--r--dotfiles/hyprland/.config/hypr/hyprland.conf8
-rw-r--r--dotfiles/hyprland/.config/waybar/config2
-rwxr-xr-xdotfiles/hyprland/.local/bin/start-hyprland11
-rwxr-xr-xdotfiles/hyprland/.local/bin/toggle-scratchpad11
-rwxr-xr-xdotfiles/hyprland/.local/bin/waybar-layout16
8 files changed, 50 insertions, 16 deletions
diff --git a/archsetup b/archsetup
index 63e53ec..2b23a71 100755
--- a/archsetup
+++ b/archsetup
@@ -833,6 +833,17 @@ user_customizations() {
action="linking hyprland dotfiles" && display "task" "$action"
(cd "$dotfiles_dir" && stow --target="/home/$username" --no-folding --adopt hyprland \
>> "$logfile" 2>&1 ) || error_warn "$action" "$?"
+
+ # Remove battery module from waybar config on desktops (no battery)
+ if ! ls /sys/class/power_supply/BAT* &>/dev/null; then
+ action="removing waybar battery module (no battery detected)" && display "task" "$action"
+ waybar_config="/home/$username/.config/waybar/config"
+ # Remove "battery" from sysmonitor modules array and fix trailing comma
+ sed -i '/"battery"$/d' "$waybar_config"
+ sed -i 's/"custom\/disk",/"custom\/disk"/' "$waybar_config"
+ # Remove the battery config block
+ sed -i '/"battery": {/,/^ },$/d' "$waybar_config"
+ fi
fi
# Refresh font cache for any fonts in dotfiles
@@ -870,6 +881,7 @@ user_customizations() {
mkdir -p -m 751 "/home/$username/pictures/screenshots"
mkdir -p -m 751 "/home/$username/videos"
mkdir -p -m 751 "/home/$username/vms"
+ mkdir -p -m 751 "/home/$username/.local/var/log"
chown -R "$username": "/home/$username"
mkdir -p -m 751 /media/backup
diff --git a/dotfiles/common/.Xresources b/dotfiles/common/.Xresources
index 96e4803..4b35809 100644
--- a/dotfiles/common/.Xresources
+++ b/dotfiles/common/.Xresources
@@ -10,8 +10,8 @@ Xft.hintstyle: hintfull
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb
-Xcursor.size: 32
-Xcursor.theme: Vimix-white-cursors
+Xcursor.size: 24
+Xcursor.theme: Bibata-Modern-Ice
!! Emacs
Emacs*toolBar: 0
diff --git a/dotfiles/common/.config/gtk-3.0/gtk.css b/dotfiles/common/.config/gtk-3.0/gtk.css
index a1d4c13..cffaf78 100644
--- a/dotfiles/common/.config/gtk-3.0/gtk.css
+++ b/dotfiles/common/.config/gtk-3.0/gtk.css
@@ -1,6 +1,6 @@
.window-frame, .window-frame:backdrop {
box-shadow: 0 0 0 black; /* removes shadow completely */
border-style: none;
- margin: 1; /* this retains the ability to resize with the mouse, if 1px is too narrow, set some higher values */
+ margin: 1px; /* this retains the ability to resize with the mouse, if 1px is too narrow, set some higher values */
border-radius: 0;
}
diff --git a/dotfiles/hyprland/.config/hypr/hyprland.conf b/dotfiles/hyprland/.config/hypr/hyprland.conf
index 15f47ce..72178f0 100644
--- a/dotfiles/hyprland/.config/hypr/hyprland.conf
+++ b/dotfiles/hyprland/.config/hypr/hyprland.conf
@@ -11,12 +11,12 @@ monitor=,preferred,auto,auto
# Startup Applications
# ============================================================================
exec-once = hyprpm reload && sleep 1 && hyprctl dismissnotify -1
-exec-once = waybar
+exec-once = waybar > ~/.local/var/log/waybar-$(date +%Y-%m-%d-%H%M%S).log 2>&1
exec-once = swww-daemon && sleep 1 && swww img ~/pictures/wallpaper/trondheim-norway.jpg
-exec-once = dunst
-exec-once = hypridle
+exec-once = dunst > ~/.local/var/log/dunst-$(date +%Y-%m-%d-%H%M%S).log 2>&1
+exec-once = hypridle > ~/.local/var/log/hypridle-$(date +%Y-%m-%d-%H%M%S).log 2>&1
exec-once = /usr/lib/geoclue-2.0/demos/agent
-exec-once = gammastep
+exec-once = gammastep > ~/.local/var/log/gammastep-$(date +%Y-%m-%d-%H%M%S).log 2>&1
exec-once = blueman-applet
exec-once = /usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
diff --git a/dotfiles/hyprland/.config/waybar/config b/dotfiles/hyprland/.config/waybar/config
index fdff160..66e318b 100644
--- a/dotfiles/hyprland/.config/waybar/config
+++ b/dotfiles/hyprland/.config/waybar/config
@@ -1,7 +1,6 @@
{
"layer": "top",
"position": "top",
- "height": 30,
"spacing": 4,
"margin-top": 6,
"margin-left": 10,
@@ -24,6 +23,7 @@
"group/sysmonitor": {
"orientation": "horizontal",
+ "swap-icon-label": false,
"modules": [
"cpu",
"temperature",
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": "<span size='"'"'large'"'"'>󰕰</span>", "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