3 Commits

Author SHA1 Message Date
trey 15a20af8a5 Added Ctrl-Alt-Delete menu 2026-06-28 14:42:47 -04:00
trey d014f9c268 Fixed workspace order in single-monitor mode 2026-06-28 13:35:06 -04:00
trey 76226cb637 Fixed randomizeWallpaper() 2026-06-28 11:53:26 -04:00
4 changed files with 73 additions and 9 deletions
+31 -3
View File
@@ -247,11 +247,29 @@ function M.randomizeWallpaper()
local home = os.getenv("HOME") local home = os.getenv("HOME")
local april_dir = home .. "/images/April" local april_dir = home .. "/images/April"
local sbm_dir = home .. "/images/Seven Beats Music" local sbm_dir = home .. "/images/Seven Beats Music"
local black_png = home .. "/images/black.png"
-- Choose image source based on monitor count -- Determine if we are on the home WiFi ("keep")
local img_dir = (#monitors <= 1) and april_dir or sbm_dir local is_home_wifi = false
local f = io.popen("bash -c '/usr/bin/iwgetid -r 2>/dev/null || /usr/bin/nmcli -t -f active,ssid dev wifi 2>/dev/null | grep \"^yes\" | cut -d: -f2'")
if f then
local ssid = f:read("*a")
f:close()
if ssid and ssid:match("keep") then
is_home_wifi = true
end
end
-- Select image source based on location
local img_dir = nil
if #monitors > 1 then
img_dir = sbm_dir
elseif is_home_wifi then
img_dir = april_dir
end
local images = {} local images = {}
if img_dir then
local handle = io.popen('find "' .. img_dir .. '" -type f \\( -name "*.jpg" -o -name "*.png" -o -name "*.jpeg" \\) 2>/dev/null') local handle = io.popen('find "' .. img_dir .. '" -type f \\( -name "*.jpg" -o -name "*.png" -o -name "*.jpeg" \\) 2>/dev/null')
if handle then if handle then
for line in handle:lines() do for line in handle:lines() do
@@ -259,9 +277,15 @@ function M.randomizeWallpaper()
end end
handle:close() handle:close()
end end
else
table.insert(images, black_png)
end
if #images == 0 then return end if #images == 0 then return end
-- Unload old wallpapers from memory
hl.dispatch(hl.dsp.exec_cmd("hyprctl hyprpaper unload all"))
-- Pick a unique random image for each monitor -- Pick a unique random image for each monitor
math.randomseed(os.time()) math.randomseed(os.time())
local used = {} local used = {}
@@ -277,8 +301,12 @@ function M.randomizeWallpaper()
end end
attempts = attempts + 1 attempts = attempts + 1
end end
if not img then img = images[1] end -- fallback if we run out of unique images
if img then if img then
hl.dispatch(hl.dsp.exec_cmd('hyprctl hyprpaper reload "' .. mon.name .. ',' .. img .. '"')) -- Standard hyprpaper IPC
hl.dispatch(hl.dsp.exec_cmd('hyprctl hyprpaper preload "' .. img .. '"'))
hl.dispatch(hl.dsp.exec_cmd('hyprctl hyprpaper wallpaper "' .. mon.name .. ',' .. img .. '"'))
end end
end end
end end
+1
View File
@@ -183,6 +183,7 @@ bind("SUPER + Q", dsp.exec_cmd("hyprctl reload && killall -SIGUSR2 waybar && not
-- BUG FIX: SUPER + SHIFT + Q was bound to both tmux kill and uwsm stop. -- BUG FIX: SUPER + SHIFT + Q was bound to both tmux kill and uwsm stop.
-- bind("SUPER + SHIFT + Q", dsp.exec_cmd("tmux kill-server")) -- bind("SUPER + SHIFT + Q", dsp.exec_cmd("tmux kill-server"))
bind("SUPER + SHIFT + Q", dsp.exec_cmd("killall -q signal-desktop; uwsm stop")) bind("SUPER + SHIFT + Q", dsp.exec_cmd("killall -q signal-desktop; uwsm stop"))
bind("CTRL + ALT + Delete", dsp.exec_cmd("bash ~/.config/hypr/scripts/sysmenu.sh"))
bind("SUPER + L", dsp.exec_cmd("hyprlock")) bind("SUPER + L", dsp.exec_cmd("hyprlock"))
bind("switch:Lid Switch", dsp.exec_cmd("hyprlock")) bind("switch:Lid Switch", dsp.exec_cmd("hyprlock"))
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
# Options for the menu
lock="Lock"
logout="Sign-Out"
reboot="Reboot"
poweroff="Power Off"
options="$lock\n$logout\n$reboot\n$poweroff"
# Fullscreen rofi menu with large centered text mimicking Windows 11
chosen=$(echo -e "$options" | rofi -dmenu -i -p "CTRL-ALT-DEL" \
-theme-str 'window { fullscreen: true; background-color: #000000cc; }' \
-theme-str 'mainbox { children: [listview]; padding: 25% 35%; }' \
-theme-str 'listview { columns: 1; lines: 4; spacing: 15px; scrollbar: false; }' \
-theme-str 'element { padding: 15px; border-radius: 10px; }' \
-theme-str 'element-text { horizontal-align: 0.5; vertical-align: 0.5; font: "sans-serif 20"; }' \
-theme-str 'element selected { background-color: #3366ff; text-color: white; }')
case $chosen in
$lock)
loginctl lock-session
;;
$logout)
hyprctl dispatch exit
;;
$reboot)
zsh -c 'source ~/.zsh_functions && reboot'
;;
$poweroff)
systemctl poweroff
;;
esac
+3 -1
View File
@@ -18,7 +18,9 @@ local function assign_workspaces()
package.loaded["workspace_config"] = nil -- force reload in case it changed package.loaded["workspace_config"] = nil -- force reload in case it changed
local ws_config = require("workspace_config") local ws_config = require("workspace_config")
for _, ws in ipairs(ws_config) do -- Iterate in REVERSE to assign the most negative IDs to the first items, counteracting Waybar's low-to-high sorting!
for i = #ws_config, 1, -1 do
local ws = ws_config[i]
local target_mon = has_dock and ws.monitor or "eDP-1" local target_mon = has_dock and ws.monitor or "eDP-1"
hl.workspace_rule({ workspace = "name:" .. ws.name, monitor = target_mon, persistent = true, default = true }) hl.workspace_rule({ workspace = "name:" .. ws.name, monitor = target_mon, persistent = true, default = true })
end end