hypr: shell commands in dedicated model

This commit is contained in:
2026-09-23 19:32:37 +02:00
parent 1d7ed473f6
commit 23d0d1ecd3
3 changed files with 25 additions and 32 deletions
+13 -31
View File
@@ -1,36 +1,27 @@
local var = require("modules.variables") local var = require("modules.variables")
local command = require("modules.shell_commands")
-- See https://wiki.hypr.land/Configuring/Keywords/ -- See https://wiki.hypr.land/Configuring/Keywords/
-- Example binds, see https://wiki.hypr.land/Configuring/Binds/ for more -- Example binds, see https://wiki.hypr.land/Configuring/Binds/ for more
hl.bind(var.mainMod .. " + RETURN", hl.dsp.exec_cmd(var.terminal), { description = "Open terminal (kitty)" }) hl.bind(var.mainMod .. " + RETURN", hl.dsp.exec_cmd(var.terminal), { description = "Open terminal (kitty)" })
hl.bind(var.mainMod .. " + Q", hl.dsp.window.close(), { description = "Close focused window" }) hl.bind(var.mainMod .. " + Q", hl.dsp.window.close(), { description = "Close focused window" })
-- Session menu (noctalia owns the session panel)
hl.bind(var.mainMod .. " + ESCAPE", hl.dsp.exec_cmd("noctalia msg panel-toggle session"), { description = "Session menu (logout/reboot/shutdown)" })
hl.bind( hl.bind(
var.mainMod .. " + SHIFT + ESCAPE", var.mainMod .. " + ESCAPE",
hl.dsp.exec_cmd("command -v noctalia >/dev/null 2>&1 && noctalia msg session logout || hyprctl dispatch exit"), hl.dsp.exec_cmd(command.session),
{ description = "Exit Hyprland" } { description = "Session menu (logout/reboot/shutdown)" }
)
hl.bind(
var.mainMod .. " + CTRL + ESCAPE",
hl.dsp.exec_cmd("noctalia msg session shutdown"),
{ description = "Power off the system" }
)
hl.bind(
var.mainMod .. " + ALT + ESCAPE",
hl.dsp.exec_cmd("noctalia msg session reboot"),
{ description = "Reboot the system" }
) )
hl.bind(var.mainMod .. " + SHIFT + ESCAPE", hl.dsp.exec_cmd(command.logout), { description = "Exit Hyprland" })
hl.bind(var.mainMod .. " + CTRL + ESCAPE", hl.dsp.exec_cmd(command.shutdown), { description = "Power off the system" })
hl.bind(var.mainMod .. " + ALT + ESCAPE", hl.dsp.exec_cmd(command.reboot), { description = "Reboot the system" })
hl.bind(var.mainMod .. " + E", hl.dsp.exec_cmd(var.fileManager), { description = "Open file manager (dolphin)" }) hl.bind(var.mainMod .. " + E", hl.dsp.exec_cmd(var.fileManager), { description = "Open file manager (dolphin)" })
hl.bind(var.mainMod .. " + V", hl.dsp.window.float({ action = "toggle" }), { description = "Toggle floating window" }) hl.bind(var.mainMod .. " + V", hl.dsp.window.float({ action = "toggle" }), { description = "Toggle floating window" })
hl.bind(var.mainMod .. " + SPACE", hl.dsp.exec_cmd(var.menu), { description = "Open app launcher (noctalia)" }) hl.bind(var.mainMod .. " + SPACE", hl.dsp.exec_cmd(command.menu), { description = "Open app launcher" })
hl.bind(var.mainMod .. " + P", hl.dsp.window.pseudo(), { description = "Toggle pseudo-tiling" }) hl.bind(var.mainMod .. " + P", hl.dsp.window.pseudo(), { description = "Toggle pseudo-tiling" })
hl.bind(var.mainMod .. " + SHIFT + J", hl.dsp.layout("togglesplit"), { description = "Toggle split layout" }) hl.bind(var.mainMod .. " + SHIFT + J", hl.dsp.layout("togglesplit"), { description = "Toggle split layout" })
hl.bind(var.mainMod .. " + I", hl.dsp.exec_cmd("firefox &"), { description = "Open Firefox" }) hl.bind(var.mainMod .. " + I", hl.dsp.exec_cmd("firefox &"), { description = "Open Firefox" })
hl.bind(var.mainMod .. " + n", hl.dsp.exec_cmd("nm-connection-editor"), { description = "Network manager" }) hl.bind(var.mainMod .. " + n", hl.dsp.exec_cmd("nm-connection-editor"), { description = "Network manager" })
hl.bind(var.mainMod .. " + comma", hl.dsp.exec_cmd("noctalia msg settings-toggle"), { description = "Noctalia settings" }) hl.bind(var.mainMod .. " + comma", hl.dsp.exec_cmd(command.settings), { description = "settings menu" })
hl.bind(var.mainMod .. " + S", hl.dsp.exec_cmd("noctalia msg panel-toggle control-center"), { description = "Control center (noctalia)" }) hl.bind(var.mainMod .. " + S", hl.dsp.exec_cmd(command.control_center), { description = "Control center" })
-- Move focus with mainMod or Vim-style -- Move focus with mainMod or Vim-style
hl.bind(var.mainMod .. " + CTRL + h", hl.dsp.focus({ direction = "left" }), { description = "Focus window left" }) hl.bind(var.mainMod .. " + CTRL + h", hl.dsp.focus({ direction = "left" }), { description = "Focus window left" })
@@ -234,15 +225,6 @@ hl.bind("SHIFT + PRINT", hl.dsp.exec_cmd("hyprshot -m active --output-folder " .
description = "Screenshot active monitor", description = "Screenshot active monitor",
}) })
-- Screenlock (noctalia owns the lock screen) hl.bind(var.mainMod .. " + L", hl.dsp.exec_cmd(command.lock), { locked = true, description = "Lock screen" })
hl.bind("CTRL + ALT + L", hl.dsp.exec_cmd("noctalia msg session lock"), { locked = true, description = "Lock screen" }) hl.bind(var.mainMod .. " + K", hl.dsp.exec_cmd(command.keybinds_show), { description = "Show keybind overview" })
hl.bind(var.mainMod .. " + L", hl.dsp.exec_cmd("noctalia msg session lock"), { locked = true, description = "Lock screen" }) hl.bind(var.mainMod .. " + W", hl.dsp.exec_cmd(command.wallpaper_select), { description = "Wallpaper select" })
-- Keybind overview popup
hl.bind(
var.mainMod .. " + K",
hl.dsp.exec_cmd("sh ~/.config/hypr/scripts/show-keybinds.sh"),
{ description = "Show keybind overview" }
)
hl.bind(var.mainMod .. " + W", hl.dsp.exec_cmd("noctalia msg panel-toggle wallpaper"), { description = "Wallpaper select (noctalia)" })
@@ -0,0 +1,12 @@
return {
session = "noctalia msg panel-toggle session",
logout = "command -v noctalia >/dev/null 2>&1 && noctalia msg session logout || hyprctl dispatch exit",
shutdown = "noctalia msg session shutdown",
reboot = "noctalia msg session reboot",
menu = "noctalia msg panel-toggle launcher",
settings = "noctalia msg settings-toggle",
control_center = "noctalia msg panel-toggle control-center",
lock = "noctalia msg session lock",
wallpaper_select = "noctalia msg panel-toggle wallpaper",
keybinds_show = "sh ~/.config/hypr/scripts/show-keybinds.sh",
}
-1
View File
@@ -16,6 +16,5 @@ return {
mainMod = "SUPER", mainMod = "SUPER",
terminal = "kitty", terminal = "kitty",
fileManager = "dolphin", fileManager = "dolphin",
menu = "noctalia msg panel-toggle launcher",
screenshot_folder = "~/Bilder/Screenshots/", screenshot_folder = "~/Bilder/Screenshots/",
} }