chore(user/malte): adjust hyprland config to new format

This commit is contained in:
Malte Tammena 2024-01-22 21:09:36 +01:00
parent 68a648eb80
commit b2b2c8818b
2 changed files with 222 additions and 231 deletions

View file

@ -55,14 +55,6 @@ in {
services.flatpak.enable = true;
programs.hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
xwayland = {
enable = true;
};
};
# TODO: Remove/Move
services.mysql = {
enable = true;

View file

@ -76,260 +76,259 @@
'';
};
hyprlandConfig = ''
${
if nixosConfig.settings.nvidiaUsed
then ''
# Prevent cursor from disappering under nvidia :')
env = WLR_NO_HARDWARE_CURSORS,1
env = LIBVA_DRIVER_NAME,nvidia
env = XDG_SESSION_TYPE,wayland
env = GBM_BACKEND,nvidia-drm
''
else ""
}
# See https://wiki.hyprland.org/Configuring/Monitors/
${
if nixosConfig.networking.hostName == "helix-texta"
then "monitor = eDP-1,3840x2160@60,0x0,2"
else ""
}
monitor = desc:BNQ BenQ GW2270 P9J02423SL0, 1920x1080, 0x0, 1
monitor = desc:BNQ BenQ GW2270 P9J02423SL0, transform, 3
monitor = desc:LG Electronics IPS226 SerialNumber, 1920x1080, 1080x420, 1
monitor = ,preferred,auto,1
hyprlandSettings = {
env =
(lib.lists.optionals nixosConfig.settings.nvidiaUsed [
"WLR_NO_HARDWARE_CURSORS,1"
"LIBVA_DRIVER_NAME,nvidia"
"XDG_SESSION_TYPE,wayland"
"GBM_BACKEND,nvidia-drm"
])
++ [
"PASSWORD_STORE_DIR,${config.programs.password-store.settings.PASSWORD_STORE_DIR}"
];
monitor =
(lib.lists.optional (nixosConfig.networking.hostName == "helix-texta") "eDP-1,3840x2160@60,0x0,2")
++ [
"desc:BNQ BenQ GW2270 P9J02423SL0, 1920x1080, 0x0, 1"
"desc:BNQ BenQ GW2270 P9J02423SL0, transform, 3"
"desc:LG Electronics IPS226 SerialNumber, 1920x1080, 1080x420, 1"
",preferred,auto,1"
];
"$mainMod" = "SUPER";
"$blue" = "458588";
"$green" = "98971a";
exec-once = [
"dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"${pkgs.waybar}/bin/waybar"
"${pkgs.hyprpaper}/bin/hyprpaper"
"${runWob}/bin/run-wob"
];
input = {
kb_variant =
if nixosConfig.networking.hostName == "helix-texta"
then "workman"
else if nixosConfig.networking.hostName == "murex-pecten"
then ""
else "";
kb_options = "compose:ralt";
kb_rules = "";
$mainMod = SUPER
follow_mouse = "1";
sensitivity = "0";
accel_profile = "flat";
$blue = 458588
$green = 98971a
touchpad = {
natural_scroll = "yes";
tap-to-click = "yes";
drag_lock = "yes";
tap-and-drag = "yes";
};
};
"device:usb-hid-keyboard" = {
kb_options = "compose:rwin";
};
exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once=${pkgs.waybar}/bin/waybar
exec-once=${pkgs.hyprpaper}/bin/hyprpaper
exec-once=${runWob}/bin/run-wob
"device:at-translated-set-2-keyboard" = {};
"device:keyboardio-atreus" = {kb_variant = "";};
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
${
if nixosConfig.networking.hostName == "helix-texta"
then ''
kb_variant = workman
''
else if nixosConfig.networking.hostName == "murex-pecten"
then ''
kb_variant =
''
else ""
}
general = {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
kb_options = compose:ralt
kb_rules =
gaps_in = 3;
gaps_out = 3;
border_size = 1;
"col.active_border" = "rgba($bluecc) rgba($greencc) 45deg";
"col.inactive_border" = "rgba(282828cc)";
follow_mouse = 1
sensitivity = 0
accel_profile = flat
layout = "dwindle";
};
touchpad {
natural_scroll = yes
tap-to-click = yes
drag_lock = yes
tap-and-drag = yes
}
}
decoration = {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
device:usb-hid-keyboard {
kb_options = compose:rwin
}
rounding = 2;
device:at-translated-set-2-keyboard {
blur = {
enabled = "yes";
size = 3;
passes = 1;
new_optimizations = "on";
};
}
drop_shadow = "yes";
shadow_range = 4;
shadow_render_power = 3;
"col.shadow" = "rgba(1a1a1aee)";
device:keyboardio-atreus {
kb_variant =
}
dim_inactive = true;
dim_strength = 0.1;
};
general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
animations = {
enabled = "yes";
gaps_in = 3
gaps_out = 3
border_size = 1
col.active_border = rgba($bluecc) rgba($greencc) 45deg
col.inactive_border = rgba(282828cc)
bezier = [
"switchWorkspaces, 0.75, 0 , 0.25, 1"
"easeOutBack , 0.34, 1.16, 0.64, 1"
"easeOutExpo , 0.16, 1 , 0.3 , 1"
"easeOutQuint , 0.22, 1 , 0.36, 1"
"easeInOutQuint , 0.83, 0 , 0.17, 1"
];
animation = [
"windows , 1, 3, easeOutExpo"
"windowsOut, 1, 2, default , popin 80%"
"border , 1, 3, easeOutExpo"
"fade , 1, 2, default"
"workspaces, 1, 2, switchWorkspaces, slidevert"
];
};
layout = dwindle
}
dwindle = {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = "yes"; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = "yes"; # you probably want this
force_split = 2;
};
decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
gestures = {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = "on";
workspace_swipe_distance = 100;
};
rounding = 2
windowrule = [
# Pinentry fancyness
"float,class:^(pinentry-qt)$"
"pin,class:^(pinentry-qt)$"
"bordercolor rgb(ff0000) rgb(ff0000),class:^(pinentry-qt)$"
"center,class:^(pinentry-qt)$"
"animation popin,class:^(pinentry-qt)$"
"bordercolor rgb(ff0000),xwayland:1"
# Yikes, firefox sharing indicator!
"float,title:^(Firefox Sharing Indicator)$"
"move 100%-57 100%-31,title:^(Firefox Sharing Indicator)$"
"nofocus,title:^(Firefox Sharing Indicator)$"
"noborder,title:^(Firefox Sharing Indicator)$"
"nofullscreenrequest,title:^(Firefox Sharing Indicator)$"
"animation popin,title:^(Firefox Sharing Indicator)$"
];
blur {
enabled = yes
size = 3
passes = 1
new_optimizations = on
}
windowrulev2 = [
# Float picture-in-picture videos
"float,title:^(Picture-in-Picture)$,class:^(firefox)$"
"pin,title:^(Picture-in-Picture)$,class:^(firefox)$"
# Fix various steam windows
"workspace 7,class:^(Steam)$"
"float,title:^(Friends List)$,class:^(Steam)$"
"float,title:^(Steam - News)$,class:^(Steam)$"
];
drop_shadow = yes
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(1a1a1aee)
bind = [
"bind = $mainMod , return, exec , kitty"
"bind = $mainMod SHIFT, Q , killactive ,"
"bind = $mainMod SHIFT, E , exit ,"
"bind = $mainMod SHIFT, space , togglefloating,"
"bind = $mainMod SHIFT, P , pseudo ," # dwindle
"bind = $mainMod , E , togglesplit ," # dwindle
dim_inactive = true;
dim_strength = 0.1;
}
# Move focus with mainMod + arrow keys
"bind = $mainMod , H, movefocus , l"
"bind = $mainMod , L, movefocus , r"
"bind = $mainMod , K, movefocus , u"
"bind = $mainMod , J, movefocus , d"
"bind = $mainMod SHIFT, H, movewindow, l"
"bind = $mainMod SHIFT, L, movewindow, r"
"bind = $mainMod SHIFT, K, movewindow, u"
"bind = $mainMod SHIFT, J, movewindow, d"
animations {
enabled = yes
# Switch workspaces with mainMod + [0-9]
"bind = $mainMod, 1, workspace, 1"
"bind = $mainMod, 2, workspace, 2"
"bind = $mainMod, 3, workspace, 3"
"bind = $mainMod, 4, workspace, 4"
"bind = $mainMod, 5, workspace, 5"
"bind = $mainMod, 6, workspace, 6"
"bind = $mainMod, 7, workspace, 7"
"bind = $mainMod, 8, workspace, 8"
"bind = $mainMod, 9, workspace, 9"
bezier = switchWorkspaces, 0.75, 0 , 0.25, 1
bezier = easeOutBack , 0.34, 1.16, 0.64, 1
bezier = easeOutExpo , 0.16, 1 , 0.3 , 1
bezier = easeOutQuint , 0.22, 1 , 0.36, 1
bezier = easeInOutQuint , 0.83, 0 , 0.17, 1
# Move active window to a workspace and follow it
"bind = $mainMod CTRL SHIFT, 1, movetoworkspace, 1"
"bind = $mainMod CTRL SHIFT, 2, movetoworkspace, 2"
"bind = $mainMod CTRL SHIFT, 3, movetoworkspace, 3"
"bind = $mainMod CTRL SHIFT, 4, movetoworkspace, 4"
"bind = $mainMod CTRL SHIFT, 5, movetoworkspace, 5"
"bind = $mainMod CTRL SHIFT, 6, movetoworkspace, 6"
"bind = $mainMod CTRL SHIFT, 7, movetoworkspace, 7"
"bind = $mainMod CTRL SHIFT, 8, movetoworkspace, 8"
"bind = $mainMod CTRL SHIFT, 9, movetoworkspace, 9"
animation = windows , 1, 3, easeOutExpo
animation = windowsOut, 1, 2, default , popin 80%
animation = border , 1, 3, easeOutExpo
animation = fade , 1, 2, default
animation = workspaces, 1, 2, switchWorkspaces, slidevert
}
# Move active window to a workspace without following it
"bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1"
"bind = $mainMod SHIFT, 2, movetoworkspacesilent, 2"
"bind = $mainMod SHIFT, 3, movetoworkspacesilent, 3"
"bind = $mainMod SHIFT, 4, movetoworkspacesilent, 4"
"bind = $mainMod SHIFT, 5, movetoworkspacesilent, 5"
"bind = $mainMod SHIFT, 6, movetoworkspacesilent, 6"
"bind = $mainMod SHIFT, 7, movetoworkspacesilent, 7"
"bind = $mainMod SHIFT, 8, movetoworkspacesilent, 8"
"bind = $mainMod SHIFT, 9, movetoworkspacesilent, 9"
dwindle {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = yes # you probably want this
force_split = 2
}
"bind = $mainMod SHIFT, T, togglegroup"
"bind = $mainMod, T, changegroupactive, f"
gestures {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = on
workspace_swipe_distance = 100;
}
"bind = $mainMod, F, fullscreen, 0"
"bind = $mainMod SHIFT, F, fullscreen, 1"
"bind = $mainMod CTRL SHIFT, F, fakefullscreen"
"bind = $mainMod, U, pin, active"
# Pinentry fancyness
windowrule = float,class:^(pinentry-qt)$
windowrule = pin,class:^(pinentry-qt)$
windowrule = bordercolor rgb(ff0000) rgb(ff0000),class:^(pinentry-qt)$
windowrule = center,class:^(pinentry-qt)$
windowrule = animation popin,class:^(pinentry-qt)$
windowrule = bordercolor rgb(ff0000),xwayland:1
# Yikes, firefox sharing indicator!
windowrule = float,title:^(Firefox Sharing Indicator)$
windowrule = move 100%-57 100%-31,title:^(Firefox Sharing Indicator)$
windowrule = nofocus,title:^(Firefox Sharing Indicator)$
windowrule = noborder,title:^(Firefox Sharing Indicator)$
windowrule = nofullscreenrequest,title:^(Firefox Sharing Indicator)$
windowrule = animation popin,title:^(Firefox Sharing Indicator)$
# Float picture-in-picture videos
windowrulev2 = float,title:^(Picture-in-Picture)$,class:^(firefox)$
windowrulev2 = pin,title:^(Picture-in-Picture)$,class:^(firefox)$
# Fix various steam windows
windowrulev2 = workspace 7,class:^(Steam)$
windowrulev2 = float,title:^(Friends List)$,class:^(Steam)$
windowrulev2 = float,title:^(Steam - News)$,class:^(Steam)$
"bind = $mainMod CTRL SHIFT, L, movecurrentworkspacetomonitor, r"
"bind = $mainMod CTRL SHIFT, H, movecurrentworkspacetomonitor, l"
bind = $mainMod , return, exec , kitty
bind = $mainMod SHIFT, Q , killactive ,
bind = $mainMod SHIFT, E , exit ,
bind = $mainMod SHIFT, space , togglefloating,
bind = $mainMod SHIFT, P , pseudo , # dwindle
bind = $mainMod , E , togglesplit , # dwindle
# Scroll through existing workspaces with mainMod + scroll
"bind = $mainMod, mouse_down, workspace, e+1"
"bind = $mainMod, mouse_up, workspace, e-1"
# Menu
"$mainMod, D, exec, ${bemenu}/bin/bemenu-run-configured -p 'Program:'"
# Move focus with mainMod + arrow keys
bind = $mainMod , H, movefocus , l
bind = $mainMod , L, movefocus , r
bind = $mainMod , K, movefocus , u
bind = $mainMod , J, movefocus , d
bind = $mainMod SHIFT, H, movewindow, l
bind = $mainMod SHIFT, L, movewindow, r
bind = $mainMod SHIFT, K, movewindow, u
bind = $mainMod SHIFT, J, movewindow, d
# Passwords
"$mainMod, P, exec, passmenu-bemenu"
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
# Colorpicker
"$mainMod SHIFT, C, exec, ${pkgs.hyprpicker}/bin/hyprpicker -a"
# Move active window to a workspace and follow it
bind = $mainMod CTRL SHIFT, 1, movetoworkspace, 1
bind = $mainMod CTRL SHIFT, 2, movetoworkspace, 2
bind = $mainMod CTRL SHIFT, 3, movetoworkspace, 3
bind = $mainMod CTRL SHIFT, 4, movetoworkspace, 4
bind = $mainMod CTRL SHIFT, 5, movetoworkspace, 5
bind = $mainMod CTRL SHIFT, 6, movetoworkspace, 6
bind = $mainMod CTRL SHIFT, 7, movetoworkspace, 7
bind = $mainMod CTRL SHIFT, 8, movetoworkspace, 8
bind = $mainMod CTRL SHIFT, 9, movetoworkspace, 9
# Screenshot
"$mainMod CTRL SHIFT, S, exec, ${pkgs.grimblast}/bin/grimblast --notify copy area"
"$mainMod CTRL , S, exec, ${pkgs.grimblast}/bin/grimblast --notify copy output"
"$mainMod SHIFT, S, exec, ${pkgs.grimblast}/bin/grimblast --notify copy active"
# Move active window to a workspace without following it
bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1
bind = $mainMod SHIFT, 2, movetoworkspacesilent, 2
bind = $mainMod SHIFT, 3, movetoworkspacesilent, 3
bind = $mainMod SHIFT, 4, movetoworkspacesilent, 4
bind = $mainMod SHIFT, 5, movetoworkspacesilent, 5
bind = $mainMod SHIFT, 6, movetoworkspacesilent, 6
bind = $mainMod SHIFT, 7, movetoworkspacesilent, 7
bind = $mainMod SHIFT, 8, movetoworkspacesilent, 8
bind = $mainMod SHIFT, 9, movetoworkspacesilent, 9
# Toggle DO-NOT-DISTURB mode
"$mainMod, N, exec, ${doNotDisturb}/bin/do-not-disturb toggle"
bind = $mainMod SHIFT, T, togglegroup
bind = $mainMod, T, changegroupactive, f
# Discord mute and deafmute
"CTRL_R, Insert, pass, .*[Dd]iscord.*"
"CTRL_R, Delete, pass, .*[Dd]iscord.*"
];
bind = $mainMod, F, fullscreen, 0
bind = $mainMod SHIFT, F, fullscreen, 1
bind = $mainMod CTRL SHIFT, F, fakefullscreen
bind = $mainMod, U, pin, active
bindm = [
# Move/resize windows with mainMod + LMB/RMB and dragging
"$mainMod, mouse:272, movewindow"
"$mainMod, mouse:273, resizewindow"
];
bind = $mainMod CTRL SHIFT, L, movecurrentworkspacetomonitor, r
bind = $mainMod CTRL SHIFT, H, movecurrentworkspacetomonitor, l
bindel = [
# Sound control
", XF86AudioRaiseVolume, exec, ${pkgs.ponymix}/bin/ponymix increase 5% > ${wobFifo}"
", XF86AudioLowerVolume, exec, ${pkgs.ponymix}/bin/ponymix decrease 5% > ${wobFifo}"
];
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
# Menu
bind = $mainMod, D, exec, ${bemenu}/bin/bemenu-run-configured -p 'Program:'
# Passwords
bind = $mainMod, P, exec, passmenu-bemenu
# Colorpicker
bind = $mainMod SHIFT, C, exec, ${pkgs.hyprpicker}/bin/hyprpicker -a
# Screenshot
bind = $mainMod CTRL SHIFT, S, exec, ${pkgs.grimblast}/bin/grimblast --notify copy area
bind = $mainMod CTRL , S, exec, ${pkgs.grimblast}/bin/grimblast --notify copy output
bind = $mainMod SHIFT, S, exec, ${pkgs.grimblast}/bin/grimblast --notify copy active
# Toggle DO-NOT-DISTURB mode
bind = $mainMod, N, exec, ${doNotDisturb}/bin/do-not-disturb toggle
# Sound control
bindel =, XF86AudioRaiseVolume, exec, ${pkgs.ponymix}/bin/ponymix increase 5% > ${wobFifo}
bindel =, XF86AudioLowerVolume, exec, ${pkgs.ponymix}/bin/ponymix decrease 5% > ${wobFifo}
bindl =, XF86AudioMute, exec, ${ponymixToggle}/bin/ponymix-toggle
bindl =, XF86AudioMicMute, exec, ${ponymixToggleInput}/bin/ponymix-toggle-input
# Discord mute and deafmute
bind = CTRL_R, Insert, pass, .*[Dd]iscord.*
bind = CTRL_R, Delete, pass, .*[Dd]iscord.*
'';
bindl = [
# Sound control
", XF86AudioMute, exec, ${ponymixToggle}/bin/ponymix-toggle"
", XF86AudioMicMute, exec, ${ponymixToggleInput}/bin/ponymix-toggle-input"
];
};
in {
imports = [
./waybar.nix
@ -347,7 +346,9 @@ in {
config = lib.mkIf cfg.enable {
wayland.windowManager.hyprland = {
enable = true;
settings = hyprlandSettings;
xwayland.enable = true;
systemd.variables = ["-all"];
};
home.packages = [
@ -361,7 +362,7 @@ in {
size = 48;
};
# If running from tty2 start hyprland
# If running from tty1 start hyprland
xdg.configFile."fish/conf.d/hyprland.fish".text = ''
set TTY1 (tty)
if test -z \"$DISPLAY\"; and test $TTY1 = '/dev/tty1'
@ -373,7 +374,5 @@ in {
xdg.configFile."hypr/hyprpaper.conf".text = hyprpaperConfig;
# Configure wob
xdg.configFile."wob/wob.ini".text = wobConfig;
# Main config
xdg.configFile."hypr/hyprland.conf".text = hyprlandConfig;
};
}