Update Hyprland config for Matugen and untrack generated files.
This commit is contained in:
1 parent
60fe219ff7
commit
16cf5e0c2e
10 files changed
+47
-55
No files matched your search
@@ -1 +1,3 @@
|
||||
*bak*
|
||||
colors.lua
|
||||
hyprpaper.conf
|
||||
@@ -1,5 +0,0 @@
|
||||
return {
|
||||
active_border = "rgba(b4d088ff)",
|
||||
inactive_border = "rgba(45483daa)",
|
||||
shadow = "rgba(12140ebf)",
|
||||
}
|
||||
+18
-10
@@ -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
|
||||
+10
-1
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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!'
|
||||
|
||||
@@ -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 &
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user