diff --git a/hosts/ymir/configuration.nix b/hosts/ymir/configuration.nix index 2e33630..42cff99 100644 --- a/hosts/ymir/configuration.nix +++ b/hosts/ymir/configuration.nix @@ -104,10 +104,10 @@ # Enable light for image control programs.light.enable = true; - programs.river = { - enable = true; - extraPackages = []; - }; + # programs.river = { + # enable = true; + # extraPackages = []; + # }; # Define a user account. Don't forget to set a password with ‘passwd’. users.users.crony = { @@ -139,6 +139,7 @@ crony.secrets.enable = true; crony.ryzenadj.enable = true; crony.auto-cpufreq.enable = true; + crony.hyprland-nixos.enable = true; xdg.portal = { enable = true; diff --git a/hosts/ymir/home.nix b/hosts/ymir/home.nix index a8aa349..dbb048d 100644 --- a/hosts/ymir/home.nix +++ b/hosts/ymir/home.nix @@ -30,7 +30,8 @@ crony.gaming.enable = true; crony.flatpak.enable = true; crony.wayland.enable = true; - crony.river.enable = true; + crony.river.enable = false; + crony.hyprland.enable = true; # DO NOT CHANGE ALSO home.stateVersion = "24.11"; # Please read the comment before changing. diff --git a/modules/linux/home-manager/hyprland.nix b/modules/linux/home-manager/hyprland.nix index a8829a7..130bba7 100644 --- a/modules/linux/home-manager/hyprland.nix +++ b/modules/linux/home-manager/hyprland.nix @@ -78,6 +78,38 @@ in { }; config = lib.mkIf config.crony.hyprland.enable { + # Enable hyprpaper + services.hyprpaper.enable = true; + + # Enable hypridle + services.hypridle = { + enable = true; + settings = { + general = { + lock_cmd = "pidof hyprlock || hyprlock"; # avoid starting multiple hyprlock instances. + before_sleep_cmd = "loginctl lock-session"; # lock before suspend. + after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display. + }; + + listener = [ + { + timeout = 10; # 10 sec + on-timeout = "pidof hyprlock && hyprctl dispatch dpms off"; # Turn off screen if hyprlock is running + on-resume = "hyprctl dispatch dpms on"; # Turn on screen when activiy is detected after timeout has fired + } + { + timeout = 300; # 5min + on-timeout = "loginctl lock-session"; # lock screen when timeout has passed + } + { + timeout = 310; # 5min and 10 sec + on-timeout = "hyprctl dispatch dpms off"; # Turn off screen if hyprlock is running + on-resume = "hyprctl dispatch dpms on"; # Turn on screen when activiy is detected after timeout has fired + } + ]; + }; + }; + # Setup and enable hyprland wayland.windowManager.hyprland = { enable = true; @@ -95,10 +127,10 @@ in { ]; exec-once = [ + "waybar" # Start waybar on start "wl-paste --type text --watch cliphist store" # Stores only text data "wl-paste --type image --watch cliphist store" # Stores only image data "keepassxc" # Startup my password manager - "waybar" # Start waybar on start ]; monitor = [ @@ -107,25 +139,25 @@ in { ]; animations = { - enabled = "yes"; + enabled = false; }; decoration = { blur = { - enabled = true; + enabled = false; }; shadow = { - enabled = true; + enabled = false; }; - rounding = 10; + rounding = 0; }; general = { - border_size = 3; - gaps_in = 5; - gaps_out = 10; + border_size = 1; + gaps_in = 3; + gaps_out = 6; layout = "master"; allow_tearing = true; }; diff --git a/modules/linux/home-manager/river.nix b/modules/linux/home-manager/river.nix index b047dd5..e5c3efb 100644 --- a/modules/linux/home-manager/river.nix +++ b/modules/linux/home-manager/river.nix @@ -51,8 +51,28 @@ in { playerctl grim libnotify + wlopm ]; + services.way-displays = { + enable = true; + settings = { + SCALING = false; + DISABLED = [ + { + NAME_DESC = "eDP-1"; + IF = [ + { + PLUGGED = [ + "HDMI-A-1" + ]; + } + ]; + } + ]; + }; + }; + wayland.windowManager.river = { enable = true; settings = { diff --git a/modules/linux/home-manager/wayland.nix b/modules/linux/home-manager/wayland.nix index f4056b2..e4b9e9b 100644 --- a/modules/linux/home-manager/wayland.nix +++ b/modules/linux/home-manager/wayland.nix @@ -52,36 +52,15 @@ }; }; - # Enable hyprpaper - services.hyprpaper.enable = true; - - # Enable hypridle - services.hypridle = { + services.swayidle = { enable = true; - settings = { - general = { - lock_cmd = "pidof hyprlock || hyprlock"; # avoid starting multiple hyprlock instances. - before_sleep_cmd = "loginctl lock-session"; # lock before suspend. - after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display. - }; - - listener = [ - { - timeout = 10; # 10 sec - on-timeout = "pidof hyprlock && hyprctl dispatch dpms off"; # Turn off screen if hyprlock is running - on-resume = "hyprctl dispatch dpms on"; # Turn on screen when activiy is detected after timeout has fired - } - { - timeout = 300; # 5min - on-timeout = "loginctl lock-session"; # lock screen when timeout has passed - } - { - timeout = 310; # 5min and 10 sec - on-timeout = "hyprctl dispatch dpms off"; # Turn off screen if hyprlock is running - on-resume = "hyprctl dispatch dpms on"; # Turn on screen when activiy is detected after timeout has fired - } - ]; - }; + timeouts = [ + { + timeout = 10; + command = "pidof hyprlock && ${pkgs.wlopm}/bin/wlopm --off '*'"; + resumeCommand = "${pkgs.wlopm}/bin/wlopm --on '*'"; + } + ]; }; # Enable hyprlock @@ -137,21 +116,25 @@ padding-left: 10px; } - #tags { + #workspaces { background-color: @base01; margin: 0.25em; border-radius: 1em; } - #tags button { + #workspaces button { padding: 0 0.5em; - color: @base03; - } - - #tags button.occupied { color: @base06; } - #tags button.focused { + #workspaces button.empty { + color: @base03; + } + + #workspaces button.visible { + color: @base06; + } + + #workspaces button.active { color: @base0D; } @@ -185,8 +168,8 @@ mainBar = { height = 34; modules-left = [ - "river/tags" - "river/window" + "hyprland/workspaces" + "hyprland/window" ]; modules-center = [ ]; @@ -199,8 +182,10 @@ "clock" "tray" ]; - "river/window" = { - max-length = 50; + "hyprland/workspaces" = { + persistent-workspaces = { + "*" = [1 2 3 4 5 6 7 8 9]; + }; }; disk = { path = "/";