From 5c5c2abe5579da673a34dd2add5cc62b5601a622 Mon Sep 17 00:00:00 2001 From: fennek182 Date: Sun, 14 Jun 2026 16:13:49 +0200 Subject: [PATCH] updated hyprland keybinds and fix workspace rules --- .config/hypr/hyprland.lua | 6 +- .config/hypr/modules/binds.lua | 253 ++++++++++++++-------------- .config/hypr/modules/workspaces.lua | 35 ++-- 3 files changed, 152 insertions(+), 142 deletions(-) diff --git a/.config/hypr/hyprland.lua b/.config/hypr/hyprland.lua index 120021f..11c7213 100644 --- a/.config/hypr/hyprland.lua +++ b/.config/hypr/hyprland.lua @@ -1,5 +1,7 @@ --- version 1 --- last change: Fri 2026-06-12 using Hyprland v0.55.3-1 +-- Version 2 +-- Last change: Sun 2026-06-14 using Hyprland v0.55.3-1 +-- Git repo: https://git.fennek.xyz/fennek182/dotfiles +-- Latest version: https://git.fennek.xyz/fennek182/dotfiles/src/branch/main/.config/hypr/hyprland.lua -- See https://wiki.hypr.land/Configuring/Start/ for more diff --git a/.config/hypr/modules/binds.lua b/.config/hypr/modules/binds.lua index 9efc73e..745557f 100644 --- a/.config/hypr/modules/binds.lua +++ b/.config/hypr/modules/binds.lua @@ -1,31 +1,29 @@ --------------------- ---- KEYBINDINGS ---- --------------------- --- Version 1 --- Last change: Sun 2026-06-14 using Hyprland v0.55.3-1 --- Git repo: https://git.fennek.xyz/fennek182/dotfiles +-- Version 2 +-- Last change: Sun 2026-06-14 using Hyprland v0.55.3-1 +-- Git repo: https://git.fennek.xyz/fennek182/dotfiles +-- Latest version: https://git.fennek.xyz/fennek182/dotfiles/src/branch/main/.config/hypr/modules/binds.lua -- See https://wiki.hypr.land/Configuring/Basics/Binds/ for more - ----- App variables -local terminal = "~/.local/bin/alacritty" -local fileManager = "nautilus" -local browser = "~/.local/bin/firefox" -local editor_gui = "~/.local/bin/zed" -local editor_cli = "env -u VIMINIT nvim" -local vpn = "/opt/ivpn/ui/bin/ivpn-ui" -local mediaPlayer = "/opt/ivpn/ui/bin/ivpn-ui" - -local mainMod = "SUPER" -- Sets "Windows" key as main modifier - -- Example bind: -- hl.bind("SUPER + Q", hl.dsp.exec_cmd("kitty"), { description = "Open my favourite terminal" }) --- TODO: Global keybinds for apps --- hl.bind("ALT" .. " + " .. 0, hl.dsp.pass("^(com\\.obsproject\\.Studio)$")) --- hl.bind("ALT" .. " + " .. "p", hl.dsp.pass("^(com\\.obsproject\\.Studio)$")) +---- App variables +local terminal = "~/.local/bin/alacritty" +local fileManager = "nautilus" +local browser = "~/.local/bin/firefox" +local editor_gui = "~/.local/bin/zed" +local editor_cli = "env -u VIMINIT nvim" +local vpn = "/opt/ivpn/ui/bin/ivpn-ui" +local mediaPlayer = "/opt/ivpn/ui/bin/ivpn-ui" + +--- Modifiers +local mainMod = "SUPER" -- Sets "Windows" key as main modifier +-- ========== Misc ========== -- For ALT + TAB between workspaces hl.config({ binds = { @@ -36,17 +34,6 @@ hl.config({ -- ========== Apps ========== --- TODO: old - remove on next commit: --- bind = $mainMod, D, exec, ~/.local/bin/fzf-search-fennix --- bind = $mainMod SHIFT, D, exec, nautilus --new-window ~/dl --- bind = $mainMod SHIFT, G, exec, flatpak run com.valvesoftware.Steam --- bind = $mainMod SHIFT, S, exec, flatpak run io.github.dweymouth.supersonic --- bind = $mainMod ALT, G, exec, glava --- bind = $mainMod ALT, J, exec, flatpak run io.github.dweymouth.supersonic --- bind = $mainMod ALT, J, exec, flatpak run com.logseq.Logseq --- bind = $mainMod, R, exec, ~/.local/bin/hyprland_rename_ws --- bind = $mainMod SHIFT, L, exec, mpv --no-audio --loop -fs --osc=no --osd-bar=no --config=no ~/.local/share/screensavers/bad_apple.mkv - hl.bind(mainMod .. " + Return", hl.dsp.exec_cmd(terminal)) hl.bind(mainMod .. " + N", hl.dsp.exec_cmd(editor_gui)) hl.bind(mainMod .. " + ALT + N", hl.dsp.exec_cmd(editor_gui .. " /mnt/ssd/dox/todo.txt")) @@ -55,6 +42,10 @@ hl.bind(mainMod .. " + F", hl.dsp.exec_cmd(browser)) hl.bind(mainMod .. " + SHIFT + F", hl.dsp.exec_cmd(browser .. " --private-window")) hl.bind("CTRL + ALT + N", hl.dsp.exec_cmd(mediaPlayer .. " --player-operation-mode=pseudo-gui")) +-- ========== Apps > global Keybinds ========== +hl.bind("ALT + 0", hl.dsp.pass({ window = "class:^(com\\.obsproject\\.Studio)$" })) +hl.bind("ALT + P", hl.dsp.pass({ window = "class:^(com\\.obsproject\\.Studio)$" })) + -- ========== Scripts ========== hl.bind(mainMod .. " + ALT + P", hl.dsp.exec_cmd("~/.local/bin/firefox2tv &")) @@ -63,51 +54,73 @@ hl.bind(mainMod .. " + ALT + P", hl.dsp.exec_cmd("~/.local/bin/firefox2mpv --sel -- ========== Hyprland ========== --- TODO: old - remove on next commit: --- bind = SUPER, Tab, hyprexpo:expo, toggle --- bind = SUPER, dead_circumflex, hyprexpo:expo, toggle --- bind = SUPER, Escape, hyprexpo:expo, toggle --- bind = ALT, dead_circumflex, overview:toggle --- bind = ALT, Escape, overview:toggle --- bind = $mainMod SHIFT, E, exit - hl.bind(mainMod .. " + SHIFT + R", hl.dsp.exec_cmd("hyprctl reload")) -hl.bind(mainMod .. " + ALT + R", hl.dsp.exec_cmd("pkill waybar; hyprctl dispatch exec waybar")) ---- layouts -hl.bind(mainMod .. " + S", hl.dsp.exec_cmd("hyprctl keyword general:layout dwindle")) -hl.bind(mainMod .. " + A", hl.dsp.exec_cmd("hyprctl keyword general:layout master")) +--- Restart waybar +hl.bind(mainMod .. " + ALT + R", hl.dsp.exec_cmd("pkill waybar; hyprctl dispatch 'hl.dsp.exec_cmd(\"waybar\")' ")) ---- windows +--- Layouts +--- TODO: per workspace layouts with + SHIFT +hl.bind(mainMod .. " + A", function() hl.config({ general = { layout = "master" } }) end) -- master +hl.bind(mainMod .. " + D", function() hl.config({ general = { layout = "dwindle" } }) end) -- dwindle +hl.bind(mainMod .. " + S", function() hl.config({ general = { layout = "scrolling" } }) end) -- scrolling + +--- Windows local closeWindowBind = hl.bind(mainMod .. " + Q", hl.dsp.window.close()) -- closeWindowBind:set_enabled(false) hl.bind(mainMod .. " + SHIFT + Q", hl.dsp.exec_cmd("hyprctl kill")) hl.bind("ALT + TAB", hl.dsp.focus({ workspace = "previous" })) -hl.bind(mainMod .. " + ALT + I", hl.dsp.exec_cmd("dunstify $(hyprctl activewindow -j | jq -r .title)")) +hl.bind(mainMod .. " + ALT + I", hl.dsp.exec_cmd("notify-send \"$(hyprctl activewindow -j | jq -r .title)\"")) ---- windows > floating ---- TODO: fix toggle_floating script with new syntax -hl.bind(mainMod .. " + Y", hl.dsp.window.float({ action = "toggle" })) --- hl.bind(mainMod .. " + Y", hl.dsp.exec_cmd("~/.local/bin/toggle_floating")) -hl.bind(mainMod .. " + SHIFT + Y", hl.dsp.exec_cmd("hyprctl dispatch togglefloating active && hyprctl dispatch pin active")) -hl.bind(mainMod .. " + SHIFT + V", hl.dsp.exec_cmd("hyprctl dispatch workspaceopt allfloat")) +--- Windows > floating - toggle foating, set window size to 80% and center +hl.bind(mainMod .. "+ Y", function () + -- Only toggle floating if window is already floating + local active_window = hl.get_active_window() + if not active_window then return end + if active_window.floating == true then + hl.dispatch(hl.dsp.window.float({action = "toggle"})) + return + end ---- windows > split (dwindle layout) -hl.bind(mainMod .. " + SHIFT + J", hl.dsp.layout("togglesplit")) -- dwindle only + -- Toggle floating, set window size to 80% and center + hl.dispatch(hl.dsp.window.float({action = "toggle"})) + local monitor = hl.get_active_monitor() + if not monitor then return end + local height = monitor.height * 0.8 + local width = monitor.width * 0.8 + hl.dispatch(hl.dsp.window.resize({x = width, y = height})) + hl.dispatch(hl.dsp.window.center()) +end) ---- windows > fullscreen / maximize / fake fullscreen +--- Windows > pin - pin a window so it displays above all workspaces (picture in picture) +hl.bind(mainMod .. "+ SHIFT + Y", function () + hl.dispatch(hl.dsp.window.float({action = "toggle"})) + hl.dispatch(hl.dsp.window.pin({action = "toggle"})) +end) + +--- Windows > all float - set all windows to floating - +--- I have no idea how this works in lua now, I gave up after wasting too much time reading the wiki +--- the wiki sucks SERIOUSLY, old stuff just gets removed, stuff like workspaceopt gets NO MENTION AT ALL +--- idk... I never used this function anyway... sooo: +--- TODO: remove this on next commit: +-- hl.bind(mainMod .. " + SHIFT + V", hl.dsp.exec_cmd("hyprctl dispatch workspaceopt allfloat")) + +--- Windows > split (dwindle layout only) +hl.bind(mainMod .. " + SHIFT + J", hl.dsp.layout("togglesplit")) -- dwindle only + +--- Windows > fullscreen / maximize / fake fullscreen hl.bind(mainMod .. " + SHIFT + P", hl.dsp.window.pseudo()) -- dwindle only hl.bind(mainMod .. " + M", hl.dsp.window.fullscreen({ action = "toggle" })) hl.bind(mainMod .. " + SHIFT + M", hl.dsp.window.fullscreen_state({ internal = 0, client = 2 })) -- ^-- keeps the window non-fullscreen, but the client goes into fullscreen mode within the window ---- move focus with mainMod + arrow keys +--- Move focus with mainMod + arrow keys hl.bind(mainMod .. " + left", hl.dsp.focus({ direction = "left" })) hl.bind(mainMod .. " + right", hl.dsp.focus({ direction = "right" })) hl.bind(mainMod .. " + up", hl.dsp.focus({ direction = "up" })) hl.bind(mainMod .. " + down", hl.dsp.focus({ direction = "down" })) ---- workspaces +--- Workspaces -- switch workspaces with mainMod + [0-9] -- move active window to a workspace with mainMod + SHIFT + [0-9]: -- for i = 1, 10 do @@ -116,7 +129,7 @@ hl.bind(mainMod .. " + down", hl.dsp.focus({ direction = "down" })) -- hl.bind(mainMod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = i })) -- end --- switch workspaces with mainMod + [0-9] +--- Workspaces > Switch workspaces with mainMod + [0-9] hl.bind(mainMod .. " + " .. 1, hl.dsp.focus({ workspace = 5 })) hl.bind(mainMod .. " + " .. 2, hl.dsp.focus({ workspace = 6 })) hl.bind(mainMod .. " + " .. 3, hl.dsp.focus({ workspace = 7 })) @@ -130,36 +143,36 @@ hl.bind(mainMod .. " + " .. 0, hl.dsp.focus({ workspace = 10 })) hl.bind(mainMod .. " + " .. "ssharp", hl.dsp.focus({ workspace = 11 })) hl.bind(mainMod .. " + " .. "dead_acute", hl.dsp.focus({ workspace = 12 })) --- switch workspaces with mainMod + pageUp/pageDown +--- Workspaces > Switch workspaces with mainMod + pageUp/pageDown hl.bind(mainMod .. " + " .. "Next", hl.dsp.focus({ workspace = -1 })) hl.bind(mainMod .. " + " .. "Prior", hl.dsp.focus({ workspace = "+1" })) --- Move active window to a workspace with mainMod + SHIFT + [0-9] --- TODO: check syntax of dsp.widnow.move --- hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. 1, hl.dsp.window.move(5)) --- hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. 2, hl.dsp.window.move(6)) --- hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. 3, hl.dsp.window.move(7)) --- hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. 4, hl.dsp.window.move(8)) --- hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. 5, hl.dsp.window.move(1)) --- hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. 6, hl.dsp.window.move(2)) --- hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. 7, hl.dsp.window.move(3)) --- hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. 8, hl.dsp.window.move(4)) --- hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. 9, hl.dsp.window.move(9)) --- hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. 0, hl.dsp.window.move(10)) --- hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. "ssharp", hl.dsp.window.move(11)) --- hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. "dead_acute", hl.dsp.window.move(12)) +--- Workspaces > Scroll through existing workspaces with mainMod + scroll +hl.bind(mainMod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" })) +hl.bind(mainMod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" })) --- Move active window to a workspace with mainMod + SHIFT + pageUp/pageDown --- hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. "Next", hl.dsp.window.move(-1)) --- hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. "Prior", hl.dsp.window.move("+1")) +--- Workspaces > Move active window to a workspace with mainMod + SHIFT + [0-9] +hl.bind(mainMod .. " + " .. "SHIFT + " .. 1, hl.dsp.window.move({ workspace = 5 })) +hl.bind(mainMod .. " + " .. "SHIFT + " .. 2, hl.dsp.window.move({ workspace = 6 })) +hl.bind(mainMod .. " + " .. "SHIFT + " .. 3, hl.dsp.window.move({ workspace = 7 })) +hl.bind(mainMod .. " + " .. "SHIFT + " .. 4, hl.dsp.window.move({ workspace = 8 })) +hl.bind(mainMod .. " + " .. "SHIFT + " .. 5, hl.dsp.window.move({ workspace = 1 })) +hl.bind(mainMod .. " + " .. "SHIFT + " .. 6, hl.dsp.window.move({ workspace = 2 })) +hl.bind(mainMod .. " + " .. "SHIFT + " .. 7, hl.dsp.window.move({ workspace = 3 })) +hl.bind(mainMod .. " + " .. "SHIFT + " .. 8, hl.dsp.window.move({ workspace = 4 })) +hl.bind(mainMod .. " + " .. "SHIFT + " .. 9, hl.dsp.window.move({ workspace = 9 })) +hl.bind(mainMod .. " + " .. "SHIFT + " .. 0, hl.dsp.window.move({ workspace = 10 })) +hl.bind(mainMod .. " + " .. "SHIFT + " .. "ssharp", hl.dsp.window.move({ workspace = 11 })) +hl.bind(mainMod .. " + " .. "SHIFT + " .. "dead_acute", hl.dsp.window.move({ workspace = 12 })) --- Move workspaces between dual screen setup +--- Workspaces > Move active window to a workspace with mainMod + SHIFT + pageUp/pageDown +hl.bind(mainMod .. " + SHIFT + Next", hl.dsp.window.move({ workspace = -1 })) +hl.bind(mainMod .. " + SHIFT + Prior", hl.dsp.window.move({ workspace = "+1" })) + +--- Workspaces > Move workspaces between dual screen setup hl.bind(mainMod .. " + ALT + left", hl.dsp.exec_cmd("hyprctl dispatch movecurrentworkspacetomonitor DP-1")) hl.bind(mainMod .. " + ALT + right", hl.dsp.exec_cmd("hyprctl dispatch movecurrentworkspacetomonitor DP-4")) --- Scroll through existing workspaces with mainMod + scroll -hl.bind(mainMod .. " + " .. "mouse_down", hl.dsp.focus({ workspace = "e+1" })) -hl.bind(mainMod .. " + " .. "mouse_up", hl.dsp.focus({ workspace = "e-1" })) --- TODO: add device specific binds -- thinkpad: @@ -168,19 +181,21 @@ hl.bind(mainMod .. " + " .. "mouse_up", hl.dsp.focus({ workspace = "e-1" })) -- ========== Rofi ========== -- TODO: formatting/string cleanup -hl.bind("CTRL + ALT" .. " + " .. "B", hl.dsp.exec_cmd("~/.local/bin/poweroptions_rofi")) -hl.bind(mainMod .. " + " .. "B", hl.dsp.exec_cmd("notify-send CPU-Profil gewechselt Performance && sudo /usr/bin/cpupower frequency-set -g performance")) -hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. "B", hl.dsp.exec_cmd("notify-send CPU-Profil gewechselt Powersave && sudo /usr/bin/cpupower frequency-set -g powersave")) -hl.bind(mainMod .. " + " .. "C", hl.dsp.exec_cmd("~/.local/bin/rofi_calc")) -hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. "C", hl.dsp.exec_cmd("~/.local/bin/rofi_calc --normal-window")) -hl.bind("CTRL + ALT" .. " + " .. "P", hl.dsp.exec_cmd("hyprctl dispatch exec ~/.config/rofi/bin/menu_powermenu")) -hl.bind(mainMod .. " + " .. "U", hl.dsp.exec_cmd("~/.local/bin/bemoji")) +hl.bind("CTRL + ALT+ B", hl.dsp.exec_cmd("~/.local/bin/poweroptions_rofi")) +hl.bind(mainMod .. " + B", hl.dsp.exec_cmd("notify-send CPU-Profil gewechselt Performance && sudo /usr/bin/cpupower frequency-set -g performance")) +hl.bind(mainMod .. " + SHIFT" .. " + " .. "B", hl.dsp.exec_cmd("notify-send CPU-Profil gewechselt Powersave && sudo /usr/bin/cpupower frequency-set -g powersave")) +hl.bind(mainMod .. " + C", hl.dsp.exec_cmd("~/.local/bin/rofi_calc")) +hl.bind(mainMod .. " + SHIFT" .. " + " .. "C", hl.dsp.exec_cmd("~/.local/bin/rofi_calc --normal-window")) +hl.bind("CTRL + ALT + P", hl.dsp.exec_cmd("~/.config/rofi/bin/menu_powermenu")) +hl.bind(mainMod .. " + U", hl.dsp.exec_cmd("~/.local/bin/bemoji")) -- bind = $mainMod, U, exec, rofi -show emoji -modi emoji:/usr/bin/rofimoji --single -hl.bind(mainMod .. " + " .. "space", hl.dsp.exec_cmd("~/.local/bin/rofi_drun")) -hl.bind("SUPER" .. " + " .. "SUPER_L", hl.dsp.exec_cmd("~/.local/bin/rofi_drun"), { repeating = true }) -hl.bind("CTRL + ALT" .. " + " .. "minus", hl.dsp.exec_cmd("~/.local/bin/mount_rofi")) -hl.bind("ALT" .. " + " .. "space", hl.dsp.exec_cmd("zsh -c rofi -show run")) +hl.bind(mainMod .. " + space", hl.dsp.exec_cmd("~/.local/bin/rofi_drun")) +hl.bind("SUPER" .. " + SUPER_L", hl.dsp.exec_cmd("~/.local/bin/rofi_drun"), { repeating = true }) +hl.bind("CTRL + ALT + minus", hl.dsp.exec_cmd("~/.local/bin/mount_rofi")) + +-- TODO: fix bind: +hl.bind("ALT + space", hl.dsp.exec_cmd("zsh -c rofi -show run")) -- ========== System control ========== -- TODO: formatting/string cleanup @@ -217,21 +232,22 @@ hl.bind("CTRL + ALT + SHIFT" .. " + " .. "M", hl.dsp.exec_cmd("pactl set-source- -- ========== Media control ========== -- TODO: formatting/string cleanup -hl.bind(mainMod .. " + " .. "ALT" .. " + " .. "comma", hl.dsp.exec_cmd("playerctl previous")) -hl.bind(mainMod .. " + " .. "ALT" .. " + " .. "left", hl.dsp.exec_cmd("playerctl previous")) -hl.bind(mainMod .. " + " .. "F7", hl.dsp.exec_cmd("playerctl previous")) +hl.bind(mainMod .. " + ALT + comma", hl.dsp.exec_cmd("playerctl previous")) +hl.bind(mainMod .. " + ALT + left", hl.dsp.exec_cmd("playerctl previous")) +hl.bind(mainMod .. " + F7", hl.dsp.exec_cmd("playerctl previous")) -hl.bind(mainMod .. " + " .. "ALT" .. " + " .. "minus", hl.dsp.exec_cmd("playerctl pause")) +hl.bind(mainMod .. " + ALT + minus", hl.dsp.exec_cmd("playerctl pause")) -- bind = $mainMod ALT, up, exec, playerctl pause -- bind = $mainMod ALT, down, exec, playerctl pause -hl.bind(mainMod .. " + " .. "F8", hl.dsp.exec_cmd("playerctl pause")) +hl.bind(mainMod .. " + F8", hl.dsp.exec_cmd("playerctl pause")) -hl.bind(mainMod .. " + " .. "ALT" .. " + " .. "period", hl.dsp.exec_cmd("playerctl next")) +hl.bind(mainMod .. " + ALT + period", hl.dsp.exec_cmd("playerctl next")) -- bind = $mainMod ALT, right, exec, playerctl next -hl.bind(mainMod .. " + " .. "F9", hl.dsp.exec_cmd("playerctl next")) +hl.bind(mainMod .. " + F9", hl.dsp.exec_cmd("playerctl next")) -- ========== Brightness control ========== -- TODO: formatting/string cleanup +-- TODO: fix brightness: hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl set 3%-")) hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl set 3%+")) hl.bind(mainMod .. " + " .. "XF86AudioLowerVolume", hl.dsp.exec_cmd("~/.local/bin/monitor --dimmer")) @@ -245,10 +261,10 @@ hl.bind("CTRL + ALT + SHIFT" .. " + " .. "Next", hl.dsp.exec_cmd("~/.local/bin/m -- ========== Screenshots ========== -- TODO: formatting/string cleanup --- ---- full ---- +-- ---- Full ---- hl.bind("Print", hl.dsp.exec_cmd("~/.local/bin/screenshot --full")) --- screenshot of all monitors +-- Screenshot of all monitors hl.bind("CTRL" .. " + " .. "Print", hl.dsp.exec_cmd("~/.local/bin/screenshot --full_clipboard")) -- ---- Window ---- @@ -280,7 +296,7 @@ hl.bind(mainMod .. " + " .. "CTRL + SHIFT" .. " + " .. "Print", hl.dsp.exec_cmd( -- CTRL + SUPER + PRINT copy latest screenshot to clipboard --- ========== window management ========== +-- ========== Window management ========== -- TODO: formatting/string cleanup -- Move focus with mainMod + j i k l hl.bind(mainMod .. " + " .. "j", hl.dsp.focus({ direction = "left" })) @@ -300,34 +316,33 @@ hl.bind(mainMod .. " + " .. "right", hl.dsp.focus({ direction = "right" })) hl.bind(mainMod .. " + " .. "up", hl.dsp.focus({ direction = "up" })) hl.bind(mainMod .. " + " .. "down", hl.dsp.focus({ direction = "down" })) +-- Scroll through existing workspaces with mainMod + scroll +hl.bind(mainMod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" })) +hl.bind(mainMod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" })) + -- Toggle split direction hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. "minus", hl.dsp.layout("togglesplit")) hl.bind(mainMod .. " + " .. "minus", hl.dsp.layout("togglesplit")) hl.bind(mainMod .. " + " .. "x", hl.dsp.layout("togglesplit")) --- Resize windows, standard was 50 without animations --- TODO: manual review (unknown dispatcher: resizeactive) --- hl.bind("$mainMod + CTRL + left", hl.dsp.resizeactive("-70 0")) - --- TODO: manual review (unknown dispatcher: resizeactive) --- hl.bind("$mainMod + CTRL + right", hl.dsp.resizeactive("70 0")) - --- TODO: manual review (unknown dispatcher: resizeactive) --- hl.bind("$mainMod + CTRL + up", hl.dsp.resizeactive("0 -70")) - --- TODO: manual review (unknown dispatcher: resizeactive) --- hl.bind("$mainMod + CTRL + down", hl.dsp.resizeactive("0 70")) +-- Resize windows +local resizeUnit = 100 +hl.bind(mainMod .. " + CTRL + left", hl.dsp.window.resize({ x = -resizeUnit, y = 0, relative=true })) +hl.bind(mainMod .. " + CTRL + right", hl.dsp.window.resize({ x = resizeUnit, y = 0, relative=true })) +hl.bind(mainMod .. " + CTRL + up", hl.dsp.window.resize({ x = 0, y = -resizeUnit, relative=true })) +hl.bind(mainMod .. " + CTRL + down", hl.dsp.window.resize({ x = 0, y = resizeUnit, relative=true })) -- Move windows --- TODO: check syntax of dispatcher --- hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. "left", { direction = "l" }) --- hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. "right", { direction = "r" }) --- hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. "up", { direction = "u" }) --- hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. "down", { direction = "d" }) +hl.bind(mainMod .. " + SHIFT + left", hl.dsp.window.swap({ direction = "left" })) +hl.bind(mainMod .. " + SHIFT + right", hl.dsp.window.swap({ direction = "right" })) +hl.bind(mainMod .. " + SHIFT + up", hl.dsp.window.swap({ direction = "up" })) +hl.bind(mainMod .. " + SHIFT + down", hl.dsp.window.swap({ direction = "down" })) -- 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 }) + +-- Groups hl.bind("SUPER" .. " + " .. "g", hl.dsp.group.toggle()) hl.bind("SUPER" .. " + " .. "tab", hl.dsp.group.next({ forward = false })) @@ -337,14 +352,6 @@ hl.bind("SUPER" .. " + " .. "tab", hl.dsp.group.next({ forward = false })) -- hl.bind(mainMod .. " + S", hl.dsp.workspace.toggle_special("magic")) -- hl.bind(mainMod .. " + SHIFT + S", hl.dsp.window.move({ workspace = "special:magic" })) --- -- Scroll through existing workspaces with mainMod + scroll --- hl.bind(mainMod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" })) --- hl.bind(mainMod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" })) - --- -- 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 }) - -- -- Laptop multimedia keys for volume and LCD brightness -- hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), { locked = true, repeating = true }) -- hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { locked = true, repeating = true }) diff --git a/.config/hypr/modules/workspaces.lua b/.config/hypr/modules/workspaces.lua index 1abb0db..eb1a542 100644 --- a/.config/hypr/modules/workspaces.lua +++ b/.config/hypr/modules/workspaces.lua @@ -1,7 +1,7 @@ -------------------- ---- WORKSPACES ---- -------------------- --- Version 1 +-- Version 2 -- Last change: Sun 2026-06-14 using Hyprland v0.55.3-1 -- Git repo: https://git.fennek.xyz/fennek182/dotfiles @@ -10,97 +10,98 @@ hl.workspace_rule({ workspace = 1, monitor = "desc:Acer Technologies VG270U P 0x847015E8", - -- is_default = true, + default = true, }) hl.workspace_rule({ workspace = 2, monitor = "desc:Acer Technologies VG270U P 0x847015E8", - -- is_default = true, + default = true, }) hl.workspace_rule({ workspace = 3, monitor = "desc:Acer Technologies VG270U P 0x847015E8", - -- is_default = true, + default = true, }) hl.workspace_rule({ workspace = 4, monitor = "desc:Acer Technologies VG270U P 0x847015E8", - -- is_default = true, + default = true, }) hl.workspace_rule({ workspace = 5, monitor = "desc:LG Electronics LG ULTRAGEAR+ 310NTWGDY841", - -- is_default = true, + default = true, }) hl.workspace_rule({ workspace = 6, + -- workspace = "name:M2", monitor = "desc:LG Electronics LG ULTRAGEAR+ 310NTWGDY841", - -- is_default = true, + default = true, }) hl.workspace_rule({ workspace = 7, monitor = "desc:LG Electronics LG ULTRAGEAR+ 310NTWGDY841", - -- is_default = true, + default = true, }) hl.workspace_rule({ workspace = 8, monitor = "desc:LG Electronics LG ULTRAGEAR+ 310NTWGDY841", - -- is_default = true, + default = true, }) hl.workspace_rule({ workspace = 9, monitor = "desc:Samsung Electric Company Odyssey G70B H1AK500000", - -- is_default = true, + default = true, }) hl.workspace_rule({ workspace = 10, monitor = "desc:Samsung Electric Company Odyssey G70B H1AK500000", - -- is_default = true, + default = true, }) hl.workspace_rule({ workspace = 11, monitor = "desc:Samsung Electric Company Odyssey G70B H1AK500000", - -- is_default = true, + default = true, }) hl.workspace_rule({ workspace = 12, monitor = "desc:Samsung Electric Company Odyssey G70B H1AK500000", - -- is_default = true, + default = true, }) hl.workspace_rule({ workspace = 13, monitor = "desc:Yamaha Corporation RX-S602", - -- is_default = true, + default = true, }) hl.workspace_rule({ workspace = 14, monitor = "desc:Yamaha Corporation RX-S602", - -- is_default = true, + default = true, }) hl.workspace_rule({ workspace = 15, monitor = "desc:Yamaha Corporation RX-S602", - -- is_default = true, + default = true, }) hl.workspace_rule({ workspace = 16, monitor = "desc:Yamaha Corporation RX-S602", - -- d12efault = true, + default = true, })