diff --git a/basic/keybinds.lua b/basic/keybinds.lua index 88eb11d..88ce4ab 100644 --- a/basic/keybinds.lua +++ b/basic/keybinds.lua @@ -2,80 +2,33 @@ --------------------- ------@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") - --- 1. Basic Binds -hl.bind(mainMod .. " + Q " , hl.dsp.exec_cmd(terminal)) -hl.bind(mainMod .. " + SHIFT + Q " , hl.dsp.exec_cmd(terminal .. " ssh -v sol")) -hl.bind(mainMod .. " + C " , hl.dsp.window.close()) -hl.bind(mainMod .. " + SHIFT + CTRL + M " , hl.dsp.exit()) - --- Workspace movement and tiling rule +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"})) - --- Layout management and advanced window management --- TODO implement logic for changing shortcuts based on current layout +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 left center right")) - --- hl.bind(mainMod .. " + SEMICOLON ", hl.dsp.exec_cmd( hyprctl general:layout master ) --- hl.bind(mainMod .. " + APOSTROPHE ", hl.dsp.exec_cmd( hyprctl general:layout dwindle ) - --- Compiler window --- hl.bind(mainMod .. " + SHIFT + A ", "tagwindow", "compiler") ---hl.bind(mainMod .. " + A ", hl.dsp.exec_cmd( $XDG_CONFIG_HOME/hypr/scripts/compile.sh) - --- 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"})) - ----- 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}) - ----- 4. 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})) - ----- 5. Move actihe window to a workspace with mainMod + SHIFT + [0-9] +-- 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 })) @@ -86,259 +39,129 @@ 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})) - ----- 6. special workspace (scratchpad) -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" )) - -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" })) - -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")) - -- TODO dont run if obsidian alr running - -- hl.exec_cmd(notes) -end) - --- 8. Move/resize windows with mainMod + LMB/RMB and dragging +-- 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}) ----- 9. 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%-")) +---- 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})) ----- Requires playerctl -hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next")) -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")) +---- 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")) ----- 10. Application launching -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. 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" })) -hl.bind("ALT + C" ,hl.dsp.exec_cmd(ipc .. "plugin:clipper openPanel")) -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("code:148" ,hl.dsp.exec_cmd(ipc .. "plugin:noctalia-calulator toggle")) +---- 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(" 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" })) +-- TODO fix remote screen and remote keyboard shortcuts +hl.bind(mainMod .. " + I" ,custom.remoteKM) -- Send Keyboard and Mouse input to phone via scrcpy +hl.bind(mainMod .. " + SHIFT + I" ,custom.remoteScreen) -- Open Phone Screen via scrcpy +hl.bind(mainMod .. "+ grave" ,custom.ToggleOddessyConnection) -- Toggle Oddesy monitor connection in hyprland -hl.bind(mainMod .. " + escape" ,hl.dsp.exec_cmd("kitty btop" ,{float = true, border_size = 2, size = {"(monitor_w * 0.9)", "(monitor_h * 0.9)"}})) -hl.bind("CTRL + SHIFT + ESCAPE" ,hl.dsp.exec_cmd("kitty btop" ,{float = true, border_size = 2, size = {"(monitor_w * 0.9)", "(monitor_h * 0.9)"}})) -hl.bind(mainMod .. " + SHIFT + escape" ,hl.dsp.exec_cmd("kitty nvtop",{float = true, border_size = 2, size = {"(monitor_w * 0.9)", "(monitor_h * 0.9)"}})) --- TODO fix remote screen and remote keyboard shortcuts -hl.bind(mainMod .. " + I" ,custom.remoteKM) -hl.bind(mainMod .. " + SHIFT + I" ,custom.remoteScreen) +---- 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("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")) - ----- 10.1 Shortcuts -hl.bind(mainMod .. " + CTRL + SHIFT + L " , hl.dsp.exec_cmd(ipc .. "lockScreen lock")) --- Move window to monitor darkspot --- hl.monitor({ output = "DP-2", disabled = false }) -hl.bind(mainMod .. "+ grave" ,custom.ToggleOddessyConnection) -hl.bind(mainMod .. "+ Z" ,custom.RunDevelopementCode) - - --- TODO Implement these ----- Change background opacity of terminal window --- hl.bind(mainMod .. " + ALT + k ", hl.dsp.exec_cmd("kitty +kitten @ set-background-opacity -a 1")) ----- hande lid switch --- bindl = , switch:Lid Switch, hl.dsp.exec_cmd( s$ipc lockScreen lock - ----- 12. quick access to controls submap -hl.bind(mainMod .. " + comma" , hl.dsp.exec_cmd(ipc .. "controlCenter toggle")) -hl.bind(mainMod .. " + period" , hl.dsp.exec_cmd(ipc .. "settings 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("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")) -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 .. " + O ", hl.dsp.submap("open-apps")) ----- 14. submaps! -hl.bind(mainMod .. "+ PRINT" ,function() - hl.exec_cmd(ipc .. "plugin:screen-toolkit toggle") - hl.dispatch(hl.dsp.submap("screen-toolkit")) -end) - -hl.define_submap("screen-toolkit", "reset", function() - hl.bind("S" ,hl.dsp.exec_cmd(ipc .. " plugin:screen-toolkit toggle")) - hl.bind("C" ,hl.dsp.exec_cmd(ipc .. " plugin:screen-toolkit color")) - hl.bind("P" ,hl.dsp.exec_cmd(ipc .. " plugin:screen-toolkit pallete")) - hl.bind("O" ,hl.dsp.exec_cmd(ipc .. " plugin:screen-toolkit ocr")) - hl.bind("L" ,hl.dsp.exec_cmd(ipc .. " plugin:screen-toolkit lens")) - hl.bind("A" ,hl.dsp.exec_cmd(ipc .. " plugin:screen-toolkit annotate")) - hl.bind("SHIFT + A" ,hl.dsp.exec_cmd(ipc .. " plugin:screen-toolkit annotateWindow")) - hl.bind("R" ,hl.dsp.exec_cmd(ipc .. " plugin:screen-toolkit recordMp4")) - hl.bind("SHIFT + R" ,hl.dsp.exec_cmd(ipc .. " plugin:screen-toolkit recordFullscreenMp4")) - hl.bind("catchall" ,function () - hl.dispatch(hl.dsp.submap("reset")) - hl.dispatch(hl.dsp.exec_cmd(ipc .. "plugin:screen-toolkit toggle ")) - end) -end) --- TODO write a timer submap that starts a timer of custom length when a key is pressed -hl.bind(mainMod .. " + T" ,function() - hl.dispatch(hl.dsp.submap("timer")) - hl.exec_cmd(ipc .. "plugin:timer toggle") - end) -hl.define_submap("timer", function () - hl.bind("T" ,hl.dsp.exec_cmd(ipc .. "plugin:timer toggle")) - hl.bind("P" ,hl.dsp.exec_cmd(ipc .. "plugin:timer pause")) - hl.bind("R" ,hl.dsp.exec_cmd(ipc .. "plugin:timer reset")) - hl.bind("S" ,hl.dsp.exec_cmd(ipc .. "plugin:timer start 10")) - hl.bind("A" ,hl.dsp.exec_cmd(ipc .. "plugin:timer start 240")) - -- include the double escape or no? - hl.bind("catchall" ,function () - hl.dispatch(hl.dsp.submap("reset")) - hl.dispatch(hl.dsp.exec_cmd(ipc .. "plugin:timer toggle ")) - end) -end) - -hl.define_submap("quick-settings", function () - hl.bind("V" ,hl.dsp.exec_cmd("protonvpn-app & hyprctl dispatch submap vpn")) - hl.bind("S" ,hl.dsp.exec_cmd(ipc .. "settings toggle")) - hl.bind("C" ,hl.dsp.exec_cmd(ipc .. "plugin:clipper togglePanel ")) - hl.bind("P" ,hl.dsp.exec_cmd(ipc .. "sessionMenu toggle")) - hl.bind("R" ,hl.dsp.exec_cmd(ipc .. "systemMonitor toggle")) - hl.bind("T" ,hl.dsp.exec_cmd(ipc .. "plugin:timer toggle")) - hl.bind("M" ,hl.dsp.exec_cmd(ipc .. "controlCenter toggle")) - hl.bind("D" ,hl.dsp.exec_cmd(ipc .. "notifications toggleDND")) - hl.bind("A" ,hl.dsp.exec_cmd(ipc .. "notifications dismissAll")) - hl.bind("SHIFT + B" ,hl.dsp.exec_cmd(ipc .. "bar toggle")) - hl.bind("SHIFT + W" ,hl.dsp.exec_cmd(ipc .. "wifi toggle -- toggle wifi")) - hl.bind("I" ,hl.dsp.exec_cmd(ipc .. "wallpaper toggle")) - hl.bind(" L " ,hl.dsp.exec_cmd(ipc .. "sessionMenu toggle")) - hl.bind("B " ,hl.dsp.exec_cmd(ipc .. "battery togglePanel -- toggle battery panel")) - hl.bind("SHIFT + C " ,hl.dsp.exec_cmd(ipc .. "calendar toggle")) - hl.bind("F" ,hl.dsp.exec_cmd(ipc .. "calendar toggle")) - -- Bind Submaps - hl.bind("L" ,hl.dsp.submap("layouts")) - hl.bind("N" ,function () - hl.dispatch(hl.dsp.submap("notifications-sub")) - hl.dispatch(hl.dsp.exec_cmd(ipc .. "notifications toggleHistory")) - end) - hl.bind("B" ,function() - hl.dispatch(hl.dsp.submap("bt-sub")) - hl.dispatch(hl.dsp.exec_cmd(ipc .. "bluetooth togglePanel")) - end) - hl.bind("W" ,function () - hl.dispatch(hl.dsp.submap("wifi-sub")) - hl.dispatch(hl.dsp.exec_cmd(ipc .. "network togglePanel")) - end) - -- TODO Implement layout switching - -- hl.bind(, L, hl.dsp.exec_cmd( notify-send "layout switching" & hyprctl dispatch submap layouts) - hl.bind("catchall" ,function () - hl.dispatch(hl.dsp.submap("reset")) - hl.dispatch(hl.dsp.exec_cmd(ipc .. "controlCenter toggle ")) - end) -end) -hl.define_submap("notifications-sub", function() - hl.bind("D" ,hl.dsp.exec_cmd(ipc .. "notifications toggleDND")) - hl.bind("S" ,hl.dsp.exec_cmd(ipc .. "notifications toggleDND")) - hl.bind("Q" ,hl.dsp.exec_cmd(ipc .. "notifications toggleDND")) - hl.bind("A" ,hl.dsp.exec_cmd(ipc .. "notifications dismissAll")) - hl.bind("C" ,hl.dsp.exec_cmd(ipc .. "notifications clear")) - hl.bind("CTRL + D" ,hl.dsp.exec_cmd(ipc .. "notifications dismissAll")) - hl.bind("SHIFT + D" ,hl.dsp.exec_cmd(ipc .. "notifications dismissAll")) - hl.bind(mainMod .. " + D " ,hl.dsp.exec_cmd(ipc .. "notifications dismissAll")) - hl.bind("escape" ,function () - hl.dispatch(hl.dsp.exec_cmd(ipc .. "notifications toggleHistory")) - hl.dispatch(hl.dsp.submap("reset")) - end) -end) - -hl.define_submap("wifi-sub", "reset", function() - hl.bind("T" ,hl.dsp.exec_cmd(ipc .. "wifi toggle")) - hl.bind("S" ,hl.dsp.exec_cmd(ipc .. "wifi togglePanel")) - hl.bind("D" ,hl.dsp.exec_cmd(ipc .. "wifi disable")) - hl.bind("E" ,hl.dsp.exec_cmd(ipc .. "wifi enable")) - hl.bind("R" ,hl.dsp.exec_cmd("sudo systemctl restart iwd")) - hl.bind("escape" ,hl.dsp.exec_cmd(ipc .. "network togglePanel")) -end) - -hl.define_submap("bt-sub", function() - hl.bind("T" ,hl.dsp.exec_cmd(ipc .. "bluetooth toggle")) - hl.bind("S" ,hl.dsp.exec_cmd(ipc .. "bluetooth togglePanel")) - hl.bind("D" ,hl.dsp.exec_cmd(ipc .. "bluetooth disable")) - hl.bind("E" ,hl.dsp.exec_cmd(ipc .. "bluetooth enable")) - hl.bind("H" ,hl.dsp.exec_cmd('bluetoothctl connect 88:92:CC:53:88:7E && notify-send "connected to headphones"')) - hl.bind("B" ,hl.dsp.exec_cmd('bluetoothctl connect FC:91:5D:6A:2A:C5 && notify-send "connected to earbuds"')) - hl.bind("P" ,hl.dsp.exec_cmd('bluetoothctl connect 64:9D:38:E0:4D:02 && notify-send "Connected to phone"')) - hl.bind("SHIFT + B" ,hl.dsp.exec_cmd('bluetoothctl disconnect FC:91:5D:6A:2A:C5 && notify-send "disconnected from earbuds"')) - hl.bind("J" ,hl.dsp.exec_cmd('bluetoothctl disconnect 88:92:CC:53:88:7E && notify-send "disconnected from headphones"')) - hl.bind("SHIFT + H" ,hl.dsp.exec_cmd('bluetoothctl disconnect 88:92:CC:53:88:7E && notify-send "disconnected from headphones"')) - hl.bind("M" ,hl.dsp.exec_cmd('bluetoothctl disconnect 64:9D:38:E0:4D:02 && notify-send "Disconnected from phone"')) - hl.bind("escape" ,function () - hl.dispatch(hl.dsp.exec_cmd(ipc .. "bluetooth togglePanel")) - hl.dispatch(hl.dsp.submap("reset")) - end) - end) - - --- TODO Implement a VPN subnet - -hl.define_submap("open-apps", "reset", function() - hl.bind("S" ,hl.dsp.exec_cmd("signal-desktop")) - hl.bind("D" ,hl.dsp.exec_cmd("vesktop")) - hl.bind("F" ,hl.dsp.exec_cmd("firefox")) - hl.bind("M" ,hl.dsp.exec_cmd("feishin")) - hl.bind("R" ,hl.dsp.exec_cmd("calibre")) - hl.bind("E" ,hl.dsp.exec_cmd("darktable")) - hl.bind("catchall" ,hl.dsp.submap("reset")) -end) - ---hl.define_submap("layouts, reset --- hl.bind(, D, hl.dsp.exec_cmd( hyprctl general:layout dwindle) --- hl.bind(, M, hl.dsp.exec_cmd( hyprctl general:layout master) ---hl.define_submap("reset - ----- 13. Misc tools. ---- 14. Gestures -hl.gesture({ fingers = 3, direction = "horizontal", action = "workspace" }) --- hl.gesture({ fingers = 2, direction = "pinch", action = "cursor_zoom", zoom_level = 2, mode = "mult"}) ---hl.bind(ALT, SPACE, hl.dsp.exec_cmd( $menu) - +---- 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)