diff --git a/home/common/desktop/default.nix b/home/common/desktop/default.nix index ea08710..7f87055 100644 --- a/home/common/desktop/default.nix +++ b/home/common/desktop/default.nix @@ -5,6 +5,7 @@ ./kitty.nix ./gtk.nix ./mako.nix + ./wofi.nix ]; home.packages = with pkgs; [ diff --git a/home/common/desktop/wofi.nix b/home/common/desktop/wofi.nix new file mode 100644 index 0000000..f58cdf4 --- /dev/null +++ b/home/common/desktop/wofi.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: { + programs.wofi = { + enable = true; + settings = { + allow_images = true; + insensitive = true; + run-always_parse_args = true; + run-cache_file = "/dev/null"; + run-exec_search = true; + matching = "multi-contains"; + }; + style = '' + #window { + box-shadow: 5px 5px 5px black; + } + ''; + }; +} diff --git a/home/desktop/hyprland/default.nix b/home/desktop/hyprland/default.nix index 466f6e8..234c699 100644 --- a/home/desktop/hyprland/default.nix +++ b/home/desktop/hyprland/default.nix @@ -4,6 +4,10 @@ ../../common/desktop ]; + home.packages = with pkgs; [ + grimblast + ]; + wayland.windowManager.hyprland = { enable = true; systemd = { @@ -17,9 +21,6 @@ border_size = 2; }; cursor.inactive_timeout = 4; - animations = { - enabled = true; - }; device = [ { @@ -28,8 +29,76 @@ } ]; + dwindle = { + split_width_multiplier = 1.35; + pseudotile = true; + }; + + layerrule = [ + "animation fade,hyprpicker" + "animation fade,selection" + "blur,^(wofi)$" + "ignorezero,^(wofi)$" + ]; + + decoration = { + active_opacity = 1.0; + inactive_opacity = 0.85; + fullscreen_opacity = 1.0; + rounding = 7; + blur = { + enabled = true; + size = 4; + passes = 3; + new_optimizations = true; + ignore_opacity = true; + popups = true; + }; + drop_shadow = true; + shadow_range = 12; + shadow_offset = "3 3"; + }; + + animations = { + enabled = true; + bezier = [ + "easein,0.1, 0, 0.5, 0" + "easeinback,0.35, 0, 0.95, -0.3" + + "easeout,0.5, 1, 0.9, 1" + "easeoutback,0.35, 1.35, 0.65, 1" + + "easeinout,0.45, 0, 0.55, 1" + ]; + + animation = [ + "fadeIn,1,3,easeout" + "fadeLayersIn,1,3,easeoutback" + "layersIn,1,3,easeoutback,slide" + "windowsIn,1,3,easeoutback,slide" + + "fadeLayersOut,1,3,easeinback" + "fadeOut,1,3,easein" + "layersOut,1,3,easeinback,slide" + "windowsOut,1,3,easeinback,slide" + + "border,1,3,easeout" + "fadeDim,1,3,easeinout" + "fadeShadow,1,3,easeinout" + "fadeSwitch,1,3,easeinout" + "windowsMove,1,3,easeoutback" + "workspaces,1,2.6,easeoutback,slide" + ]; + }; + + bindm = [ + "SUPER,mouse:272,movewindow" + "SUPER,mouse:273,resizewindow" + ]; + bind = let terminal = "${pkgs.kitty}/bin/kitty"; + grimblast = lib.getExe pkgs.grimblast; workspaces = [ "1" "2" @@ -56,7 +125,7 @@ "SUPER,s,togglesplit" # horizontal split "SUPER,f,fullscreen,1" # borderless window "SUPERSHIFT,f,fullscreen,0" # proper fullscreen - "SUPERSHIFT,space,togglefloating" # floating window + "ALTSHIFT,space,togglefloating" # floating window "SUPER,minus,splitratio,-0.25" # split gets slightly smaller "SUPERSHIFT,minus,splitratio,-0.3333333" # split gets smaller @@ -73,6 +142,9 @@ "SUPER,u,togglespecialworkspace" # toggle special workspace "SUPERSHIFT,u,movetoworkspacesilent,special" # move to special workspace + + ",Print,exec,${grimblast} --notify --freeze copy area" # screenshot area + "SHIFT,Print,exec,${grimblast} --notify --freeze copy output" # screenshot all ] ++ # change workspace @@ -88,7 +160,18 @@ (lib.mapAttrsToList (key: direction: "SUPERSHIFT,${key},swapwindow,${direction}") directions) ++ # move windows - (lib.mapAttrsToList (key: direction: "SUPERCONTROL,${key},movewindoworgroup,${direction}") directions); + (lib.mapAttrsToList (key: direction: "SUPERCONTROL,${key},movewindoworgroup,${direction}") directions) + ++ + # launcher + ( + let + wofi = lib.getExe pkgs.wofi; + in + lib.optionals config.programs.wofi.enable [ + "SUPER,Space,exec,${wofi} -S drun -W 25% -H 50%" + "SHIFTSUPER,Space,exec,${wofi} -S run" + ] + ); monitor = map ( m: "${m.name},${ diff --git a/home/global.nix b/home/global.nix index b979e59..0b8ca01 100644 --- a/home/global.nix +++ b/home/global.nix @@ -15,7 +15,7 @@ }; nix = { - package = lib.mkDefault pkgs.nix; + package = lib.mkDefault pkgs.nixVersions.nix_2_22; settings = { experimental-features = ["nix-command" "flakes"]; warn-dirty = false; @@ -57,5 +57,6 @@ package = pkgs.nerdfonts.override { fonts = ["JetBrainsMono"]; }; }; }; + targets.wofi.enable = false; }; }