Fix: init o global via helpers.lua + launch shell on reload (not only hyprland.start)
swadhinbiswas committed 2 months ago
9fab3c1
1 parent 166f512
commit 9fab3c1
2 files changed
+18 -2
Showing 2 changed files+18-2
▼config/hypr/deo-autostart.lua
+14-2
| @@ -9,9 +9,14 @@ | ||
9 | 9 | -- * dedupes cliphist watchers (host execs already start two) |
10 | 10 | -- Then loads stock Omarchy autostart (shell supervisor, monitor watch, |
11 | 11 | -- udiskie, power profiles, post-boot hooks). |
12 | +-- | |
13 | +-- The supervisor is launched BOTH on session start (`hyprland.start`) and | |
14 | +-- immediately, so a plain `hyprctl reload` also brings the shell up — the | |
15 | +-- upstream autostart only hooks `hyprland.start`, which does not fire on | |
16 | +-- reload. | |
12 | 17 | -- ============================================================================ |
13 | 18 | |
14 | -hl.on("hyprland.start", function() | |
19 | +local function kill_old_shell() | |
15 | 20 | hl.exec_cmd( |
16 | 21 | "pkill -f 'quickshell.*-c moonshell' 2>/dev/null" |
17 | 22 | .. "; pkill -f 'moonshell shell' 2>/dev/null" |
| @@ -22,6 +27,13 @@ hl.on("hyprland.start", function() | ||
22 | 27 | .. "; wl-paste --type image --watch cliphist store &" |
23 | 28 | .. "; true" |
24 | 29 | ) |
30 | +end | |
31 | + | |
32 | +hl.on("hyprland.start", function() | |
33 | + kill_old_shell() | |
34 | + require("default.hypr.autostart") | |
25 | 35 | end) |
26 | 36 | |
27 | -require("default.hypr.autostart") | |
37 | +-- Also launch now so `hyprctl reload` (no fresh session) starts the shell. | |
38 | +kill_old_shell() | |
39 | +hl.exec_cmd("omarchy-launch-shell") | |
28 | 40 | |
▼config/hypr/deo-layer.lua
+4-0
| @@ -10,6 +10,10 @@ | ||
10 | 10 | |
11 | 11 | local require_optional = require("default.hypr.require_optional") |
12 | 12 | |
13 | +-- Omarchy's shared helpers — defines the global `o` (o.bind / o.window / etc.) | |
14 | +-- Without this, every downstream module that uses `o` fails with a nil error. | |
15 | +require("default.hypr.helpers") | |
16 | + | |
13 | 17 | -- Environment: OMARCHY_PATH, PATH with $OMARCHY_PATH/bin first, Wayland flags. |
14 | 18 | require("default.hypr.envs") |
15 | 19 | |
16 | 20 | |