summaryrefslogtreecommitdiff
path: root/common/home/hyprland/default.nix
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2026-06-07 21:10:38 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2026-06-07 21:11:15 +0200
commitc643862bfee0debaf1c5110e732adc8c69cdb203 (patch)
tree72efc189f659931ed385d7e51ef966f00577bd48 /common/home/hyprland/default.nix
parent64c9728e0c73e35787b2e69393a69c9d2815f936 (diff)
update to nixos 26.05
Diffstat (limited to 'common/home/hyprland/default.nix')
-rw-r--r--common/home/hyprland/default.nix264
1 files changed, 101 insertions, 163 deletions
diff --git a/common/home/hyprland/default.nix b/common/home/hyprland/default.nix
index 5ce838d..9ddb9bd 100644
--- a/common/home/hyprland/default.nix
+++ b/common/home/hyprland/default.nix
@@ -1,4 +1,8 @@
-{ pkgs, ... }: {
+{ pkgs, lib, ... }:
+let
+ hl = import ./hl.nix { inherit lib; };
+in
+{
enable = true;
systemd = {
@@ -6,196 +10,130 @@
variables = [ "--all" ];
};
xwayland.enable = true;
- #plugins = [ pkgs.hyprlandPlugins.hyprsplit ];
- configType = "hyprlang";
+ configType = "lua";
settings = {
- plugin = {
- #hyprsplit = {
- # num_workspaces = 10;
- # persistent_workspaces = false;
- #};
+ mod = {
+ _var = "SUPER";
};
- "$mod" = "SUPER";
bind = [
- "$mod+Shift, Q, exit"
- "$mod, C, killactive,"
- "$mod+Ctrl, F, togglefloating,"
- "$mod+Ctrl, S, togglesplit,"
+ (hl.bind { mod = true; keys = [ "Q" ]; flags = { long_press = true; locked = true; }; } (hl.dsp.exec "shutdown"))
- "$mod, Escape, exec, hyprlock"
- "$mod, Space, exec, wofi --show drun"
- "$mod, Shift+Space, exec, wofi --show run"
- "$mod, O, exec, openproject"
- "$mod, V, exec, openproject -e nvim"
- "$mod, B, exec, bluemenu"
- "$mod, P, pseudo"
+ (hl.bind { mod = true; keys = [ "h" ]; } (hl.dsp.focus { direction = "left"; }))
+ (hl.bind { mod = true; keys = [ "j" ]; } (hl.dsp.focus { direction = "down"; }))
+ (hl.bind { mod = true; keys = [ "k" ]; } (hl.dsp.focus { direction = "up"; }))
+ (hl.bind { mod = true; keys = [ "l" ]; } (hl.dsp.focus { direction = "right"; }))
+ (hl.bind { mod = true; keys = [ "i" ]; } (hl.dsp.layout "removemaster"))
+ (hl.bind { mod = true; keys = [ "d" ]; } (hl.dsp.layout "addmaster"))
- "$mod, F1, exec, loadconfig"
+ (hl.bind { mod = true; shift = true; keys = [ "h" ]; } (hl.dsp.window.move { direction = "left"; }))
+ (hl.bind { mod = true; shift = true; keys = [ "j" ]; } (hl.dsp.window.move { direction = "down"; }))
+ (hl.bind { mod = true; shift = true; keys = [ "k" ]; } (hl.dsp.window.move { direction = "up"; }))
+ (hl.bind { mod = true; shift = true; keys = [ "l" ]; } (hl.dsp.window.move { direction = "right"; }))
- "$mod, S, exec, sshconnect"
+ (hl.bind { mod = true; keys = [ "c" ]; } hl.dsp.window.close)
+ (hl.bind { mod = true; keys = [ "f" ]; } hl.dsp.window.fullscreen)
- "$mod+Shift, Return, exec, alacritty"
- "$mod+Shift, B, exec, firefox"
- "$mod+Shift, P, exec, wofi-pass"
- "$mod+Shift, O, exec, wofi-pass otp"
- "$mod+Shift, E, exec, webtrayctl show https://chat.nathanreiner.xyz"
- "$mod+Shift+Alt, J, exec, webtrayctl show https://jellyfin.nathanreiner.xyz"
- "$mod+Shift, S, exec, signal-desktop"
+ (hl.bind { mod = true; keys = [ "Escape" ]; } (hl.dsp.exec "hyprlock"))
+ (hl.bind { mod = true; keys = [ "Space" ]; } (hl.dsp.exec "wofi --show drun"))
+ (hl.bind { mod = true; keys = [ "o" ]; } (hl.dsp.exec "openproject"))
+ (hl.bind { mod = true; keys = [ "v" ]; } (hl.dsp.exec "openproject -e nvim"))
+ (hl.bind { mod = true; keys = [ "b" ]; } (hl.dsp.exec "bluemenu"))
+ (hl.bind { mod = true; keys = [ "F1" ]; } (hl.dsp.exec "bluemenu"))
+ (hl.bind { mod = true; keys = [ "s" ]; } (hl.dsp.exec "sshconnect"))
- ", Print, exec, grimshot copy area"
+ (hl.bind { mod = true; shift = true; keys = [ "Space" ]; } (hl.dsp.exec "wofi --show run"))
- "$mod, h, movefocus, l"
- "$mod, l, movefocus, r"
- "$mod, k, movefocus, u"
- "$mod, j, movefocus, d"
+ (hl.bind { mod = true; shift = true; keys = [ "Return" ]; } (hl.dsp.exec "alacritty"))
+ (hl.bind { mod = true; shift = true; keys = [ "b" ]; } (hl.dsp.exec "firefox"))
+ (hl.bind { mod = true; shift = true; keys = [ "p" ]; } (hl.dsp.exec "wofi-pass"))
+ (hl.bind { mod = true; shift = true; keys = [ "o" ]; } (hl.dsp.exec "wofi-pass otp"))
+ (hl.bind { mod = true; shift = true; keys = [ "e" ]; } (hl.dsp.exec "webtrayctl show https://chat.nathanreiner.xyz"))
+ (hl.bind { mod = true; shift = true; keys = [ "m" ]; } (hl.dsp.exec "webtrayctl show https://jellyfin.nathanreiner.xyz"))
+ (hl.bind { mod = true; shift = true; keys = [ "s" ]; } (hl.dsp.exec "signal-desktop"))
- "$mod, f, fullscreen"
- "$mod, Return, layoutmsg, swapwithmaster master"
- "$mod, i, layoutmsg, addmaster"
- "$mod, d, layoutmsg, removemaster"
+ (hl.bind { mod = true; shift = false; keys = [ "period" ]; flags = { repeating = true; }; } (hl.dsp.window.resize { x = 20; y = 0; relative = true; }))
+ (hl.bind { mod = true; shift = false; keys = [ "comma" ]; flags = { repeating = true; }; } (hl.dsp.window.resize { x = -20; y = 0; relative = true; }))
+ (hl.bind { mod = true; shift = true; keys = [ "period" ]; flags = { repeating = true; }; } (hl.dsp.window.resize { x = 0; y = 20; relative = true; }))
+ (hl.bind { mod = true; shift = true; keys = [ "comma" ]; flags = { repeating = true; }; } (hl.dsp.window.resize { x = 0; y = -20; relative = true; }))
- "$mod+Shift, h, movewindow, l"
- "$mod+Shift, l, movewindow, r"
- "$mod+Shift, k, movewindow, u"
- "$mod+Shift, j, movewindow, d"
+ (hl.bind { keys = [ "Print" ]; } (hl.dsp.exec "grimshot copy area"))
+ (hl.bind { keys = [ "XF86AudioMute" ]; flags = { repeating = true; }; } (hl.dsp.exec "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"))
+ (hl.bind { keys = [ "XF86AudioRaiseVolume" ]; flags = { repeating = true; }; } (hl.dsp.exec "wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"))
+ (hl.bind { keys = [ "XF86AudioLowerVolume" ]; flags = { repeating = true; }; } (hl.dsp.exec "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"))
+ (hl.bind { keys = [ "XF86AudioPlay" ]; flags = { repeating = true; }; } (hl.dsp.exec "playerctl play-pause"))
+ (hl.bind { keys = [ "XF86MonBrightnessDown" ]; flags = { repeating = true; }; } (hl.dsp.exec "brightnessctl set 10%-"))
+ (hl.bind { keys = [ "XF86MonBrightnessUp" ]; flags = { repeating = true; }; } (hl.dsp.exec "brightnessctl set +10%"))
- "$mod, 1, split:workspace, 1"
- "$mod, 2, split:workspace, 2"
- "$mod, 3, split:workspace, 3"
- "$mod, 4, split:workspace, 4"
- "$mod, 5, split:workspace, 5"
- "$mod, 6, split:workspace, 6"
- "$mod, 7, split:workspace, 7"
- "$mod, 8, split:workspace, 8"
- "$mod, 9, split:workspace, 9"
- "$mod, 0, split:workspace, 10"
-
- "$mod+Shift, 1, split:movetoworkspacesilent, 1"
- "$mod+Shift, 2, split:movetoworkspacesilent, 2"
- "$mod+Shift, 3, split:movetoworkspacesilent, 3"
- "$mod+Shift, 4, split:movetoworkspacesilent, 4"
- "$mod+Shift, 5, split:movetoworkspacesilent, 5"
- "$mod+Shift, 6, split:movetoworkspacesilent, 6"
- "$mod+Shift, 7, split:movetoworkspacesilent, 7"
- "$mod+Shift, 8, split:movetoworkspacesilent, 8"
- "$mod+Shift, 9, split:movetoworkspacesilent, 9"
- "$mod+Shift, 0, split:movetoworkspacesilent, 10"
- ];
-
- binde = [
- "$mod, period, resizeactive, 20 0"
- "$mod, comma, resizeactive, -20 0"
- "$mod+Shift, period, resizeactive, 0 20"
- "$mod+Shift, comma, resizeactive, 0 -20"
-
- ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
- ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"
- ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
- ", XF86AudioPlay, exec, playerctl play-pause"
-
- ", XF86MonBrightnessDown, exec, brightnessctl set 10%-"
- ", XF86MonBrightnessUp, exec, brightnessctl set +10%"
- ];
-
- bindm = [
- "$mod, mouse:272, movewindow"
+ (hl.bind { mod = true; keys = [ "mouse:272" ]; flags = { mouse = true; }; } (hl.dsp.window.drag))
];
- general = {
- gaps_in = 5;
- gaps_out = 5;
- layout = "master";
- border_size = 1;
- "col.active_border" = "rgba(3c3836ff)";
- "col.inactive_border" = "rgba(3c3836ff)";
- };
-
- decoration = {
- rounding = 4;
- shadow = {
- enabled = true;
- range = true;
- render_power = 4;
- };
- };
-
- animations = {
+ animation = [ {
enabled = true;
- animation = [
- "windows, 1, 2, default"
- "layers, 1, 2, default"
- "border, 1, 2, default"
- "borderangle, 1, 2, default"
- "fade, 1, 2, default"
- "workspaces, 1, 2, default"
- ];
- };
-
- dwindle = {
- pseudotile = true;
- preserve_split = true;
- };
+ speed = 1;
+ leaf = "global";
+ bezier = "default";
+ } ];
- master = {
- new_on_top = true;
- new_status = "master";
- };
-
- input = {
- kb_layout = "us,ch";
- kb_options = "caps:escape,grp:alt_space_toggle";
+ config = {
+ general = {
+ gaps_in = 5;
+ gaps_out = 5;
+ layout = "scrolling";
+ border_size = 1;
+ "col.active_border" = "rgba(665c54ff)";
+ "col.inactive_border" = "rgba(3c3836ff)";
+ };
- touchpad = {
- natural_scroll = true;
- clickfinger_behavior = true;
+ decoration = {
+ rounding = 4;
+ shadow = {
+ enabled = true;
+ range = true;
+ render_power = 4;
+ };
};
- tablet = {
- output = "DP-3";
+ misc = {
+ disable_hyprland_logo = true;
+ disable_splash_rendering = true;
+ enable_swallow = false;
+ swallow_regex = "^(Alacritty)$";
+ animate_manual_resizes = true;
};
- };
- misc = {
- disable_hyprland_logo = true;
- disable_splash_rendering = true;
- enable_swallow = false;
- swallow_regex = "^(Alacritty)$";
- animate_manual_resizes = true;
- };
+ input = {
+ kb_layout = "us,ch";
+ kb_options = "caps:escape,grp:alt_space_toggle";
- windowrule = [
- "pin,class:^(Hyprland::WinClass::Floating)$"
- "float,class:^(Hyprland::WinClass::Floating)$"
- "center,class:^(Hyprland::WinClass::Floating)$"
+ touchpad = {
+ natural_scroll = true;
+ clickfinger_behavior = true;
+ disable_while_typing = true;
+ };
- # KDE Connect Presentation
- "opacity 1, title: KDE Connect Daemon"
- "noblur, title: KDE Connect Daemon"
- "noborder, title: KDE Connect Daemon"
- "noshadow, title: KDE Connect Daemon"
- "noanim, title: KDE Connect Daemon"
- "nofocus, title: KDE Connect Daemon"
- "suppressevent fullscreen, title: KDE Connect Daemon"
- "float, title: KDE Connect Daemon"
- "pin, title: KDE Connect Daemon"
- "move 0 0, title: KDE Connect Daemon"
- "size 1920 1080, title: KDE Connect Daemon"
+ tablet = {
+ output = "DP-3";
+ };
- # Waydroid
- "float, size 500 900, class:^(waydroid\\..*)$"
- "float, size 500 900, class:^(Waydroid)$"
+ };
- # Nextcloud
- "float, move 100%-500 20, size 500 800, noborder, noblur, xray, pin, class:^(com.nextcloud\\..*)$, title:^(Nextcloud)$"
- ];
+ master = {
+ new_on_top = true;
+ new_status = "master";
+ };
- ecosystem = {
- no_update_news = true;
+ scrolling = {
+ direction = "down";
+ explicit_column_widths = "0.8, 1.0";
+ column_width = 0.8;
+ };
};
- exec-once = [
- "signal-desktop"
- "kdeconnect-indicator"
+ on = [
+ (hl.on.start [
+ (hl.dsp.exec "signal-desktop")
+ (hl.dsp.exec "kdeconnect-indicator")
+ ])
];
};
}