diff --git a/hypr/.config/hypr/modules/keybinds.lua b/hypr/.config/hypr/modules/keybinds.lua index 3188652..d72d66e 100644 --- a/hypr/.config/hypr/modules/keybinds.lua +++ b/hypr/.config/hypr/modules/keybinds.lua @@ -1,36 +1,27 @@ - local var = require("modules.variables") +local command = require("modules.shell_commands") -- See https://wiki.hypr.land/Configuring/Keywords/ -- 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 .. " + 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( - var.mainMod .. " + SHIFT + ESCAPE", - hl.dsp.exec_cmd("command -v noctalia >/dev/null 2>&1 && noctalia msg session logout || hyprctl dispatch exit"), - { description = "Exit Hyprland" } -) -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" } + var.mainMod .. " + ESCAPE", + hl.dsp.exec_cmd(command.session), + { description = "Session menu (logout/reboot/shutdown)" } ) +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 .. " + 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 .. " + 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 .. " + 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 .. " + S", hl.dsp.exec_cmd("noctalia msg panel-toggle control-center"), { description = "Control center (noctalia)" }) +hl.bind(var.mainMod .. " + comma", hl.dsp.exec_cmd(command.settings), { description = "settings menu" }) +hl.bind(var.mainMod .. " + S", hl.dsp.exec_cmd(command.control_center), { description = "Control center" }) -- Move focus with mainMod or Vim-style 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", }) --- Screenlock (noctalia owns the lock screen) -hl.bind("CTRL + ALT + L", hl.dsp.exec_cmd("noctalia msg session lock"), { locked = true, description = "Lock screen" }) -hl.bind(var.mainMod .. " + L", hl.dsp.exec_cmd("noctalia msg session lock"), { locked = true, description = "Lock screen" }) - --- 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)" }) +hl.bind(var.mainMod .. " + L", hl.dsp.exec_cmd(command.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 .. " + W", hl.dsp.exec_cmd(command.wallpaper_select), { description = "Wallpaper select" }) diff --git a/hypr/.config/hypr/modules/shell_commands.lua b/hypr/.config/hypr/modules/shell_commands.lua new file mode 100644 index 0000000..15f7667 --- /dev/null +++ b/hypr/.config/hypr/modules/shell_commands.lua @@ -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", +} diff --git a/hypr/.config/hypr/modules/variables.lua b/hypr/.config/hypr/modules/variables.lua index 1694ef9..f4ad71f 100644 --- a/hypr/.config/hypr/modules/variables.lua +++ b/hypr/.config/hypr/modules/variables.lua @@ -16,6 +16,5 @@ return { mainMod = "SUPER", terminal = "kitty", fileManager = "dolphin", - menu = "noctalia msg panel-toggle launcher", screenshot_folder = "~/Bilder/Screenshots/", }