diff options
| author | Don Williams <Don.e.williams@gmail.com> | 2026-07-11 01:35:53 -0400 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-08-29 21:40:34 -0700 |
| commit | e44f3c46c8e3bf0ca74e780375599316fe5f2396 (patch) | |
| tree | 50a6a512e7b9fdafe53a48382bc0e4eabca68a5d /config/hypr/lua/startup.lua | |
| parent | 5c3d43b34594e2f7a6f4edd0640d2e44c51c8875 (diff) | |
Added qs-hyprview as alternative overview CTRL-TAB
Signed-off-by: Don Williams <Don.e.williams@gmail.com>
On branch development
Your branch is up to date with 'origin/development'.
Changes to be committed:
modified: config/hypr/configs/Startup_Apps.conf
modified: config/hypr/lua/keybinds.lua
modified: config/hypr/lua/startup.lua
modified: config/hypr/scripts/OverviewToggle.sh
modified: config/hypr/scripts/Refresh.sh
modified: config/hypr/scripts/RefreshNoWaybar.sh
new file: config/quickshell/qs-hyprview
Diffstat (limited to 'config/hypr/lua/startup.lua')
| -rw-r--r-- | config/hypr/lua/startup.lua | 93 |
1 files changed, 47 insertions, 46 deletions
diff --git a/config/hypr/lua/startup.lua b/config/hypr/lua/startup.lua index 1fa4df82..5f7d3b02 100644 --- a/config/hypr/lua/startup.lua +++ b/config/hypr/lua/startup.lua @@ -14,66 +14,67 @@ local userScripts = "$HOME/.config/hypr/UserScripts" local wallDir = "$HOME/Pictures/wallpapers" local session = os.getenv("HYPRLAND_INSTANCE_SIGNATURE") or "default" local function shell_quote(value) - return "'" .. tostring(value):gsub("'", "'\\''") .. "'" + return "'" .. tostring(value):gsub("'", "'\\''") .. "'" end local function exec_once(cmd) - -- Why this wrapper exists: - -- 1) Enforce once-per-Hypr-session startup behavior using marker files. - -- 2) Avoid startup race conditions by waiting for Wayland/Hypr sockets. - -- 3) Capture per-command logs to simplify troubleshooting in user setups. + -- Why this wrapper exists: + -- 1) Enforce once-per-Hypr-session startup behavior using marker files. + -- 2) Avoid startup race conditions by waiting for Wayland/Hypr sockets. + -- 3) Capture per-command logs to simplify troubleshooting in user setups. - local key = cmd:gsub("[^%w_.-]", "_"):sub(1, 80) - local marker = "/tmp/hypr-lua-exec-once-" .. session .. "-" .. key - local log = "/tmp/hypr-lua-startup-" .. key .. ".log" - local readiness = - 'runtime=${XDG_RUNTIME_DIR:-/run/user/$(id -u)}; export XDG_RUNTIME_DIR="$runtime"; for _ in $(seq 1 200); do if [ -n "$WAYLAND_DISPLAY" ] && [ -S "$runtime/$WAYLAND_DISPLAY" ]; then break; fi; for sock in "$runtime"/wayland-[0-9]*; do [ -S "$sock" ] || continue; case "$(basename "$sock")" in *awww*) continue ;; esac; export WAYLAND_DISPLAY="$(basename "$sock")"; break 2; done; sleep 0.1; done; if [ -n "$HYPRLAND_INSTANCE_SIGNATURE" ]; then hypr_sock="$runtime/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket.sock"; for _ in $(seq 1 200); do [ -S "$hypr_sock" ] && break; sleep 0.1; done; fi' - local inner = readiness .. "; " .. cmd - local script = "[ -e " - .. shell_quote(marker) - .. " ] || { touch " - .. shell_quote(marker) - .. " && sh -lc " - .. shell_quote(inner) - .. " >>" - .. shell_quote(log) - .. " 2>&1 & }" - os.execute("sh -lc " .. shell_quote(script)) + local key = cmd:gsub("[^%w_.-]", "_"):sub(1, 80) + local marker = "/tmp/hypr-lua-exec-once-" .. session .. "-" .. key + local log = "/tmp/hypr-lua-startup-" .. key .. ".log" + local readiness = + 'runtime=${XDG_RUNTIME_DIR:-/run/user/$(id -u)}; export XDG_RUNTIME_DIR="$runtime"; for _ in $(seq 1 200); do if [ -n "$WAYLAND_DISPLAY" ] && [ -S "$runtime/$WAYLAND_DISPLAY" ]; then break; fi; for sock in "$runtime"/wayland-[0-9]*; do [ -S "$sock" ] || continue; case "$(basename "$sock")" in *awww*) continue ;; esac; export WAYLAND_DISPLAY="$(basename "$sock")"; break 2; done; sleep 0.1; done; if [ -n "$HYPRLAND_INSTANCE_SIGNATURE" ]; then hypr_sock="$runtime/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket.sock"; for _ in $(seq 1 200); do [ -S "$hypr_sock" ] && break; sleep 0.1; done; fi' + local inner = readiness .. "; " .. cmd + local script = "[ -e " + .. shell_quote(marker) + .. " ] || { touch " + .. shell_quote(marker) + .. " && sh -lc " + .. shell_quote(inner) + .. " >>" + .. shell_quote(log) + .. " 2>&1 & }" + os.execute("sh -lc " .. shell_quote(script)) end -- Prefer lifecycle-hook orchestration for clarity while keeping exec_once -- reliability semantics for real-world startup behavior. local startup_commands = { - scriptsDir .. "/WallpaperDaemon.sh", - "$HOME/.config/hypr/initial-boot.sh", - "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP", - "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP", - scriptsDir .. "/Polkit.sh", - "nm-applet", - -- nm-tray now optional for ubuntu - -- "nm-tray", - "swaync", - scriptsDir .. "/PortalHyprland.sh", - "sh $HOME/.config/hypr/scripts/ApplyThemeMode.sh", - "sh " .. scriptsDir .. "/WaybarStartup.sh", - "qs -c overview", - "hypridle", - scriptsDir .. "/Hyprsunset.sh init", - -- NOTE: Dropterminal is currently certified only with kitty. Not all terminals behave correctly as a dropdown. - scriptsDir .. "/Dropterminal.sh --startup kitty", - "wl-paste --type text --watch cliphist store", - "wl-paste --type image --watch cliphist store", + scriptsDir .. "/WallpaperDaemon.sh", + "$HOME/.config/hypr/initial-boot.sh", + "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP", + "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP", + scriptsDir .. "/Polkit.sh", + "nm-applet", + -- nm-tray now optional for ubuntu + -- "nm-tray", + "swaync", + scriptsDir .. "/PortalHyprland.sh", + "sh $HOME/.config/hypr/scripts/ApplyThemeMode.sh", + "sh " .. scriptsDir .. "/WaybarStartup.sh", + 'qs --log-rules "qt.qpa.wayland.textinput.warning=false" -c overview', + 'qs --log-rules "qt.qpa.wayland.textinput.warning=false" -c qs-hyprview', + "hypridle", + scriptsDir .. "/Hyprsunset.sh init", + -- NOTE: Dropterminal is currently certified only with kitty. Not all terminals behave correctly as a dropdown. + scriptsDir .. "/Dropterminal.sh --startup kitty", + "wl-paste --type text --watch cliphist store", + "wl-paste --type image --watch cliphist store", } local function run_startup_commands() - for _, cmd in ipairs(startup_commands) do - exec_once(cmd) - end + for _, cmd in ipairs(startup_commands) do + exec_once(cmd) + end end if hl and hl.on then - hl.on("hyprland.start", run_startup_commands) + hl.on("hyprland.start", run_startup_commands) else - -- Compatibility fallback for older/limited runtimes without hl.on. - run_startup_commands() + -- Compatibility fallback for older/limited runtimes without hl.on. + run_startup_commands() end -- Optional startup examples retained from the original config: |
