feat(hypr): rework Super+E/F binds, add magnifier zoom and monocle toggle

Super+E now toggles cursor "glass magnifier" zoom (wiki trick); Thunar
moves to Super+Shift+E and the pcmanfm-qt alt bind is dropped. Super+Alt+F
drops the calculator launch in favor of a real fullscreen toggle, and
Super+Ctrl+F is added to toggle the workspace's "monocle" layout via the
existing layouts registry. Also inlines unified-rotate.sh cw/ccw directly
in the Super+Ctrl+E/D rotation binds instead of going through the
confusingly-named (and reversed) screenrotationwcw/acw.sh wrapper scripts.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
main
Amir Alexander Abdelbaki 2026-07-24 10:49:59 +02:00
parent a8b98166cf
commit ba12c31e3e
2 changed files with 72 additions and 10 deletions

View File

@ -37,6 +37,28 @@ hl.gesture({ fingers = 4, direction = "up", action = function() hl.dispatc
hl.gesture({ fingers = 4, direction = "left", action = function() hl.dispatch(hl.dsp.window.move({ workspace = "r+1" })) end }) hl.gesture({ fingers = 4, direction = "left", action = function() hl.dispatch(hl.dsp.window.move({ workspace = "r+1" })) end })
hl.gesture({ fingers = 4, direction = "right", action = function() hl.dispatch(hl.dsp.window.move({ workspace = "r-1" })) end }) hl.gesture({ fingers = 4, direction = "right", action = function() hl.dispatch(hl.dsp.window.move({ workspace = "r-1" })) end })
--------------------
---- ZOOM ----------
--------------------
-- Glass magnifier zoom: https://wiki.hypr.land/Configuring/Advanced-and-Cool/Uncommon-tips-and-tricks/#glass-magnifier-zoom
local MAX_ZOOM = 3
local MIN_ZOOM = 1
local ZOOM_TOGGLE_FACTOR = 1.5
local function zoom(offset)
local current = hl.get_config("cursor.zoom_factor")
if offset ~= nil then
current = current + offset
elseif current ~= MIN_ZOOM then
current = MIN_ZOOM
else
current = ZOOM_TOGGLE_FACTOR
end
current = math.max(MIN_ZOOM, math.min(MAX_ZOOM, current))
hl.config({ cursor = { zoom_factor = current } })
end
hl.bind(mainMod .. " + E", function() zoom() end)
-------------------- --------------------
---- APPS ---------- ---- APPS ----------
-------------------- --------------------
@ -44,8 +66,7 @@ hl.gesture({ fingers = 4, direction = "right", action = function() hl.dispatc
hl.bind(mainMod .. " + T", hl.dsp.exec_cmd(terminal)) hl.bind(mainMod .. " + T", hl.dsp.exec_cmd(terminal))
hl.bind(mainMod .. " + SHIFT + T", hl.dsp.exec_cmd("cool-retro-term -p ~/Dotfiles/desktopenvs/hyprdrive/CRT")) hl.bind(mainMod .. " + SHIFT + T", hl.dsp.exec_cmd("cool-retro-term -p ~/Dotfiles/desktopenvs/hyprdrive/CRT"))
hl.bind(mainMod .. " + M", hl.dsp.exec_cmd(editor)) hl.bind(mainMod .. " + M", hl.dsp.exec_cmd(editor))
hl.bind(mainMod .. " + E", hl.dsp.exec_cmd(fileManager)) hl.bind(mainMod .. " + SHIFT + E", hl.dsp.exec_cmd(fileManager))
hl.bind(mainMod .. " + ALT + E", hl.dsp.exec_cmd("pcmanfm-qt"))
hl.bind(mainMod .. " + N", hl.dsp.exec_cmd("nextcloud")) hl.bind(mainMod .. " + N", hl.dsp.exec_cmd("nextcloud"))
-- Wi-Fi quick-pick (iwmenu --launcher walker) needs a dmenu-protocol launcher -- Wi-Fi quick-pick (iwmenu --launcher walker) needs a dmenu-protocol launcher
-- backend hyprdrive doesn't install; pending a hyprdrive-native replacement, -- backend hyprdrive doesn't install; pending a hyprdrive-native replacement,
@ -59,7 +80,6 @@ hl.bind("CTRL + SHIFT + R", hl.dsp.exec_cmd(menu))
-- File picker dialog -> clipboard (path / contents) -- File picker dialog -> clipboard (path / contents)
hl.bind(mainMod .. " + F", hl.dsp.exec_cmd("[tag +filepicker] ~/.config/scripts/filepicker-clipboard.sh path")) hl.bind(mainMod .. " + F", hl.dsp.exec_cmd("[tag +filepicker] ~/.config/scripts/filepicker-clipboard.sh path"))
hl.bind(mainMod .. " + SHIFT + F", hl.dsp.exec_cmd("[tag +filepicker] ~/.config/scripts/filepicker-clipboard.sh content")) hl.bind(mainMod .. " + SHIFT + F", hl.dsp.exec_cmd("[tag +filepicker] ~/.config/scripts/filepicker-clipboard.sh content"))
hl.bind(mainMod .. " + ALT + F", hl.dsp.exec_cmd("qalculate-gtk"))
hl.bind(mainMod .. " + S", hl.dsp.exec_cmd("[tag +mixer] pavucontrol")) hl.bind(mainMod .. " + S", hl.dsp.exec_cmd("[tag +mixer] pavucontrol"))
hl.bind(mainMod .. " + U", hl.dsp.exec_cmd("[tag +centered-L] kitty btop")) hl.bind(mainMod .. " + U", hl.dsp.exec_cmd("[tag +centered-L] kitty btop"))
@ -81,8 +101,19 @@ hl.bind(mainMod .. " + V", hl.dsp.window.float({ action = "toggle"
hl.bind(mainMod .. " + C", hl.dsp.window.pseudo()) hl.bind(mainMod .. " + C", hl.dsp.window.pseudo())
hl.bind(mainMod .. " + SHIFT + V", hl.dsp.window.tag({ tag = "+centered" })) hl.bind(mainMod .. " + SHIFT + V", hl.dsp.window.tag({ tag = "+centered" }))
hl.bind(mainMod .. " + SHIFT + Q", hl.dsp.exec_cmd("hyprctl kill")) hl.bind(mainMod .. " + SHIFT + Q", hl.dsp.exec_cmd("hyprctl kill"))
hl.bind(mainMod .. " + ALT + F", hl.dsp.exec_cmd("hyprctl dispatch fullscreen"))
hl.bind(mainMod .. " + CTRL + M", hl.dsp.exec_cmd("~/.config/scripts/toggle-layout.sh")) hl.bind(mainMod .. " + CTRL + M", hl.dsp.exec_cmd("~/.config/scripts/toggle-layout.sh"))
-- Switch the focused window's workspace to the "monocle" layout (one full-size window
-- at a time), toggling back to the session default (columns) on a second press.
-- Uses the same layouts registry the astro-menu popup drives via `hyprctl eval`.
local function toggle_monocle()
local ok, aw = pcall(hl.get_active_window)
if not ok or not aw or not aw.workspace then return end
local wid = tostring(aw.workspace.id)
layouts.set(wid, layouts.current[wid] == "monocle" and "columns" or "monocle")
end
hl.bind(mainMod .. " + CTRL + F", toggle_monocle)
-- lock/exit — hyprshutdown gracefully closes every app (with a UI) before it exits -- lock/exit — hyprshutdown gracefully closes every app (with a UI) before it exits
-- Hyprland and runs its --post-cmd, instead of yanking the session out from under them. -- Hyprland and runs its --post-cmd, instead of yanking the session out from under them.
@ -331,5 +362,5 @@ hl.bind(mainMod .. " + SHIFT + C", hl.dsp.exec_cmd("~/.config/scripts/caffeine.s
hl.bind(mainMod .. " + SHIFT + B", hl.dsp.exec_cmd("[tag +centered-S] kitty bash ~/.config/scripts/enroll-biometrics.sh")) hl.bind(mainMod .. " + SHIFT + B", hl.dsp.exec_cmd("[tag +centered-S] kitty bash ~/.config/scripts/enroll-biometrics.sh"))
hl.bind(mainMod .. " + SHIFT + X", hl.dsp.exec_cmd("~/.config/scripts/hyprland-toggle-touchpad.sh")) hl.bind(mainMod .. " + SHIFT + X", hl.dsp.exec_cmd("~/.config/scripts/hyprland-toggle-touchpad.sh"))
hl.bind(mainMod .. " + CTRL + E", hl.dsp.exec_cmd("~/.config/scripts/screenrotationwcw.sh")) hl.bind(mainMod .. " + CTRL + E", hl.dsp.exec_cmd("~/.config/scripts/unified-rotate.sh ccw"))
hl.bind(mainMod .. " + CTRL + D", hl.dsp.exec_cmd("~/.config/scripts/screenrotationacw.sh")) hl.bind(mainMod .. " + CTRL + D", hl.dsp.exec_cmd("~/.config/scripts/unified-rotate.sh cw"))

View File

@ -37,6 +37,28 @@ hl.gesture({ fingers = 4, direction = "up", action = function() hl.dispatc
hl.gesture({ fingers = 4, direction = "left", action = function() hl.dispatch(hl.dsp.window.move({ workspace = "r+1" })) end }) hl.gesture({ fingers = 4, direction = "left", action = function() hl.dispatch(hl.dsp.window.move({ workspace = "r+1" })) end })
hl.gesture({ fingers = 4, direction = "right", action = function() hl.dispatch(hl.dsp.window.move({ workspace = "r-1" })) end }) hl.gesture({ fingers = 4, direction = "right", action = function() hl.dispatch(hl.dsp.window.move({ workspace = "r-1" })) end })
--------------------
---- ZOOM ----------
--------------------
-- Glass magnifier zoom: https://wiki.hypr.land/Configuring/Advanced-and-Cool/Uncommon-tips-and-tricks/#glass-magnifier-zoom
local MAX_ZOOM = 3
local MIN_ZOOM = 1
local ZOOM_TOGGLE_FACTOR = 1.5
local function zoom(offset)
local current = hl.get_config("cursor.zoom_factor")
if offset ~= nil then
current = current + offset
elseif current ~= MIN_ZOOM then
current = MIN_ZOOM
else
current = ZOOM_TOGGLE_FACTOR
end
current = math.max(MIN_ZOOM, math.min(MAX_ZOOM, current))
hl.config({ cursor = { zoom_factor = current } })
end
hl.bind(mainMod .. " + E", function() zoom() end)
-------------------- --------------------
---- APPS ---------- ---- APPS ----------
-------------------- --------------------
@ -44,8 +66,7 @@ hl.gesture({ fingers = 4, direction = "right", action = function() hl.dispatc
hl.bind(mainMod .. " + T", hl.dsp.exec_cmd(terminal)) hl.bind(mainMod .. " + T", hl.dsp.exec_cmd(terminal))
hl.bind(mainMod .. " + SHIFT + T", hl.dsp.exec_cmd("cool-retro-term -p ~/Dotfiles/desktopenvs/hyprlua/CRT")) hl.bind(mainMod .. " + SHIFT + T", hl.dsp.exec_cmd("cool-retro-term -p ~/Dotfiles/desktopenvs/hyprlua/CRT"))
hl.bind(mainMod .. " + M", hl.dsp.exec_cmd(editor)) hl.bind(mainMod .. " + M", hl.dsp.exec_cmd(editor))
hl.bind(mainMod .. " + E", hl.dsp.exec_cmd(fileManager)) hl.bind(mainMod .. " + SHIFT + E", hl.dsp.exec_cmd(fileManager))
hl.bind(mainMod .. " + ALT + E", hl.dsp.exec_cmd("pcmanfm-qt"))
hl.bind(mainMod .. " + X", hl.dsp.exec_cmd("wofi --show=run")) hl.bind(mainMod .. " + X", hl.dsp.exec_cmd("wofi --show=run"))
hl.bind(mainMod .. " + N", hl.dsp.exec_cmd("nextcloud")) hl.bind(mainMod .. " + N", hl.dsp.exec_cmd("nextcloud"))
hl.bind(mainMod .. " + I", hl.dsp.exec_cmd("iwmenu --launcher walker")) hl.bind(mainMod .. " + I", hl.dsp.exec_cmd("iwmenu --launcher walker"))
@ -63,7 +84,6 @@ hl.bind(mainMod .. " + SHIFT + F", hl.dsp.exec_cmd("[tag +filepicker] ~/.c
-- old: -- old:
-- hl.bind(mainMod .. " + F", hl.dsp.exec_cmd("~/.config/scripts/wofi-file-search.sh")) -- hl.bind(mainMod .. " + F", hl.dsp.exec_cmd("~/.config/scripts/wofi-file-search.sh"))
-- hl.bind(mainMod .. " + SHIFT + F", hl.dsp.exec_cmd("~/.config/scripts/foldersearch.sh")) -- hl.bind(mainMod .. " + SHIFT + F", hl.dsp.exec_cmd("~/.config/scripts/foldersearch.sh"))
hl.bind(mainMod .. " + ALT + F", hl.dsp.exec_cmd("wofi-calc"))
hl.bind(mainMod .. " + S", hl.dsp.exec_cmd("[tag +mixer] pavucontrol")) hl.bind(mainMod .. " + S", hl.dsp.exec_cmd("[tag +mixer] pavucontrol"))
hl.bind(mainMod .. " + U", hl.dsp.exec_cmd("[tag +centered-L] kitty btop")) hl.bind(mainMod .. " + U", hl.dsp.exec_cmd("[tag +centered-L] kitty btop"))
@ -85,8 +105,19 @@ hl.bind(mainMod .. " + V", hl.dsp.window.float({ action = "toggle"
hl.bind(mainMod .. " + C", hl.dsp.window.pseudo()) hl.bind(mainMod .. " + C", hl.dsp.window.pseudo())
hl.bind(mainMod .. " + SHIFT + V", hl.dsp.window.tag({ tag = "+centered" })) hl.bind(mainMod .. " + SHIFT + V", hl.dsp.window.tag({ tag = "+centered" }))
hl.bind(mainMod .. " + SHIFT + Q", hl.dsp.exec_cmd("hyprctl kill")) hl.bind(mainMod .. " + SHIFT + Q", hl.dsp.exec_cmd("hyprctl kill"))
hl.bind(mainMod .. " + ALT + F", hl.dsp.exec_cmd("hyprctl dispatch fullscreen"))
hl.bind(mainMod .. " + CTRL + M", hl.dsp.exec_cmd("~/.config/scripts/toggle-layout.sh")) hl.bind(mainMod .. " + CTRL + M", hl.dsp.exec_cmd("~/.config/scripts/toggle-layout.sh"))
-- Switch the focused window's workspace to the "monocle" layout (one full-size window
-- at a time), toggling back to the session default (columns) on a second press.
-- Uses the same layouts registry the astal-menu popup drives via `hyprctl eval`.
local function toggle_monocle()
local ok, aw = pcall(hl.get_active_window)
if not ok or not aw or not aw.workspace then return end
local wid = tostring(aw.workspace.id)
layouts.set(wid, layouts.current[wid] == "monocle" and "columns" or "monocle")
end
hl.bind(mainMod .. " + CTRL + F", toggle_monocle)
-- lock/exit — hyprshutdown gracefully closes every app (with a UI) before it exits -- lock/exit — hyprshutdown gracefully closes every app (with a UI) before it exits
-- Hyprland and runs its --post-cmd, instead of yanking the session out from under them. -- Hyprland and runs its --post-cmd, instead of yanking the session out from under them.
@ -311,5 +342,5 @@ hl.bind(mainMod .. " + SHIFT + C", hl.dsp.exec_cmd("~/.config/scripts/caffeine.s
hl.bind(mainMod .. " + SHIFT + B", hl.dsp.exec_cmd("[tag +centered-S] kitty bash ~/.config/scripts/enroll-biometrics.sh")) hl.bind(mainMod .. " + SHIFT + B", hl.dsp.exec_cmd("[tag +centered-S] kitty bash ~/.config/scripts/enroll-biometrics.sh"))
hl.bind(mainMod .. " + SHIFT + X", hl.dsp.exec_cmd("~/.config/scripts/hyprland-toggle-touchpad.sh")) hl.bind(mainMod .. " + SHIFT + X", hl.dsp.exec_cmd("~/.config/scripts/hyprland-toggle-touchpad.sh"))
hl.bind(mainMod .. " + CTRL + E", hl.dsp.exec_cmd("~/.config/scripts/screenrotationwcw.sh")) hl.bind(mainMod .. " + CTRL + E", hl.dsp.exec_cmd("~/.config/scripts/unified-rotate.sh ccw"))
hl.bind(mainMod .. " + CTRL + D", hl.dsp.exec_cmd("~/.config/scripts/screenrotationacw.sh")) hl.bind(mainMod .. " + CTRL + D", hl.dsp.exec_cmd("~/.config/scripts/unified-rotate.sh cw"))