---- KEYBINDINGS ---- --------------------- ------@meta --## @declaration hl, ipc, mainMod local mainMod = "SUPER" -- Sets "Windows" key as main modifier local ipc = "qs -c noctalia-shell ipc call " local custom = require("custom-functions") local hyper = "MOD3" require("basic/submaps") ---- 1. WINDOW MANAGEMENT ---- -- 1.1 Workspace movement and tiling rule hl.bind(mainMod .. "+ P" ,hl.dsp.window.float({ action = "toggle" })) hl.bind(mainMod .. "+ P" ,hl.dsp.window.pin()) hl.bind(mainMod .. "+ SHIFT + BACKSLASH" ,hl.dsp.window.float({ action = "toggle"})) hl.bind(mainMod .. "+ BACKSLASH" ,hl.dsp.layout ("togglesplit")) hl.bind(mainMod .. "+ CTRL + BACKSLASH " ,hl.dsp.window.pseudo({action = "toggle"})) hl.bind(mainMod .. " + C " ,hl.dsp.window.close()) hl.bind(mainMod .. " + SHIFT + CTRL + M " ,hl.dsp.exit()) hl.gesture({ fingers = 3, direction = "horizontal", action = "workspace" }) -- 1.2 Layout management and advanced window management hl.bind(mainMod .. "+ SHIFT + I" ,hl.dsp.layout("swapwithmaster master")) hl.bind(mainMod .. "+ I" ,hl.dsp.layout("rollnext")) hl.bind(mainMod .. "+ O" ,hl.dsp.layout("swapnext loop")) hl.bind(mainMod .. "+ SHIFT + O" ,hl.dsp.layout("swapprev")) hl.bind(mainMod .. "+ SEMICOLON" ,hl.dsp.layout("orientationcycle right center left ")) hl.bind(mainMod .. " + SHIFT + SEMICOLON" ,hl.dsp.layout("orientationcycle top bottom")) -- 1.3 resize with arrows hl.bind(mainMod .. " + right " ,hl.dsp.window.resize({ x = 20, y = 0, relative = true}) , {repeating = true}) hl.bind(mainMod .. " + left " ,hl.dsp.window.resize({ x =-20, y = 0, relative = true}) , {repeating = true}) hl.bind(mainMod .. " + up " ,hl.dsp.window.resize({ x = 0, y = -20, relative = true}) , {repeating = true}) hl.bind(mainMod .. " + down " ,hl.dsp.window.resize({ x = 0, y = 20, relative = true}) , {repeating = true}) -- 1.4 Move active window to a workspace with mainMod + SHIFT + [0-9] hl.bind(mainMod .. " + SHIFT + 1 ", hl.dsp.window.move({workspace = 1 })) hl.bind(mainMod .. " + SHIFT + 2 ", hl.dsp.window.move({workspace = 2 })) hl.bind(mainMod .. " + SHIFT + 3 ", hl.dsp.window.move({workspace = 3 })) hl.bind(mainMod .. " + SHIFT + 4 ", hl.dsp.window.move({workspace = 4 })) hl.bind(mainMod .. " + SHIFT + 5 ", hl.dsp.window.move({workspace = 5 })) hl.bind(mainMod .. " + SHIFT + 6 ", hl.dsp.window.move({workspace = 6 })) hl.bind(mainMod .. " + SHIFT + 7 ", hl.dsp.window.move({workspace = 7 })) hl.bind(mainMod .. " + SHIFT + 8 ", hl.dsp.window.move({workspace = 8 })) hl.bind(mainMod .. " + SHIFT + 9 ", hl.dsp.window.move({workspace = 9 })) hl.bind(mainMod .. " + SHIFT + 0 ", hl.dsp.window.move({workspace = 10})) -- 1.5 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}) ---- 2. NAVIGATION ---- -- 2.1 Vim Binds 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" })) -- 2.2 Workspace and monitor keys hl.bind(mainMod .. " + mouse_up" ,hl.dsp.focus ({ workspace = "m-1"})) hl.bind(mainMod .. " + mouse_down" ,hl.dsp.focus ({ workspace = "m+1"})) hl.bind(mainMod .. " + SHIFT + mouse_up " ,hl.dsp.focus ({ workspace = "e+1"})) hl.bind(mainMod .. " + SHIFT + mouse_down " ,hl.dsp.focus ({ workspace = "e-1"})) hl.bind(mainMod .. " + CTRL + right" ,hl.dsp.focus ({ workspace = "m+1"})) hl.bind(mainMod .. " + CTRL + left" ,hl.dsp.focus ({ workspace = "m-1"})) hl.bind(mainMod .. " + CTRL + l" ,hl.dsp.focus ({ workspace = "m+1"})) hl.bind(mainMod .. " + CTRL + h" ,hl.dsp.focus ({ workspace = "m-1"})) hl.bind(mainMod .. " + TAB " ,hl.dsp.focus ({ monitor = "-1"})) hl.bind(mainMod .. " + SHIFT + TAB " ,hl.dsp.focus ({ monitor = "+1"})) -- 2.3 Switch workspaces with mainMod + [0-9] hl.bind(mainMod .. " + 1 " ,hl.dsp.focus({workspace = 1 })) hl.bind(mainMod .. " + 2 " ,hl.dsp.focus({workspace = 2 })) hl.bind(mainMod .. " + 3 " ,hl.dsp.focus({workspace = 3 })) hl.bind(mainMod .. " + 4 " ,hl.dsp.focus({workspace = 4 })) hl.bind(mainMod .. " + 5 " ,hl.dsp.focus({workspace = 5 })) hl.bind(mainMod .. " + 6 " ,hl.dsp.focus({workspace = 6 })) hl.bind(mainMod .. " + 7 " ,hl.dsp.focus({workspace = 7 })) hl.bind(mainMod .. " + 8 " ,hl.dsp.focus({workspace = 8 })) hl.bind(mainMod .. " + 9 " ,hl.dsp.focus({workspace = 9 })) hl.bind(mainMod .. " + 0 " ,hl.dsp.focus({workspace = 10})) ---- 3 SPECIAL WORKSPACES ---- -- 3.2 Switch to special workspaces with mainMod + [S, B, G, N, U, R] hl.bind(mainMod .. " + S " ,hl.dsp.workspace.toggle_special("magic")) hl.bind(mainMod .. " + B " ,hl.dsp.workspace.toggle_special("book")) hl.bind(mainMod .. " + X " ,hl.dsp.workspace.toggle_special("phantom")) hl.bind(mainMod .. " + SHIFT + A" ,hl.dsp.workspace.toggle_special("gaming")) hl.bind(mainMod .. " + A " ,hl.dsp.workspace.toggle_special("notes")) hl.bind(mainMod .. " + U " ,hl.dsp.workspace.toggle_special("music")) hl.bind(mainMod .. " + R " ,hl.dsp.workspace.toggle_special("music")) -- 3.3 Move window to special workspaces with mainMod + SHIFT + [S, B, G, N, U, R] hl.bind(mainMod .. " + SHIFT + S " ,hl.dsp.window.move({ workspace = "special:magic" })) hl.bind(mainMod .. " + SHIFT + B " ,hl.dsp.window.move({ workspace = "special:book" })) hl.bind(mainMod .. " + SHIFT + G " ,hl.dsp.window.move({ workspace = "special:gaming" })) hl.bind(mainMod .. " + SHIFT + N " ,hl.dsp.window.move({ workspace = "special:notes" })) hl.bind(mainMod .. " + SHIFT + U " ,hl.dsp.window.move({ workspace = "special:music" })) hl.bind(mainMod .. " + SHIFT + R " ,hl.dsp.window.move({ workspace = "special:music" })) -- 3.4 Launch applications in special workspaces with mainMod + [D, E, G, N] hl.bind(mainMod .. " + D " ,function () hl.dispatch(hl.dsp.workspace.toggle_special("vesktop")) hl.exec_cmd("vesktop -m", {workspace ="special:vesktop silent"}) end) hl.bind(mainMod .. " + E " ,function () hl.dispatch(hl.dsp.workspace.toggle_special("email")) hl.exec_cmd(email, {workspace ="special:email silent"}) end) hl.bind(mainMod .. " + G " ,function () hl.dispatch(hl.dsp.workspace.toggle_special("gaming")) hl.exec_cmd("steam -forcedesktopscaling 0.5",{workspace ="special:gaming silent"}) end) hl.bind(mainMod .. " + N " ,function () hl.dispatch(hl.dsp.workspace.toggle_special("notes")) end)-- TODO dont run if obsidian alr running ---- 4. Multimedia keys for volume and LCD brightness ---- hl.bind(mainMod .."+ CTRL + mouse_down" ,hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+")) hl.bind(mainMod .."+ CTRL + mouse_up" ,hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-")) hl.bind("XF86AudioRaiseVolume" ,hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+")) hl.bind("XF86AudioLowerVolume" ,hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-")) hl.bind("XF86AudioMute" ,hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle")) hl.bind("XF86AudioMicMute" ,hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle")) hl.bind("XF86MonBrightnessUp" ,hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%+")) hl.bind("XF86MonBrightnessDown" ,hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%-")) hl.bind("XF86AudioNext" ,hl.dsp.exec_cmd("playerctl next")) -- Requires playerctl hl.bind("XF86AudioPause" ,hl.dsp.exec_cmd("playerctl play-pause")) hl.bind("XF86AudioPlay" ,hl.dsp.exec_cmd("playerctl play-pause")) hl.bind("XF86AudioPrev" ,hl.dsp.exec_cmd("playerctl previous")) hl.bind("ALT + mouse:274" ,hl.dsp.exec_cmd("playerctl play-pause")) hl.bind(mainMod .. " + SPACE " ,hl.dsp.exec_cmd("playerctl play-pause")) ---- 5. CUSTOM APPLICATION LAUNCHERS ---- -- 5.1 Special Terminal Windows hl.bind(mainMod .. " + Q " ,hl.dsp.exec_cmd(terminal)) hl.bind(mainMod .. " + SHIFT + Q " ,hl.dsp.exec_cmd(terminal .. " ssh -v sol")) hl.bind(" ALT + Q " ,hl.dsp.exec_cmd(terminal , { tag = "popup" })) hl.bind(mainMod .. " + W " ,hl.dsp.exec_cmd(terminal , { tag = "popup" })) hl.bind(mainMod .. " + SHIFT + W " ,hl.dsp.exec_cmd(terminal .. " ssh -v sol" , { tag = "popup" })) hl.bind(mainMod .. " + CTRL + W " ,hl.dsp.exec_cmd(terminal .. " ssh root@galaxy" ,{ tag = "popup" })) -- 5.2 Application Launchers hl.bind(mainMod .. " + SUPER_L" ,hl.dsp.exec_cmd(launcher .. " toggle") , { release = true }) hl.bind(mainMod .. " + F " ,hl.dsp.exec_cmd(browser)) hl.bind(mainMod .. " + SHIFT + F " ,hl.dsp.exec_cmd("firefox -P popup --no-remote --name browser-popup")) -- 5.3 Custom Terminal APplications with special window rules hl.bind("code:148" ,hl.dsp.exec_cmd("kitty --class calc-term -o 'confirm_os_window_close 0' /home/venus/.cargo/bin/mathypad ")) hl.bind(mainMod .. " + escape" ,hl.dsp.exec_cmd("kitty btop" ,{ tag = "large-popup" })) hl.bind("CTRL + SHIFT + ESCAPE" ,hl.dsp.exec_cmd("kitty btop" ,{ tag = "large-popup" })) hl.bind(mainMod .. " + SHIFT + escape" ,hl.dsp.exec_cmd("kitty nvtop" ,{ tag = "large-popup" })) hl.bind(mainMod .. "+ ALT + G" ,hl.dsp.exec_cmd("kitty agy" ,{ tag = "popup" })) hl.bind(mainMod .. "+ CTRL + G" ,hl.dsp.exec_cmd("kitty agy" ,{ tag = "popup" })) ---- 6. CUSTOM SCRIPTS AND FUNCTIONS ---- -- 6.1 custom key assignments hl.config({ input = { kb_options = "caps:hyper", }}) -- hl.bind(hyper.. " + Hyper_L" ,function() hl.dispatch(hl.dsp.exec_cmd(ipc .. "plugin:clipper openPanel")) hl.dispatch(hl.dsp.submap("hyper-submap")) end) hl.bind(hyper .. " + Hyper_L" ,hl.dsp.exec_cmd("noctalia msg panel-toggle clipboard")) -- TODO fix remote screen and remote keyboard shortcuts hl.bind(mainMod .. " + CTRL + I" ,custom.remoteKM) -- Send Keyboard and Mouse input to phone via scrcpy hl.bind(mainMod .. " + ALT + I" ,custom.remoteScreen) -- Open Phone Screen via scrcpy hl.bind(mainMod .. "+ grave" ,custom.ToggleOddessyConnection) -- Toggle Oddesy monitor connection in hyprland ---- 7. hl.bind(mainMod .. " + comma" ,hl.dsp.exec_cmd(ipc .. "controlCenter toggle")) hl.bind(mainMod .. " + period" ,hl.dsp.exec_cmd(ipc .. "settings toggle")) hl.bind(mainMod .. " + CTRL + SHIFT + L " ,hl.dsp.exec_cmd(ipc .. "lockScreen lock")) hl.bind(mainMod .. " + ALT + L " ,hl.dsp.exec_cmd(ipc .. "lockScreen lock")) hl.bind("ALT + C" ,hl.dsp.exec_cmd(ipc .. "plugin:clipper openPanel")) hl.bind("code:148" ,hl.dsp.exec_cmd(ipc .. "plugin:noctalia-calulator toggle")) hl.bind("PRINT" ,hl.dsp.exec_cmd("hyprshot -m active -m window --output-folder ~/Images/Screenshots")) hl.bind("SHIFT + PRINT" ,hl.dsp.exec_cmd(ipc .. " plugin:screen-toolkit annotate")) hl.bind("ALT + PRINT" ,hl.dsp.exec_cmd(ipc .. " plugin:screen-toolkit annotateWindow")) hl.bind("CTRL + PRINT" ,hl.dsp.exec_cmd(ipc .. " plugin:screen-toolkit annotateFullscreen")) -- hl.bind("SHIFT + PRINT" , hl.dsp.exec_cmd("hyprshot -m region --output-folder ~/Images/Screenshots")) -- hl.bind("ALT + PRINT" , hl.dsp.exec_cmd("hyprshot -m active -m output --output-folder ~/Images/Screenshots")) ---- 14. SUBMAP DISPATCHERS ---- hl.bind(mainMod .. " + O " ,hl.dsp.submap("open-apps")) hl.bind(mainMod .. " + M " ,function() hl.dispatch(hl.dsp.exec_cmd(ipc .. "controlCenter toggle ")) hl.dispatch(hl.dsp.submap("quick-settings")) end) hl.bind(mainMod .. "+ PRINT" ,function() hl.exec_cmd(ipc .. "plugin:screen-toolkit toggle") hl.dispatch(hl.dsp.submap("screen-toolkit")) end) hl.bind(mainMod .. " + T" ,function() hl.dispatch(hl.dsp.submap("timer")) hl.exec_cmd(ipc .. "plugin:timer toggle") end)