diff --git a/home/modules/desktop/environments/hyprland.nix b/home/modules/desktop/environments/hyprland.nix index b650c8e..16065a9 100644 --- a/home/modules/desktop/environments/hyprland.nix +++ b/home/modules/desktop/environments/hyprland.nix @@ -16,6 +16,7 @@ exec-once = [ "hyprctl setcursor 24" "clipse -listen" + "xwaylandvideobridge &" ]; monitor = [ @@ -31,6 +32,8 @@ "$mod, X, exec, kitty --class clipse -e 'clipse'" ", Print, exec, grim -g \"$(slurp)\" - | wl-copy" "$mod, Print, exec, grim - | wl-copy" + "$mod, Z, exec, hyprpicker | wl-copy" + "$mod, L, exec, hyprlock" "$mod, 1, workspace, 1" "$mod, 2, workspace, 2" @@ -78,11 +81,21 @@ windowrulev2 = [ "float,class:(clipse)" "size 622 652,class:(clipse)" + + # Fix XWayland Screensharing + "opacity 0.0 override, class:^(xwaylandvideobridge)$" + "noanim, class:^(xwaylandvideobridge)$" + "noinitialfocus, class:^(xwaylandvideobridge)$" + "maxsize 1 1, class:^(xwaylandvideobridge)$" + "noblur, class:^(xwaylandvideobridge)$" + "nofocus, class:^(xwaylandvideobridge)$" ]; general = { - border_size = 1; + border_size = 2; gaps_out = "0, 8, 8, 8"; + "col.active_border" = "$pink"; + "col.inactive_border" = "$surface2"; }; dwindle = { @@ -208,22 +221,24 @@ font-family: "SF ProDisplay Nerd Font"; border: none; border-radius: 0; + color: @text; } window#waybar { border-radius: 10px; + background-color: @base } .modules-right { - background-color: #313244; + background-color: @surface0; border-radius: 5px; margin: 5px; padding: 5px; } tooltip { - background-color: #1e1e2e; - border: 1px solid #f5c2e7; + background-color: @base; + border: 1px solid @pink; border-radius: 10px; } @@ -239,7 +254,7 @@ #custom-separator { padding-left: 2px; padding-right: 2px; - color: #a6adc8; + color: @subtext0; } #workspaces { @@ -248,10 +263,10 @@ } #workspaces button { - background-color: #313244; + background-color: @surface0; border-bottom-style: solid; - border-color: #000000; + border-color: @crust; border-width: 3px; } @@ -261,13 +276,13 @@ #workspaces button.active { border-bottom-style: solid; - border-color: white; + border-color: @overlay2; border-width: 3px; } #workspaces button.urgent { border-bottom-style: solid; - border-color: red; + border-color: @red; border-width: 3px; } @@ -284,15 +299,15 @@ margin-bottom: 5px; padding: 5px; border-radius: 5px; - background-color: #313244; + background-color: @surface0; } #battery.warning { - color: #f9e2af; + color: @yellow; } #battery.critical { - color: #f38ba8; + color: @red; } ''; }; @@ -340,8 +355,119 @@ ]; }; - programs.hyprlock.enable = true; - # services.hypridle.enable = true; + programs.hyprlock = { + enable = true; + settings = { + "$font" = "SF ProDisplay Nerd Font"; + + general = { + hide_cursor = true; + }; + + background = [ + { + monitor = ""; + path = "color"; + blur_passes = 0; + color = "$base"; + } + ]; + + label = [ + { + monitor = ""; + text = "Layout: $LAYOUT"; + color = "$text"; + font_size = 25; + font_family = "$font"; + position = "30, -30"; + halign = "left"; + valign = "top"; + } + { + monitor = ""; + text = "$TIME"; + color = "$text"; + font_size = 90; + font_family = "$font"; + position = "-30, 0"; + halign = "right"; + valign = "top"; + } + { + monitor = ""; + text = "cmd[update:43200000] date +\"%A, %d %B %Y\""; + color = "$text"; + font_size = 25; + font_family = "$font"; + position = "-30, -150"; + halign = "right"; + valign = "top"; + } + ]; + + input-field = [ + { + monitor = ""; + size = "300, 60"; + outline_thickness = 4; + dots_size = 0.2; + dots_spacing = 0.2; + dots_center = true; + outer_color = "$accent"; + inner_color = "$surface0"; + font_color = "$text"; + fade_on_empty = false; + placeholder_text = "󰌾 Logged in as $USER"; + hide_input = false; + check_color = "$accent"; + fail_color = "$red"; + fail_text = "$FAIL ($ATTEMPTS)"; + capslock_color = "$yellow"; + position = "0, -47"; + halign = "center"; + valign = "center"; + } + ]; + }; + }; + + services.hypridle = { + enable = true; + settings = { + general = { + lock_cmd = "pidof hyprlock || hyprlock"; + before_sleep_cmd = "loginctl lock-session"; + after_sleep_cmd = "hyprctl dispatch dpms on"; + }; + + listener = [ + { + timeout = 150; + on-timeout = "brightnessctl -s set 10"; + on-resume = "brightnessctl -r"; + } + { + timeout = 150; + on-timeout = "brightnessctl -sd rgb:kbd_backlight set 0"; + on-resume = "brightnessctl -rd rgb:kbd_backlight"; + } + { + timeout = 300; + on-timeout = "loginctl lock-session"; + } + { + timeout = 330; + on-timeout = "hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + { + timeout = 1800; + on-timeout = "systemctl suspend"; + } + ]; + }; + }; services.mako = { enable = true; @@ -558,12 +684,17 @@ After = lib.mkForce ["graphical-session.target"]; }; }; + hypridle = { + Unit = { + After = lib.mkForce ["graphical-session.target"]; + }; + }; }; home.sessionVariables.NIXOS_OZONE_WL = "1"; home.packages = with pkgs; [ + # Hyprland hyprpicker - hyprsunset # Fonts inputs.apple-fonts.packages.${pkgs.system}.sf-pro-nerd @@ -581,5 +712,9 @@ # Clipboard wl-clipboard clipse + + # Utils + brightnessctl + xwaylandvideobridge ]; }