261 lines
12 KiB
Lua
261 lines
12 KiB
Lua
local vars = require("modules.variables")
|
|
|
|
local mainMod = vars.mainMod
|
|
local ipc = "qs -c noctalia-shell ipc call"
|
|
|
|
-- 1. Basic Binds
|
|
hl.bind(mainMod .. " + Q", hl.dsp.exec(vars.terminal))
|
|
hl.bind("ALT + Q", hl.dsp.exec(vars.terminal .. " --class popup-term"))
|
|
hl.bind(mainMod .. " + W", hl.dsp.exec(vars.terminal .. " --class popup-term"))
|
|
hl.bind(mainMod .. " + C", hl.dsp.window.close())
|
|
hl.bind(mainMod .. " + SHIFT + CTRL + M", function()
|
|
hl.exec("command -v hyprshutdown >/dev/null 2>&1 && hyprshutdown || hyprctl dispatch exit")
|
|
end)
|
|
|
|
hl.bind(mainMod .. " + P", function()
|
|
hl.dispatch(hl.dsp.window.float({ action = "toggle" }))
|
|
hl.dispatch(hl.dsp.window.pin({ action = "toggle" }))
|
|
end)
|
|
|
|
hl.bind(mainMod .. " + SHIFT + BACKSLASH", hl.dsp.window.float({ action = "toggle" }))
|
|
hl.bind(mainMod .. " + BACKSLASH", hl.dsp.layout.msg("togglesplit"))
|
|
hl.bind(mainMod .. " + CTRL + BACKSLASH", hl.dsp.window.pseudo({ action = "toggle" }))
|
|
|
|
-- Compiler window
|
|
hl.bind(mainMod .. " + SHIFT + A", hl.dsp.window.tag("compiler"))
|
|
hl.bind(mainMod .. " + A", hl.dsp.exec("/home/venus/.config/hypr/scripts/compile.sh"))
|
|
|
|
-- 2. moving focus with vim
|
|
hl.bind(mainMod .. " + H", hl.dsp.focus({ direction = "left" }))
|
|
hl.bind(mainMod .. " + L", hl.dsp.focus({ direction = "right" }))
|
|
hl.bind(mainMod .. " + K", hl.dsp.focus({ direction = "up" }))
|
|
hl.bind(mainMod .. " + J", hl.dsp.focus({ direction = "down" }))
|
|
|
|
hl.bind(mainMod .. " + SHIFT + H", hl.dsp.window.move({ direction = "left" }))
|
|
hl.bind(mainMod .. " + SHIFT + L", hl.dsp.window.move({ direction = "right" }))
|
|
hl.bind(mainMod .. " + SHIFT + K", hl.dsp.window.move({ direction = "up" }))
|
|
hl.bind(mainMod .. " + SHIFT + J", hl.dsp.window.move({ direction = "down" }))
|
|
|
|
hl.bind(mainMod .. " + mouse_up", hl.dsp.workspace.m_relative(-1))
|
|
hl.bind(mainMod .. " + mouse_down", hl.dsp.workspace.m_relative(1))
|
|
|
|
hl.bind(mainMod .. " + SHIFT + mouse_up", hl.dsp.workspace.e_relative(-1))
|
|
hl.bind(mainMod .. " + SHIFT + mouse_down", hl.dsp.workspace.e_relative(1))
|
|
|
|
hl.bind(mainMod .. " + CTRL + right", hl.dsp.workspace.m_relative(1))
|
|
hl.bind(mainMod .. " + CTRL + left", hl.dsp.workspace.m_relative(-1))
|
|
|
|
hl.bind("CTRL + SPACE", hl.dsp.focus.current_or_last())
|
|
|
|
-- 3. resize with arrows
|
|
hl.bind(mainMod .. " + right", hl.dsp.window.resize({ x = 20, y = 0 }), { repeating = true })
|
|
hl.bind(mainMod .. " + left", hl.dsp.window.resize({ x = -20, y = 0 }), { repeating = true })
|
|
hl.bind(mainMod .. " + up", hl.dsp.window.resize({ x = 0, y = -20 }), { repeating = true })
|
|
hl.bind(mainMod .. " + down", hl.dsp.window.resize({ x = 0, y = 20 }), { repeating = true })
|
|
|
|
-- 4. Switch workspaces with mainMod + [0-9]
|
|
for i = 1, 9 do
|
|
hl.bind(mainMod .. " + " .. i, hl.dsp.workspace.id(i))
|
|
end
|
|
hl.bind(mainMod .. " + 0", hl.dsp.workspace.id(10))
|
|
|
|
-- 5. Move active window to a workspace with mainMod + SHIFT + [0-9]
|
|
for i = 1, 9 do
|
|
hl.bind(mainMod .. " + SHIFT + " .. i, hl.dsp.window.move_to_workspace(i))
|
|
end
|
|
hl.bind(mainMod .. " + SHIFT + 0", hl.dsp.window.move_to_workspace(10))
|
|
|
|
-- 6. special workspace (scratchpad)
|
|
hl.bind(mainMod .. " + S", hl.dsp.workspace.special("magic"))
|
|
hl.bind(mainMod .. " + SHIFT + S", hl.dsp.window.move_to_workspace("special:magic"))
|
|
|
|
hl.bind(mainMod .. " + B", hl.dsp.workspace.special("magic2"))
|
|
hl.bind(mainMod .. " + SHIFT + B", hl.dsp.window.move_to_workspace("special:book"))
|
|
|
|
hl.bind(mainMod .. " + D", function()
|
|
hl.exec("discord")
|
|
hl.dispatch(hl.dsp.workspace.special("discord"))
|
|
end)
|
|
|
|
hl.bind(mainMod .. " + E", function()
|
|
hl.exec(vars.email)
|
|
hl.dispatch(hl.dsp.workspace.special("email"))
|
|
end)
|
|
|
|
hl.bind(mainMod .. " + G", function()
|
|
hl.exec("steam -forcedesktopscaling 0.5")
|
|
hl.dispatch(hl.dsp.workspace.special("gaming"))
|
|
end)
|
|
|
|
hl.bind(mainMod .. " + N", hl.dsp.workspace.special("notes"))
|
|
hl.bind(mainMod .. " + X", hl.dsp.workspace.special("phantom"))
|
|
|
|
-- 8. Move/resize windows with mainMod + LMB/RMB and dragging
|
|
hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
|
|
hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
|
|
|
|
-- 9. Laptop multimedia keys for volume and LCD brightness
|
|
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), { repeating = true, locked = true })
|
|
hl.bind("XF86AudioLowerVolume", hl.dsp.exec("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { repeating = true, locked = true })
|
|
hl.bind("XF86AudioMute", hl.dsp.exec("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { repeating = true, locked = true })
|
|
hl.bind("XF86AudioMicMute", hl.dsp.exec("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), { repeating = true, locked = true })
|
|
hl.bind("XF86MonBrightnessUp", hl.dsp.exec("brightnessctl -e4 -n2 set 5%+"), { repeating = true, locked = true })
|
|
hl.bind("XF86MonBrightnessDown", hl.dsp.exec("brightnessctl -e4 -n2 set 5%-"), { repeating = true, locked = true })
|
|
|
|
-- Playerctl
|
|
hl.bind("XF86AudioNext", hl.dsp.exec("playerctl next"), { locked = true })
|
|
hl.bind("XF86AudioPause", hl.dsp.exec("playerctl play-pause"), { locked = true })
|
|
hl.bind("XF86AudioPlay", hl.dsp.exec("playerctl play-pause"), { locked = true })
|
|
hl.bind("XF86AudioPrev", hl.dsp.exec("playerctl previous"), { locked = true })
|
|
hl.bind("ALT + mouse:274", hl.dsp.exec("playerctl play-pause"))
|
|
|
|
-- 10. Applications and shortcuts
|
|
hl.bind(mainMod .. " + F", hl.dsp.exec("firefox"))
|
|
hl.bind(mainMod .. " + SHIFT + F", hl.dsp.exec("qutebrowser"))
|
|
hl.bind(mainMod .. " + SHIFT + Q", hl.dsp.exec("qutebrowser"))
|
|
hl.bind(mainMod .. " + SPACE", hl.dsp.exec("playerctl play-pause"))
|
|
hl.bind("ALT + C", hl.dsp.exec(ipc .. " plugin:clipper openPanel"))
|
|
hl.bind("code:148", hl.dsp.exec("kitty --class calc-term -o 'confirm_os_window_close 0' /home/venus/.cargo/bin/mathypad"))
|
|
hl.bind("SUPER + escape", hl.dsp.exec("kitty --class btop -o 'confirm_os_window_close 0' /usr/bin/btop"))
|
|
hl.bind("SUPER + SHIFT + escape", hl.dsp.exec("kitty --class btop -o 'confirm_os_window_close 0' /usr/bin/nvtop"))
|
|
hl.bind(mainMod .. " + I", function()
|
|
hl.exec("/home/venus/.config/scripts/connectPhone.sh")
|
|
hl.exec("scrcpy --no-audio --no-video --keyboard=uhid --mouse=uhid")
|
|
end)
|
|
hl.bind(mainMod .. " + SHIFT + I", function()
|
|
hl.exec("/home/venus/.config/scripts/connectPhone.sh")
|
|
hl.exec("scrcpy --no-audio --keyboard=uhid --mouse=uhid")
|
|
end)
|
|
hl.bind("CTRL + SHIFT + escape", hl.dsp.exec("btop++"))
|
|
hl.bind(mainMod .. " + T", function()
|
|
hl.exec("notify-send \"$(/home/venus/.config/hypr/scripts/getIp.sh)\"")
|
|
hl.exec("kdeconnect-app")
|
|
end)
|
|
|
|
-- 12. quick access to controls submap
|
|
hl.bind(mainMod .. " + comma", hl.dsp.exec(ipc .. " controlCenter toggle"))
|
|
hl.bind(mainMod .. " + period", hl.dsp.exec(ipc .. " settings toggle"))
|
|
hl.bind("PRINT", hl.dsp.exec("hyprshot -m active -m window --output-folder ~/Images/Screenshots"))
|
|
hl.bind("SHIFT + PRINT", hl.dsp.exec("hyprshot -m region --output-folder ~/Images/Screenshots"))
|
|
hl.bind("ALT + PRINT", hl.dsp.exec("hyprshot -m active -m output --output-folder ~/Images/Screenshots"))
|
|
|
|
hl.bind(mainMod .. " + M", function()
|
|
hl.exec(ipc .. " controlCenter toggle")
|
|
hl.dispatch(hl.dsp.submap("quick-settings"))
|
|
end)
|
|
|
|
hl.bind(mainMod .. " + O", hl.dsp.submap("open-apps"))
|
|
|
|
-- Submaps
|
|
hl.define_submap("quick-settings", function()
|
|
hl.bind("", "V", function()
|
|
hl.exec("protonvpn-app &")
|
|
hl.dispatch(hl.dsp.submap("vpn"))
|
|
end)
|
|
hl.bind("", "S", hl.dsp.exec(ipc .. " settings toggle"))
|
|
hl.bind("", "C", hl.dsp.exec(ipc .. " plugin:clipper togglePanel"))
|
|
hl.bind("", "P", hl.dsp.exec(ipc .. " sessionMenu toggle"))
|
|
hl.bind(mainMod .. " + L", hl.dsp.exec(ipc .. " sessionMenu toggle"))
|
|
hl.bind("", "T", hl.dsp.exec(ipc .. " systemMonitor toggle"))
|
|
hl.bind("", "M", hl.dsp.exec(ipc .. " controlCenter toggle"))
|
|
hl.bind("", "D", hl.dsp.exec(ipc .. " notifications toggleDND"))
|
|
hl.bind("", "A", hl.dsp.exec(ipc .. " notifications dismissAll"))
|
|
hl.bind("", "N", function()
|
|
hl.exec(ipc .. " notifications toggleHistory")
|
|
hl.dispatch(hl.dsp.submap("notifications-sub"))
|
|
end)
|
|
hl.bind("", "L", hl.dsp.submap("layouts"))
|
|
hl.bind("SHIFT", "B", hl.dsp.exec(ipc .. " bar toggle"))
|
|
hl.bind("", "P", hl.dsp.exec(ipc .. " wallpaper toggle"))
|
|
hl.bind("", "B", function()
|
|
hl.exec(ipc .. " bluetooth togglePanel")
|
|
hl.dispatch(hl.dsp.submap("bt-sub"))
|
|
end)
|
|
hl.bind("", "W", function()
|
|
hl.exec(ipc .. " network togglePanel")
|
|
hl.dispatch(hl.dsp.submap("wifi-sub"))
|
|
end)
|
|
hl.bind("SHIFT", "W", hl.dsp.exec(ipc .. " wifi toggle"))
|
|
hl.bind(mainMod .. " + B", hl.dsp.exec(ipc .. " battery togglePanel"))
|
|
hl.bind(mainMod .. " + C", hl.dsp.exec(ipc .. " calendar toggle"))
|
|
hl.bind("", "E", hl.dsp.exec("nvim /home/venus/.config/hypr/basic/keybinds"))
|
|
|
|
hl.bind("", "escape", hl.dsp.submap("reset"))
|
|
hl.bind("", "catchall", hl.dsp.submap("reset"))
|
|
end)
|
|
|
|
hl.define_submap("notifications-sub", function()
|
|
hl.bind("", "D", hl.dsp.exec(ipc .. " notifications toggleDND"))
|
|
hl.bind("", "S", hl.dsp.exec(ipc .. " notifications toggleDND"))
|
|
hl.bind("", "Q", hl.dsp.exec(ipc .. " notifications toggleDND"))
|
|
hl.bind("", "A", hl.dsp.exec(ipc .. " notifications dismissAll"))
|
|
hl.bind("CTRL", "D", hl.dsp.exec(ipc .. " notifications dismissAll"))
|
|
hl.bind("SHIFT", "D", hl.dsp.exec(ipc .. " notifications dismissAll"))
|
|
hl.bind(mainMod, "D", hl.dsp.exec(ipc .. " notifications dismissAll"))
|
|
hl.bind("", "C", hl.dsp.exec(ipc .. " notifications clear"))
|
|
hl.bind("", "catchall", function()
|
|
hl.dispatch(hl.dsp.submap("reset"))
|
|
hl.exec(ipc .. " notifications toggleHistory")
|
|
end)
|
|
end)
|
|
|
|
hl.define_submap("wifi-sub", function()
|
|
local call = ipc .. " wifi"
|
|
hl.bind("", "T", hl.dsp.exec(call .. " toggle"))
|
|
hl.bind("", "S", hl.dsp.exec(call .. " togglePanel"))
|
|
hl.bind("", "D", hl.dsp.exec(call .. " disable"))
|
|
hl.bind("", "E", hl.dsp.exec(call .. " enable"))
|
|
hl.bind("", "R", hl.dsp.exec("sudo systemctl restart iwd"))
|
|
hl.bind("", "catchall", function()
|
|
hl.dispatch(hl.dsp.submap("reset"))
|
|
hl.exec(ipc .. " network togglePanel")
|
|
end)
|
|
end)
|
|
|
|
hl.define_submap("bt-sub", function()
|
|
local call = ipc .. " bluetooth"
|
|
hl.bind("", "T", hl.dsp.exec(call .. " toggle"))
|
|
hl.bind("", "S", hl.dsp.exec(call .. " togglePanel"))
|
|
hl.bind("", "D", hl.dsp.exec(call .. " disable"))
|
|
hl.bind("", "E", hl.dsp.exec(call .. " enable"))
|
|
hl.bind("", "H", hl.dsp.exec("sh -c 'bluetoothctl connect 88:92:CC:53:88:7E' && notify-send 'connected to headphones'"))
|
|
hl.bind("", "J", hl.dsp.exec("sh -c 'bluetoothctl disconnect 88:92:CC:53:88:7E' && notify-send 'disconnected from headphones'"))
|
|
hl.bind("", "P", hl.dsp.exec("sh -c 'bluetoothctl connect 64:9D:38:E0:4D:02' && notify-send 'Connected to phone'"))
|
|
hl.bind("", "M", hl.dsp.exec("sh -c 'bluetoothctl disconnect 64:9D:38:E0:4D:02' && notify-send 'Disconnected from phone'"))
|
|
hl.bind("", "catchall", function()
|
|
hl.dispatch(hl.dsp.submap("reset"))
|
|
hl.exec(ipc .. " bluetooth togglePanel")
|
|
end)
|
|
end)
|
|
|
|
hl.define_submap("vpn", function()
|
|
local call = "protonvpn"
|
|
hl.bind("", "O", hl.dsp.exec(call .. "-app"))
|
|
hl.bind("", "C", hl.dsp.exec(call .. " connect"))
|
|
hl.bind("", "D", hl.dsp.exec(call .. " disconnect"))
|
|
hl.bind("", "catchall", hl.dsp.submap("reset"))
|
|
end)
|
|
|
|
hl.define_submap("open-apps", function()
|
|
hl.bind("", "S", hl.dsp.exec("signal-desktop"))
|
|
hl.bind("", "D", hl.dsp.exec("vesktop"))
|
|
hl.bind("", "F", hl.dsp.exec("firefox"))
|
|
hl.bind("", "Q", hl.dsp.exec("qutebrowser"))
|
|
hl.bind("", "M", hl.dsp.exec("feishin"))
|
|
hl.bind("", "O", hl.dsp.exec("obsidian"))
|
|
hl.bind("", "T", hl.dsp.exec("thunderbird"))
|
|
hl.bind("", "R", hl.dsp.exec("calibre"))
|
|
hl.bind("", "E", hl.dsp.exec("darktable"))
|
|
hl.bind("", "catchall", hl.dsp.submap("reset"))
|
|
end)
|
|
|
|
hl.define_submap("layouts", function()
|
|
hl.bind("", "D", hl.dsp.layout.msg("dwindle"))
|
|
hl.bind("", "M", hl.dsp.layout.msg("master"))
|
|
hl.bind("", "catchall", hl.dsp.submap("reset"))
|
|
end)
|
|
|
|
-- 13. Misc tools.
|
|
hl.bind("ALT + SPACE", hl.dsp.exec(vars.menu))
|
|
hl.bind(mainMod .. " + CTRL + L", hl.dsp.exec(ipc .. " lockScreen lock"))
|