hypr: shell commands in dedicated model
This commit is contained in:
@@ -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" })
|
||||
|
||||
@@ -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",
|
||||
}
|
||||
@@ -16,6 +16,5 @@ return {
|
||||
mainMod = "SUPER",
|
||||
terminal = "kitty",
|
||||
fileManager = "dolphin",
|
||||
menu = "noctalia msg panel-toggle launcher",
|
||||
screenshot_folder = "~/Bilder/Screenshots/",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user