242 lines
10 KiB
Lua
242 lines
10 KiB
Lua
local var = require("modules.variables")
|
|
local command = require("modules.shell_commands")
|
|
local env = require("env")
|
|
-- 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 .. " + ALT + RETURN", hl.dsp.exec_cmd(var.terminal_tmux), { description = "Open terminal (kitty)" })
|
|
hl.bind(var.mainMod .. " + Q", hl.dsp.window.close(), { description = "Close focused window" })
|
|
hl.bind(
|
|
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(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(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" })
|
|
hl.bind(var.mainMod .. " + CTRL + l", hl.dsp.focus({ direction = "right" }), { description = "Focus window right" })
|
|
hl.bind(var.mainMod .. " + CTRL + k", hl.dsp.focus({ direction = "up" }), { description = "Focus window up" })
|
|
hl.bind(var.mainMod .. " + CTRL + j", hl.dsp.focus({ direction = "down" }), { description = "Focus window down" })
|
|
|
|
-- Move windows with mainMod or Vim-style
|
|
hl.bind(var.mainMod .. " + SHIFT + h", hl.dsp.window.move({ direction = "left" }), { description = "Move window left" })
|
|
hl.bind(
|
|
var.mainMod .. " + SHIFT + l",
|
|
hl.dsp.window.move({ direction = "right" }),
|
|
{ description = "Move window right" }
|
|
)
|
|
hl.bind(var.mainMod .. " + SHIFT + k", hl.dsp.window.move({ direction = "up" }), { description = "Move window up" })
|
|
hl.bind(var.mainMod .. " + SHIFT + j", hl.dsp.window.move({ direction = "down" }), { description = "Move window down" })
|
|
|
|
-- Resize focused window with mainMod + Arrows
|
|
hl.bind(
|
|
var.mainMod .. " + left",
|
|
hl.dsp.window.resize({ x = -10, y = 0, relative = true }),
|
|
{ description = "Resize window left" }
|
|
)
|
|
hl.bind(
|
|
var.mainMod .. " + right",
|
|
hl.dsp.window.resize({ x = 10, y = 0, relative = true }),
|
|
{ description = "Resize window right" }
|
|
)
|
|
hl.bind(
|
|
var.mainMod .. " + up",
|
|
hl.dsp.window.resize({ x = 0, y = -10, relative = true }),
|
|
{ description = "Resize window up" }
|
|
)
|
|
hl.bind(
|
|
var.mainMod .. " + down",
|
|
hl.dsp.window.resize({ x = 0, y = 10, relative = true }),
|
|
{ description = "Resize window down" }
|
|
)
|
|
|
|
-- Switch workspaces with mainMod + [0-9]
|
|
hl.bind(var.mainMod .. " + 1", hl.dsp.focus({ workspace = 1 }), { description = "Switch to workspace 1" })
|
|
hl.bind(var.mainMod .. " + 2", hl.dsp.focus({ workspace = 2 }), { description = "Switch to workspace 2" })
|
|
hl.bind(var.mainMod .. " + 3", hl.dsp.focus({ workspace = 3 }), { description = "Switch to workspace 3" })
|
|
hl.bind(var.mainMod .. " + 4", hl.dsp.focus({ workspace = 4 }), { description = "Switch to workspace 4" })
|
|
hl.bind(var.mainMod .. " + 5", hl.dsp.focus({ workspace = 5 }), { description = "Switch to workspace 5" })
|
|
hl.bind(var.mainMod .. " + 6", hl.dsp.focus({ workspace = 6 }), { description = "Switch to workspace 6" })
|
|
hl.bind(var.mainMod .. " + 7", hl.dsp.focus({ workspace = 7 }), { description = "Switch to workspace 7" })
|
|
hl.bind(var.mainMod .. " + 8", hl.dsp.focus({ workspace = 8 }), { description = "Switch to workspace 8" })
|
|
hl.bind(var.mainMod .. " + 9", hl.dsp.focus({ workspace = 9 }), { description = "Switch to workspace 9" })
|
|
hl.bind(var.mainMod .. " + 0", hl.dsp.focus({ workspace = 10 }), { description = "Switch to workspace 10" })
|
|
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"), {
|
|
repeating = true,
|
|
description = "Volume up",
|
|
})
|
|
hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), {
|
|
locked = true,
|
|
description = "Volume down",
|
|
})
|
|
|
|
-- Move active window to a workspace with mainMod + SHIFT + [0-9]
|
|
hl.bind(
|
|
var.mainMod .. " + SHIFT + 1",
|
|
hl.dsp.window.move({ workspace = 1 }),
|
|
{ description = "Move window to workspace 1" }
|
|
)
|
|
hl.bind(
|
|
var.mainMod .. " + SHIFT + 2",
|
|
hl.dsp.window.move({ workspace = 2 }),
|
|
{ description = "Move window to workspace 2" }
|
|
)
|
|
hl.bind(
|
|
var.mainMod .. " + SHIFT + 3",
|
|
hl.dsp.window.move({ workspace = 3 }),
|
|
{ description = "Move window to workspace 3" }
|
|
)
|
|
hl.bind(
|
|
var.mainMod .. " + SHIFT + 4",
|
|
hl.dsp.window.move({ workspace = 4 }),
|
|
{ description = "Move window to workspace 4" }
|
|
)
|
|
hl.bind(
|
|
var.mainMod .. " + SHIFT + 5",
|
|
hl.dsp.window.move({ workspace = 5 }),
|
|
{ description = "Move window to workspace 5" }
|
|
)
|
|
hl.bind(
|
|
var.mainMod .. " + SHIFT + 6",
|
|
hl.dsp.window.move({ workspace = 6 }),
|
|
{ description = "Move window to workspace 6" }
|
|
)
|
|
hl.bind(
|
|
var.mainMod .. " + SHIFT + 7",
|
|
hl.dsp.window.move({ workspace = 7 }),
|
|
{ description = "Move window to workspace 7" }
|
|
)
|
|
hl.bind(
|
|
var.mainMod .. " + SHIFT + 8",
|
|
hl.dsp.window.move({ workspace = 8 }),
|
|
{ description = "Move window to workspace 8" }
|
|
)
|
|
hl.bind(
|
|
var.mainMod .. " + SHIFT + 9",
|
|
hl.dsp.window.move({ workspace = 9 }),
|
|
{ description = "Move window to workspace 9" }
|
|
)
|
|
hl.bind(
|
|
var.mainMod .. " + SHIFT + 0",
|
|
hl.dsp.window.move({ workspace = 10 }),
|
|
{ description = "Move window to workspace 10" }
|
|
)
|
|
|
|
-- # Example special workspace (scratchpad)
|
|
|
|
-- bind = $mainMod, S, togglespecialworkspace, magic
|
|
|
|
-- bind = $mainMod SHIFT, S, movetoworkspace, special:magic
|
|
|
|
-- Scroll through existing workspaces with mainMod + scroll
|
|
hl.bind(
|
|
var.mainMod .. " + mouse_down",
|
|
hl.dsp.focus({ workspace = "e+1" }),
|
|
{ description = "Next workspace (scroll down)" }
|
|
)
|
|
hl.bind(
|
|
var.mainMod .. " + mouse_up",
|
|
hl.dsp.focus({ workspace = "e-1" }),
|
|
{ description = "Previous workspace (scroll up)" }
|
|
)
|
|
|
|
-- Move/resize windows with mainMod + LMB/RMB and dragging
|
|
hl.bind(var.mainMod .. " + mouse:272", hl.dsp.window.drag(), {
|
|
mouse = true,
|
|
description = "Move window with mouse",
|
|
})
|
|
hl.bind(var.mainMod .. " + mouse:273", hl.dsp.window.resize(), {
|
|
mouse = true,
|
|
description = "Resize window with mouse",
|
|
})
|
|
|
|
-- Laptop multimedia keys for volume and LCD brightness
|
|
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), {
|
|
repeating = true,
|
|
locked = true,
|
|
description = "Volume up (repeat)",
|
|
})
|
|
hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), {
|
|
repeating = true,
|
|
locked = true,
|
|
description = "Volume down (repeat)",
|
|
})
|
|
hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), {
|
|
repeating = true,
|
|
locked = true,
|
|
description = "Mute audio",
|
|
})
|
|
hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), {
|
|
repeating = true,
|
|
locked = true,
|
|
description = "Mute microphone",
|
|
})
|
|
hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%+"), {
|
|
repeating = true,
|
|
locked = true,
|
|
description = "Brightness up",
|
|
})
|
|
hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%-"), {
|
|
repeating = true,
|
|
locked = true,
|
|
description = "Brightness down",
|
|
})
|
|
|
|
-- Requires playerctl
|
|
hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), {
|
|
locked = true,
|
|
description = "Next track",
|
|
})
|
|
hl.bind("XF86AudioPause", hl.dsp.exec_cmd("playerctl play-pause"), {
|
|
locked = true,
|
|
description = "Play/Pause",
|
|
})
|
|
hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), {
|
|
locked = true,
|
|
description = "Play/Pause",
|
|
})
|
|
hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), {
|
|
locked = true,
|
|
description = "Previous track",
|
|
})
|
|
|
|
-- Screenshots
|
|
hl.bind("PRINT", hl.dsp.exec_cmd("hyprshot -m region --output-folder " .. var.screenshot_folder), {
|
|
locked = true,
|
|
description = "Screenshot region",
|
|
})
|
|
hl.bind("CTRL + PRINT", hl.dsp.exec_cmd("hyprshot -m window --output-folder " .. var.screenshot_folder), {
|
|
locked = true,
|
|
description = "Screenshot window",
|
|
})
|
|
hl.bind("SHIFT + PRINT", hl.dsp.exec_cmd("hyprshot -m active --output-folder " .. var.screenshot_folder), {
|
|
locked = true,
|
|
description = "Screenshot active monitor",
|
|
})
|
|
|
|
hl.bind(var.mainMod .. " + L", hl.dsp.exec_cmd(command.lock), { locked = true, description = "Lock screen" })
|
|
hl.bind(var.mainMod .. " + SHIFT + L", hl.dsp.exec_cmd(command.screensaver), { description = "Start screensaver (any key quits)" })
|
|
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" })
|
|
|
|
-- Caelestia extras
|
|
if env.shell == "caelestia" then
|
|
hl.bind(var.mainMod .. " + SHIFT + V", hl.dsp.exec_cmd(command.clipboard), { description = "Clipboard history" })
|
|
hl.bind(var.mainMod .. " + period", hl.dsp.exec_cmd(command.emoji), { description = "Emoji picker" })
|
|
hl.bind(var.mainMod .. " + SHIFT + K", hl.dsp.exec_cmd(command.show_all), { description = "Toggle utilities" })
|
|
hl.bind("CTRL + ALT + C", hl.dsp.exec_cmd(command.clear_notifications), { description = "Clear notifications" })
|
|
end
|