Make hyprland workspaces more program focused

Change bindings and name convention to decouple workspaces from ID
number and focus more on what the workspace is used for
TODO proper window rules
This commit is contained in:
Evie Litherland-Smith 2023-06-28 16:20:02 +01:00
parent 151c317845
commit af10a9346e
3 changed files with 76 additions and 87 deletions

View file

@ -171,13 +171,15 @@
"disable-scroll": true, "disable-scroll": true,
"all-outputs": false, "all-outputs": false,
"sort-by-number": true, "sort-by-number": true,
"format": "{name}" "format": "{icon}",
"format-icons": {
"terminal": "󰅴",
"browser": "󰈹",
"files": "󰝰",
"chat": "󰭹",
"urgent": "",
"default": ""
},
"sort-by-number": false
}, },
"sway/workspaces": {
"on-click": "activate",
"disable-scroll": true,
"all-outputs": false,
"sort-by-number": true,
"format": "{name}"
}
} }

View file

@ -50,7 +50,12 @@
col.group_border_active = $mauve col.group_border_active = $mauve
col.inactive_border = $surface2 col.inactive_border = $surface2
col.group_border = $surface2 col.group_border = $surface2
layout = master layout = dwindle
}
dwindle {
force_split = 2
preserve_split = true
} }
decoration { decoration {
@ -78,91 +83,65 @@
} }
# See https://wiki.hyprland.org/Configuring/Keywords/ for more # See https://wiki.hyprland.org/Configuring/Keywords/ for more
bind = SUPER, Return, exec, wezterm bind = ALT, Return, exec, wezterm
bind = SUPER, Q, killactive, bind = ALT, Space, exec, pkill rofi || rofi -show drun
bind = SUPER, V, togglefloating, bind = ALT, Q, killactive,
bind = SUPER, R, exec, pkill rofi || rofi -show drun bind = ALT, P, exec, swaylock
bind = SUPER, S, exec, grim -g "$(slurp)" bind = ALT, M, fullscreen, 0
bind = SUPER, P, exec, swaylock bind = ALT SHIFT, M, fullscreen, 1
bind = SUPER, W, exec, firefox bind = ALT SHIFT, P, exec, powermenu
bind = SUPER, F, exec, thunar bind = ALT SHIFT, Space, togglefloating,
bind = SUPER, M, fullscreen, 0
bind = SUPER SHIFT, M, fullscreen, 1
bind = SUPER SHIFT, P, exec, powermenu
bind = , Print, exec, grim -g "$(slurp)"
bind = , XF86AudioMute, exec, pamixer -t bind = , XF86AudioMute, exec, pamixer -t
binde = , XF86AudioRaiseVolume, exec, pamixer -i 2 binde = , XF86AudioRaiseVolume, exec, pamixer -i 2
binde = , XF86AudioLowerVolume, exec, pamixer -d 2 binde = , XF86AudioLowerVolume, exec, pamixer -d 2
# Move focus with mainMod + arrow keys bind = ALT, H, movefocus, l
bind = SUPER, left, movefocus, l bind = ALT, L, movefocus, r
bind = SUPER, H, movefocus, l bind = ALT, K, movefocus, u
bind = SUPER, right, movefocus, r bind = ALT, J, movefocus, d
bind = SUPER, L, movefocus, r bind = ALT SHIFT, H, movewindow, l
bind = SUPER, up, movefocus, u bind = ALT SHIFT, L, movewindow, r
bind = SUPER, K, movefocus, u bind = ALT SHIFT, K, movewindow, u
bind = SUPER, down, movefocus, d bind = ALT SHIFT, J, movewindow, d
bind = SUPER, J, movefocus, d
bind = SUPER SHIFT, left, movewindow, l workspace = name:terminal, default:true
bind = SUPER SHIFT, H, movewindow, l workspace = name:browser
bind = SUPER SHIFT, right, movewindow, r workspace = name:files
bind = SUPER SHIFT, L, movewindow, r workspace = name:chat
bind = SUPER SHIFT, up, movewindow, u
bind = SUPER SHIFT, K, movewindow, u
bind = SUPER SHIFT, down, movewindow, d
bind = SUPER SHIFT, J, movewindow, d
# Switch workspaces with mainMod + [0-9] bind = ALT, T, moveworkspacetomonitor, name:terminal current
bind = SUPER, 1, moveworkspacetomonitor, 1 current bind = ALT, T, workspace, name:terminal
bind = SUPER, 1, workspace, 1 bind = ALT SHIFT, T, moveworkspacetomonitor, name:terminal current
bind = SUPER, 2, moveworkspacetomonitor, 2 current bind = ALT SHIFT, T, movetoworkspace, name:terminal
bind = SUPER, 2, workspace, 2
bind = SUPER, 3, moveworkspacetomonitor, 3 current
bind = SUPER, 3, workspace, 3
bind = SUPER, 4, moveworkspacetomonitor, 4 current
bind = SUPER, 4, workspace, 4
bind = SUPER, 5, moveworkspacetomonitor, 5 current
bind = SUPER, 5, workspace, 5
bind = SUPER, 6, moveworkspacetomonitor, 6 current
bind = SUPER, 6, workspace, 6
bind = SUPER, 7, moveworkspacetomonitor, 7 current
bind = SUPER, 7, workspace, 7
bind = SUPER, 8, moveworkspacetomonitor, 8 current
bind = SUPER, 8, workspace, 8
bind = SUPER, 9, moveworkspacetomonitor, 9 current
bind = SUPER, 9, workspace, 9
bind = SUPER, 0, moveworkspacetomonitor, 0 current
bind = SUPER, 0, workspace, 10
# Move active window to a workspace with mainMod + SHIFT + [0-9] bind = ALT, W, moveworkspacetomonitor, name:browser current
bind = SUPER SHIFT, 1, movetoworkspace, 1 bind = ALT, W, workspace, name:browser
bind = SUPER SHIFT, 2, movetoworkspace, 2 bind = ALT SHIFT, W, moveworkspacetomonitor, name:browser current
bind = SUPER SHIFT, 3, movetoworkspace, 3 bind = ALT SHIFT, W, movetoworkspace, name:browser
bind = SUPER SHIFT, 4, movetoworkspace, 4
bind = SUPER SHIFT, 5, movetoworkspace, 5
bind = SUPER SHIFT, 6, movetoworkspace, 6
bind = SUPER SHIFT, 7, movetoworkspace, 7
bind = SUPER SHIFT, 8, movetoworkspace, 8
bind = SUPER SHIFT, 9, movetoworkspace, 9
bind = SUPER, period, workspace, m+1 bind = ALT, F, moveworkspacetomonitor, name:files current
bind = SUPER, comma, workspace, m-1 bind = ALT, F, workspace, name:files
bind = SUPER, bracketright, focusmonitor, +1 bind = ALT SHIFT, F, moveworkspacetomonitor, name:files current
bind = SUPER, bracketleft, focusmonitor, +1 bind = ALT SHIFT, F, movetoworkspace, name:files
bind = SUPER, N, workspace, empty bind = ALT, C, moveworkspacetomonitor, name:chat current
bind = SUPER SHIFT, N, movetoworkspace, empty bind = ALT, C, workspace, name:chat
bind = ALT SHIFT, C, moveworkspacetomonitor, name:chat current
bind = ALT SHIFT, C, movetoworkspace, name:chat
bind = SUPER, C, togglespecialworkspace bind = ALT, period, workspace, m+1
bind = SUPER SHIFT, C, movetoworkspace, special bind = ALT, comma, workspace, m-1
bind = ALT, bracketright, focusmonitor, +1
bind = ALT, bracketleft, focusmonitor, +1
bind = SUPER, tab, workspace, previous bind = ALT, N, workspace, empty
bind = SUPER SHIFT, tab, movetoworkspace, previous bind = ALT SHIFT, N, movetoworkspace, empty
# Move/resize windows with mainMod + LMB/RMB and dragging # Move/resize windows with mainMod + LMB/RMB and dragging
bindm = SUPER, mouse:272, movewindow bindm = ALT, mouse:272, movewindow
bindm = SUPER, mouse:273, resizewindow bindm = ALT, mouse:273, resizewindow
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
windowrule = float, ^(foot)$ windowrule = float, ^(foot)$

View file

@ -1,8 +1,8 @@
{pkgs, ...}: let {pkgs, ...}: let
laptop-state = pkgs.writeShellScriptBin "check-laptop-lid-state" '' laptop-state = pkgs.writeShellScriptBin "check-laptop-lid-state" ''
grep closed /proc/acpi/button/lid/LID0/state &&\ grep closed /proc/acpi/button/lid/LID0/state &&\
hyprctl dispatch dpms off eDP-1 ||\ hyprctl keyword monitor "eDP-1,disable" ||\
hyprctl dispatch dpms on eDP-1 hyprctl keyword monitor "eDP-1,1920x1080,0x0,1.0"
''; '';
in { in {
imports = [./default.nix]; imports = [./default.nix];
@ -10,21 +10,29 @@ in {
home.packages = [laptop-state]; home.packages = [laptop-state];
wayland.windowManager.hyprland.extraConfig = '' wayland.windowManager.hyprland.extraConfig = ''
source=./common.conf source=./common.conf
monitor = eDP-1,1920x1080,0x0,1.0 bindl=,switch:Lid Switch,exec,check-laptop-lid-state
exec = ${laptop-state}/bin/check-laptop-lid-state
monitor = DP-3,1920x1200,1920x0,1.0 monitor = DP-3,1920x1200,1920x0,1.0
monitor = DP-4,1920x1080,3840x0,1.0,transform,1 monitor = DP-4,1920x1080,3840x0,1.0,transform,1
bindl=,switch:Lid Switch,exec,check-laptop-lid-state
bindl=,switch:Lid Switch,exec,swaylock workspace = name:remote
exec = ${laptop-state}/bin/check-laptop-lid-state bind = ALT, R, moveworkspacetomonitor, remote current
bind = ALT, R, workspace, remote
bind = ALT SHIFT, R, moveworkspacetomonitor, remote current
bind = ALT SHIFT, R, movetoworkspace, remote
''; '';
programs.waybar.settings = { programs.waybar.settings = {
main."output" = "!DP-4"; main = {
"output" = "!DP-4";
"wlr/workspaces"."format-icons"."remote" = "󰢹";
};
alt = { alt = {
"include" = [ "include" = [
"~/.config/waybar/modules.json" "~/.config/waybar/modules.json"
"~/.config/waybar/layout.json" "~/.config/waybar/layout.json"
]; ];
"output" = "DP-4"; "output" = "DP-4";
"wlr/workspaces"."format-icons"."remote" = "󰢹";
"modules-left" = []; "modules-left" = [];
"modules-center" = ["wlr/workspaces"]; "modules-center" = ["wlr/workspaces"];
"modules-right" = []; "modules-right" = [];