Krolyxon
Commit 4aa7bd9

Branches

Refs →

aurora4aa7bd9

hypr: fetch split-monitor-workspaces when missing instead of emergency mode

Author
krolyxon
Date
2026-11-08 18:54 +0530
Parent
6efc8ec
Commit
4aa7bd9d59e16e0c9c1546d3645927a96bbfc311

+33 −8

2 files changed

  1. M .config/hypr/hyprland.lua +18 −5
  2. M .local/bin/hypr/hypr_update_plugins.sh +15 −3
M .config/hypr/hyprland.lua View
@@ -27,7 +27,6 @@ hl.on("hyprland.start", function()
2727 hl.exec_cmd("gsettings set org.gnome.desktop.interface font-name 'JetBrainsMonoNL Nerd Font Mono 11'") -- Space fonts are aurora's only
2828 hl.exec_cmd("wl-paste --type text --watch cliphist store")
2929 hl.exec_cmd("wl-paste --type image --watch cliphist store")
30− hl.exec_cmd("hyprpm reload -n")
3130 -- aurora is a systemd unit: hand it the login env (.zprofile: SUDO_ASKPASS, EDITOR, XDG dirs, ...)
3231 hl.exec_cmd("dbus-update-activation-environment --systemd --all && systemctl --user start aurora-shell")
3332 -- hl.exec_cmd("waybar")
@@ -43,10 +42,24 @@ end)
4342 -- Plugins
4443 --------------------------------------------------
4544 package.path = package.path .. ";./?.lua;./?/init.lua"
46−smw = require("plugins.split-monitor-workspaces")
47−smw.setup({
48− workspace_count = 10,
49−})
45+-- split-monitor-workspaces is a git checkout in ~/.config/hypr/plugins, not in this repo (hypr_update_plugins.sh).
46+-- Missing (fresh install) = plain workspaces 1-10 with the same API for keybinds.lua, and fetch it + reload,
47+-- instead of a require error that leaves Hyprland in emergency mode with no binds.
48+local smw_ok, smw_mod = pcall(require, "plugins.split-monitor-workspaces")
49+if smw_ok then
50+ smw = smw_mod
51+ smw.setup({
52+ workspace_count = 10,
53+ })
54+else
55+ local function ws(n) return n == "0" and "10" or n end -- keybinds.lua binds workspace 10 to SUPER+0
56+ smw = {
57+ get_amount_of_workspaces = function() return 10 end,
58+ workspace = function(n) return hl.dsp.focus({ workspace = ws(n) }) end,
59+ move_to_workspace_silent = function(n) return hl.dsp.window.move({ workspace = ws(n), follow = false }) end,
60+ }
61+ hl.exec_cmd(HOME .. "/.local/bin/hypr/hypr_update_plugins.sh && hyprctl reload")
62+end
5063
5164 -- -----------------------------------------------------
5265 -- SOURCE FILES
M .local/bin/hypr/hypr_update_plugins.sh View
@@ -1,5 +1,17 @@
11 #!/bin/env bash
2+# Hyprland Lua plugins in ~/.config/hypr/plugins: clone the missing ones, update the rest.
3+# hyprland.lua runs this by itself when split-monitor-workspaces is missing, install.sh after stowing.
24
3−mkdir -p ~/.config/hypr/plugins
4−cd ~/.config/hypr/plugins
5−git clone https://github.com/zjeffer/split-monitor-workspaces
5+dir="$HOME/.config/hypr/plugins"
6+mkdir -p "$dir" || exit 1
7+
8+status=0
9+for url in https://github.com/zjeffer/split-monitor-workspaces; do
10+ name="$(basename "$url")"
11+ if [ -d "$dir/$name/.git" ]; then
12+ git -C "$dir/$name" pull --ff-only --quiet || status=1
13+ else
14+ git clone --quiet "$url" "$dir/$name" || status=1
15+ fi
16+done
17+exit "$status"