diff options
| author | spl3g <spleefer6@yandex.ru> | 2024-04-13 03:43:05 +0300 |
|---|---|---|
| committer | spl3g <spleefer6@yandex.ru> | 2025-05-01 14:56:39 +0300 |
| commit | bdb5ed429a6ee54fea4e32181b89e301a5e6b96e (patch) | |
| tree | 6673b220529f2d0f336271e96741cd0c4ade93fc | |
| parent | 2365411258827bf70212a8e315a7127bb0789e79 (diff) | |
hyprland rewrite
| -rw-r--r-- | home-manager/laptop/hyprland/default.nix | 167 | ||||
| -rw-r--r-- | home-manager/laptop/hyprland/hyprland.conf | 4 |
2 files changed, 155 insertions, 16 deletions
diff --git a/home-manager/laptop/hyprland/default.nix b/home-manager/laptop/hyprland/default.nix index 5b10c11..62d346a 100644 --- a/home-manager/laptop/hyprland/default.nix +++ b/home-manager/laptop/hyprland/default.nix @@ -1,15 +1,4 @@ { pkgs, ... }: -let - configFile = builtins.readFile ./hyprland.conf; - scripts = '' - $scripts=${./scripts} - ''; - overrides = '' - exec-once=swww init && swww img ${./cat.png} - ''; - extraConfig = scripts + configFile + overrides; - -in { home.packages = with pkgs; [ swww @@ -29,13 +18,163 @@ in xdg-desktop-portal-hyprland ]; }; - - programs.fish.loginShellInit = "Hyprland"; wayland.windowManager.hyprland = { enable = true; package = pkgs.hyprland; - inherit extraConfig; + settings = { + "$scripts" = "${./scripts}"; + "$mainMod" = "SUPER"; + "$terminal" = "alacritty"; + exec-once = [ + "emacs --daemon" + "swww-daemon" + ]; + input = { + kb_layout = "us,ru"; + kb_options = "grp:win_space_toggle"; + follow_mouse = 1; + touchpad = { + natural_scroll = "yes"; + disable_while_typing = "no"; + }; + sensitivity = 0.1; + }; + general = { + gaps_in = 5; + gaps_out = 20; + border_size = 3; + "col.active_border" = "0xFF6e6a86"; + "col.inactive_border" = "0xFF363a4f"; + layout = "dwindle"; + allow_tearing = false; + }; + + decoration = { + rounding = 7; + drop_shadow = "yes"; + shadow_range = 4; + shadow_render_power = 3; + "col.shadow" = "rgba(1a1a1aee)"; + blur = { + enabled = true; + size = 3; + passes = 1; + }; + }; + + animations = { + enabled = 1; + bezier = "overshot,0.13,0.99,0.29,1.1,"; + animation = [ + "fade,1,4,default" + "workspaces,1,4,default,fade" + "windows,1,4,overshot,popin 95%" + ]; + }; + + # love the "true" variants + dwindle = { + pseudotile = "yes"; + preserve_split = "yes"; + }; + + master.new_is_master = true; + gestures.workspace_swipe = "on"; + misc.force_default_wallpaper = 1; + # + + windowrulev2 = [ + "float, title:^(Firrfox — Sharing Indicator)$" + "noborder, title:^(Firefox — Sharing Indicator)$" + "rounding 0, title:^(Firefox — Sharing Indicator)$" + "float, title:^(firefox)$, title:^(Picture-in-Picture)$" + "pin, title:^(firefox)$, title:^(Picture-in-Picture)$" + "float, title:^(Save File)$" + "pin, title:^(Save File)$" + "float, title:^(Torrent Options)$" + "pin, title:^(Torrent Options)$" + "opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$" + "noanim,class:^(xwaylandvideobridge)$" + "noinitialfocus,class:^(xwaylandvideobridge)$" + "maxsize 1 1,class:^(xwaylandvideobridge)$" + "noblur,class:^(xwaylandvideobridge)$" + "stayfocused,class:^(kompas.exe)$,title:^(RoamingWindow)$" + ]; + + layerrule = "blur, waybar"; + + bind = [ + "$mainMod, V, togglefloating, " + "$mainMod, P, pseudo," + "$mainMod, I, togglesplit," + "$mainMod, F, fullscreen, 0" + "$mainMod, M, fullscreen, 1" + "$mainMod SHIFT,F,fakefullscreen" + "$mainMod SHIFT, Q, killactive, " + "$mainMod SHIFT, E, exit," + + # Apps + "$mainMod, D, exec, killall rofi || rofi -show-icons -show drun" + "$mainMod, Q, exec, $terminal" + "$mainMod, B, exec, brave --enable-features=TouchpadOverscrollHistoryNavigation" + "$mainMod, T, exec, telegram-desktop" + "$mainMod, E, exec, emacsclient -c -a emacs" + "$mainMod CONTROL, E, exec, emacs" + + # Screenshooting + ", Print, exec, grimblast save screen" + "ALT, Print, exec, grimblast save active" + "SHIFT, Print, exec, grimblast save area" + "CONTROL, Print, exec, grimblast copy screen" + "ALT_CONTROL, Print, exec, grimblast copy active" + "CONTROL_SHIFT, Print, exec, grimblast copy area " + + # Volume + ",0x1008FF11,exec,wpctl set-volume @DEFAULT_SINK@ 5%-" + ",0x1008FF13,exec,wpctl set-volume @DEFAULT_SINK@ 5%+" + ",0x1008FF12,exec,wpctl set-mute @DEFAULT_SINK@ toggle" + ",XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_SOURCE@ toggle" + + # Brightness + ",XF86MonBrightnessUp,exec,brightnessctl s +5%" + ",XF86MonBrightnessDown,exec,brightnessctl s 5%-" + + # Windows + "$mainMod, J, movefocus, d" + "$mainMod, K, movefocus, u" + "$mainMod, H, movefocus, l" + "$mainMod, L, movefocus, r" + "SUPER_SHIFT,J,movewindow,d" + "SUPER_SHIFT,K,movewindow,u" + "SUPER_SHIFT,H,movewindow,l" + "SUPER_SHIFT,L,movewindow,r" + "$mainMod, S, togglespecialworkspace, magic" + "$mainMod SHIFT, S, movetoworkspace, special:magic" + "$mainMod, mouse_down, workspace, e+1" + "$mainMod, mouse_up, workspace, e-1" + ] ++ ( + # workspaces + # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} + builtins.concatLists (builtins.genList ( + x: let + ws = let + c = (x + 1) / 10; + in + builtins.toString (x + 1 - (c * 10)); + in [ + "$mainMod, ${ws}, workspace, ${toString (x + 1)}" + "$mainMod SHIFT, ${ws}, movetoworkspacesilent, ${toString (x + 1)}" + ] + ) + 10) + ); + + bindm = [ + "$mainMod, mouse:272, movewindow" + "$mainMod, mouse:273, resizewindow" + ]; + }; }; programs.swaylock = { diff --git a/home-manager/laptop/hyprland/hyprland.conf b/home-manager/laptop/hyprland/hyprland.conf index e60503a..1ac9473 100644 --- a/home-manager/laptop/hyprland/hyprland.conf +++ b/home-manager/laptop/hyprland/hyprland.conf @@ -96,9 +96,7 @@ misc { # Example windowrule v2 # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more -windowrulev2 = nomaximizerequest, class:.* # You'll probably like this. windowrulev2 = float, title:^(Firrfox — Sharing Indicator)$ -windowrulev2 = nofullscreenrequest, title:^(Firefox — Sharing Indicator)$ windowrulev2 = noborder, title:^(Firefox — Sharing Indicator)$ windowrulev2 = rounding 0, title:^(Firefox — Sharing Indicator)$ windowrulev2 = float, title:^(firefox)$, title:^(Picture-in-Picture)$ @@ -114,6 +112,8 @@ windowrulev2 = maxsize 1 1,class:^(xwaylandvideobridge)$ windowrulev2 = noblur,class:^(xwaylandvideobridge)$ layerrule = blur, waybar +windowrulev2 = stayfocused,class:^(kompas.exe)$,title:^(RoamingWindow)$ + # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER |
