From 16cf5e0c2e1bb58bf85253f2081b98acf63f5d2f Mon Sep 17 00:00:00 2001 From: Trey Blancher Date: Mon, 23 Nov 2026 20:09:57 -0500 Subject: [PATCH] Update Hyprland config for Matugen and untrack generated files. --- .gitignore | 2 ++ colors.lua | 5 ----- functions.lua | 28 ++++++++++++++++++---------- hyprland.lua | 11 ++++++++++- hyprpaper.conf | 20 -------------------- legacy/autostart.conf | 2 +- legacy/keybindings.conf | 4 ++-- legacy/scripts/battery | 10 +++++----- legacy/scripts/startup.zsh | 2 +- scripts/battery-notify.sh | 18 ++++++++---------- 10 files changed, 47 insertions(+), 55 deletions(-) delete mode 100644 colors.lua delete mode 100644 hyprpaper.conf diff --git a/.gitignore b/.gitignore index 6b02fb6..633c170 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ *bak* +colors.lua +hyprpaper.conf diff --git a/colors.lua b/colors.lua deleted file mode 100644 index 75988f1..0000000 --- a/colors.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - active_border = "rgba(b4d088ff)", - inactive_border = "rgba(45483daa)", - shadow = "rgba(12140ebf)", -} diff --git a/functions.lua b/functions.lua index 429cb52..3746e33 100644 --- a/functions.lua +++ b/functions.lua @@ -290,7 +290,8 @@ function M.randomizeWallpaper() -- Pick a unique random image for each monitor math.randomseed(os.time()) local used = {} - local matugen_cmds = {} + local primary_img = nil + local fallback_img = nil local primary_logical_name = "eDP-1" for _, mon in ipairs(monitors) do if mon.description and mon.description:match("E3LMTF071391") then @@ -320,26 +321,24 @@ function M.randomizeWallpaper() table.insert(conf_lines, "}") table.insert(conf_lines, "") + if not fallback_img then fallback_img = img end + local logical_name = mon.name if mon.description then if mon.description:match("E3LMTF071438") then logical_name = "DP-7" end if mon.description:match("E3LMTF071391") then logical_name = "DP-8" end end - local matugen_cmd = "matugen image '" .. img .. "' -c /home/trey/src/dotfiles/matugen/matugen-" .. logical_name .. ".toml --source-color-index 0" - - -- Push primary monitor to the end of the array so its global configs (like tmux) overwrite the others if logical_name == primary_logical_name then - table.insert(matugen_cmds, matugen_cmd) - else - table.insert(matugen_cmds, 1, matugen_cmd) + primary_img = img end end end - if #matugen_cmds > 0 then - local all_cmds = table.concat(matugen_cmds, " ; ") + local matugen_img = primary_img or fallback_img + if matugen_img then + local matugen_cmd = "matugen image '" .. matugen_img .. "' -c " .. home .. "/src/dotfiles/matugen/config.toml --source-color-index 0" local reload_cmd = M.reloadAppsCmd() - hl.dispatch(hl.dsp.exec_cmd("bash -c \"" .. all_cmds .. " ; " .. reload_cmd .. "\"")) + hl.dispatch(hl.dsp.exec_cmd("bash -c \"" .. matugen_cmd .. " ; " .. reload_cmd .. "\"")) end local c = io.open(home .. "/.config/hypr/hyprpaper.conf", "w") @@ -409,4 +408,13 @@ function M.setupMonitors() -- hl.dispatch(hl.dsp.exec_cmd("bash -c '" .. table.concat(waybar_cmds, "\n") .. "'")) end +function M.fixHyprlock(clear_only) + if clear_only then + hl.clear_crashed_lockscreen() + else + hl.config({ misc = { allow_session_lock_restore = true } }) + hl.dispatch(hl.dsp.exec_cmd("hyprlock")) + end +end + return M diff --git a/hyprland.lua b/hyprland.lua index c9c94aa..4ea1590 100644 --- a/hyprland.lua +++ b/hyprland.lua @@ -37,7 +37,14 @@ hl.env("XDG_SESSION_DESKTOP", "Hyprland") ----------------------------------------------------- -- Appearance & Input (from appearance.conf & input.conf) ----------------------------------------------------- -local colors = require("colors") +local ok, colors = pcall(require, "colors") +if not ok then + colors = { + active_border = "rgba(ebdbb2ff)", + inactive_border = "rgba(504945aa)", + shadow = "rgba(1d2021bf)", + } +end hl.config({ general = { @@ -223,6 +230,8 @@ bind("SUPER + E", dsp.exec_cmd("nautilus")) -- Win+E for Explorer bind("SUPER + O", dsp.exec_cmd("ags request \"launcher:open\"")) -- Win+O for Open File bind("SUPER + SHIFT + O", dsp.exec_cmd("ags request \"launcher:openwith\"")) -- Win+Shift+O for Open With bind("SUPER + V", dsp.exec_cmd("ags request \"launcher:cliphist\"")) -- Win+V for Clipboard +bind("SUPER + X", dsp.exec_cmd("ags request \"close-notification\"")) -- Win+X for Close Notification +bind("SUPER + Y", dsp.exec_cmd("ags request \"close-all-notifications\"")) -- Win+Y for Close All Notifications bind("SUPER + SHIFT + S", function() fn.focusOrLaunch("pavucontrol", "org.pulseaudio.pavucontrol", "org.pulseaudio.pavucontrol") end) -- Window control diff --git a/hyprpaper.conf b/hyprpaper.conf deleted file mode 100644 index b4eec31..0000000 --- a/hyprpaper.conf +++ /dev/null @@ -1,20 +0,0 @@ -ipc = on -splash = false - -wallpaper { - monitor = eDP-1 - path = /home/trey/images/Seven Beats Music/2024-07-15.jpg - fit_mode = cover -} - -wallpaper { - monitor = DP-7 - path = /home/trey/images/Seven Beats Music/2024-12-09.jpg - fit_mode = cover -} - -wallpaper { - monitor = DP-8 - path = /home/trey/images/Seven Beats Music/2024-10-14.jpg - fit_mode = cover -} diff --git a/legacy/autostart.conf b/legacy/autostart.conf index 5702780..e1ff958 100644 --- a/legacy/autostart.conf +++ b/legacy/autostart.conf @@ -28,7 +28,7 @@ exec-once = uwsm app -- waybar exec-once = uwsm app -- espanso start # notification daemon -exec-once = uwsm app -- dunst +# exec-once = uwsm app -- dunst # systray apps exec-once = nm-applet diff --git a/legacy/keybindings.conf b/legacy/keybindings.conf index fe82d11..a3effa7 100644 --- a/legacy/keybindings.conf +++ b/legacy/keybindings.conf @@ -44,8 +44,8 @@ bind = SUPER, J, fullscreen, 1 #bind = SUPER, J, fullscreen, 1 # -bind = SUPER, X, exec, dunstctl close -bind = SUPER, Y, exec, dunstctl close-all +bind = SUPER, X, exec, ags request "close-notification" +bind = SUPER, Y, exec, ags request "close-all-notifications" # workspace control bind = SUPER, right, exec, $next_ws diff --git a/legacy/scripts/battery b/legacy/scripts/battery index 8b68c00..b15ee08 100755 --- a/legacy/scripts/battery +++ b/legacy/scripts/battery @@ -14,15 +14,15 @@ if [[ "$(charging_status)" == "Charging" ]] && \ [[ -f /run/user/${UID}/battery_low ]]; then logger "Power reconnected and above 5 percent, clearing nofication state." rm /run/user/${UID}/battery_low - for id in $(dunstctl history | jq '.data[0][] | select(.summary.data == "LOW BATTERY!")| .id.data' \ - | tee /tmp/dunst_history.json); do - dunstify --close=${id} - done + notify-send --urgency=normal \ + --icon=/usr/share/icons/breeze-dark/emblems/16/emblem-information.svg \ + 'Battery Charging' \ + 'Power connected. Battery level is rising.' elif [[ "$(charging_status)" == "Discharging" ]] && \ [[ $(battery_percentage) -le 5 ]] && \ [[ ! ( -f /run/user/${UID}/battery_low ) ]] ; then logger "Low power! Triggering notification...." - dunstify --urgency=critical \ + notify-send --urgency=critical \ --icon=/usr/share/icons/breeze-dark/emblems/16/emblem-warning.svg \ 'LOW BATTERY!' \ 'Battery level is low, plug power quick!' diff --git a/legacy/scripts/startup.zsh b/legacy/scripts/startup.zsh index 2410ae9..fc5c758 100755 --- a/legacy/scripts/startup.zsh +++ b/legacy/scripts/startup.zsh @@ -32,7 +32,7 @@ uwsm-app -- hyprpaper & uwsm-app -- espanso start & # notification daemon -uwsm-app -- dunst & +# uwsm-app -- dunst & # clipboard wl-paste --watch cliphist store & diff --git a/scripts/battery-notify.sh b/scripts/battery-notify.sh index 2ed17ba..25e446d 100644 --- a/scripts/battery-notify.sh +++ b/scripts/battery-notify.sh @@ -20,24 +20,22 @@ while true; do if [ "$STATUS" == "Discharging" ] && [ "$CAPACITY" -le 5 ]; then if [ ! -f "/run/user/${UID}/battery_low" ]; then logger "Low power! Triggering notification...." - # -p returns the ID so we can close it later - NOTIF_ID=$(dunstify --urgency=critical \ - -p \ + notify-send --urgency=critical \ --icon=/usr/share/icons/breeze-dark/emblems/16/emblem-warning.svg \ "LOW BATTERY!" \ - "Battery level is at ${CAPACITY}%, plug power quick!") - echo "$NOTIF_ID" > "/run/user/${UID}/battery_low" + "Battery level is at ${CAPACITY}%, plug power quick!" + touch "/run/user/${UID}/battery_low" fi - # Clear the notification if we plug back in and rise above 5% + # Clear the notification state if we plug back in and rise above 5% elif [ "$STATUS" == "Charging" ] && [ "$CAPACITY" -gt 5 ]; then if [ -f "/run/user/${UID}/battery_low" ]; then logger "Power reconnected and above 5 percent, clearing notification state." - NOTIF_ID=$(cat "/run/user/${UID}/battery_low") - if [ -n "$NOTIF_ID" ]; then - dunstify --close=$NOTIF_ID - fi + notify-send --urgency=normal \ + --icon=/usr/share/icons/breeze-dark/emblems/16/emblem-information.svg \ + "Battery Charging" \ + "Power connected. Battery level is at ${CAPACITY}%." rm -f "/run/user/${UID}/battery_low" fi