{ lib, config, pkgs, ... }: let icons = fetchTarball { url = "https://files.huwe.mooo.com/waybar.tar.gz"; sha256 = "0h5r8r7vscm6yv25kgyzx5y325n5ri78n28vmdvgmysp351drm57"; }; in { home-manager.users.willifan = { home.packages = lib.mkIf config.desktop.utils.enable [ pkgs.hyprpicker pkgs.hyprcursor pkgs.grim pkgs.slurp pkgs.wl-clipboard pkgs.playerctl pkgs.dconf pkgs.papirus-icon-theme ]; programs.fuzzel = lib.mkIf config.desktop.fuzzel.enable { enable = true; settings = { main = { lines = 12; width = 45; line-height = 20; }; }; }; services.hyprpaper = lib.mkIf config.desktop.hyprpaper.enable { enable = true; settings = { splash = true; ipc = "off"; }; }; services.mako = lib.mkIf config.desktop.mako.enable { enable = true; borderRadius = 10; borderSize = 2; }; services.hypridle = lib.mkIf config.desktop.hypridle.enable { enable = true; settings = { general = { lock_cmd = "pidof hyprlock || hyprlock"; # avoid starting multiple hyprlock instances. before_sleep_cmd = "loginctl lock-session && sleep 2"; # 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 = 150; # 2.5min. # on-timeout = brightnessctl -s set 10; # set monitor backlight to minimum, avoid 0 on OLED monitor. # on-resume = brightnessctl -r; # monitor backlight restor. #} { timeout = 300; # 5min on-timeout = "loginctl lock-session"; # lock screen when timeout has passed } { timeout = 380; # 5.5min on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed on-resume = "hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired. } { timeout = 600; # 30min on-timeout = "systemctl suspend-then-hibernate"; # suspend pc } ]; }; }; programs.waybar = lib.mkIf config.desktop.waybar.enable { enable = true; settings = { mainBar = { layer = "top"; position = "top"; height = 25; output = [ "eDP-1" ]; modules-left = [ "clock" "mpris" ]; modules-center = [ "niri/workspaces" ]; modules-right = [ "tray" "group/ressources" "group/peripherals" "group/wireless" "group/power" ]; "group/ressources" = { orientation = "inherit"; modules = [ "group/cpu" "group/memory" ]; }; "group/peripherals" = { orientation = "inherit"; modules = [ "group/volume" "group/backlight" ]; }; "group/wireless" = { orientation = "inherit"; modules = [ "group/networking" "group/bluetooth" ]; }; "group/power" = { orientation = "inherit"; modules = [ "group/battery" "image#power" ]; }; "clock" = { interval = 1; format = "{:%H:%M:%S}"; }; "mpris" = { format = ""; format-playing = "{dynamic}"; dynamic-order = [ "title" "artist" "album" "position" "length" ]; dynamic-len = 30; }; "niri/workspaces" = { all-outputs = true; }; "group/cpu" = { orientation = "inherit"; modules = [ "image#cpu" "cpu" ]; }; "image#cpu" = { path = "${icons}/cpu.png"; size = 16; }; "cpu" = { format = "{usage}%"; }; "group/memory" = { orientation = "inherit"; modules = [ "image#memory" "memory" ]; }; "image#memory" = { path = "${icons}/ram.png"; size = 16; }; "memory" = { format = "{percentage}%"; }; "group/volume" = { orientation = "inherit"; modules = [ "image#volume" "wireplumber" ]; }; "image#volume" = { path = "${icons}/volume.png"; size = 16; }; "wireplumber" = { format = "{volume}%"; }; "group/backlight" = { orientation = "inherit"; modules = [ "image#backlight" "backlight" ]; }; "image#backlight" = { path = "${icons}/brightness.png"; size = 16; }; "backlight" = { format = "{percent}%"; }; "group/networking" = { orientation = "inherit"; modules = [ "image#networking" "network" ]; }; "image#networking" = { path = "${icons}/wifiHigh.png"; size = 16; }; "network" = { format = "{signalStrength}%"; }; "group/bluetooth" = { orientation = "inherit"; modules = [ "image#bluetooth" "bluetooth" ]; }; "image#bluetooth" = { path = "${icons}/bluetooth.png"; size = 16; }; "bluetooth" = { format = "{status}"; }; "group/battery" = { orientation = "inherit"; modules = [ "image#battery" "battery" ]; }; "image#battery" = { path = "${icons}/battery.png"; size = 16; }; "battery" = { format = "{capacity}%"; }; "image#power" = { path = "${icons}/power.png"; size = 16; }; }; }; systemd = { enable = true; }; }; programs.hyprlock = lib.mkIf config.desktop.hyprlock.enable { enable = true; settings = { background = { monitor = ""; # all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations blur_passes = 3; # 0 disables blurring blur_size = 7; noise = 0.0117; contrast = 0.8916; brightness = 0.8172; vibrancy = 0.1696; vibrancy_darkness = 0.0; }; input-field = { monitor = ""; size = "300, 75"; outline_thickness = 3; dots_size = 0.33; # Scale of input-field height, 0.2 - 0.8 dots_spacing = 0.15; # Scale of dots' absolute size, 0.0 - 1.0 dots_center = false; dots_rounding = -1; # -1 default circle, -2 follow input-field rounding fade_on_empty = true; fade_timeout = 1000; # Milliseconds before fade_on_empty is triggered. placeholder_text = "Input Password..."; # Text rendered in the input box when it's empty. hide_input = false; rounding = -1; # -1 means complete rounding (circle/oval) fail_text = "$FAIL ($ATTEMPTS)"; # can be set to empty fail_transition = 300; # transition time in ms between normal outer_color and fail_color capslock_color = -1; numlock_color = -1; bothlock_color = -1; # when both locks are active. -1 means don't change outer color (same for above) invert_numlock = false; # change color if numlock is off position = "0, -20"; halign = "center"; valign = "center"; }; label = { monitor = ""; text = "Hi there, $USER"; color = "rgba(200, 200, 200, 1.0)"; font_size = 25; font_family = "Noto Sans"; position = "0, 80"; halign = "center"; valign = "center"; }; }; }; programs.wlogout = lib.mkIf config.desktop.wlogout.enable { enable = true; layout = [ { label = "shutdown"; action = "systemctl poweroff"; text = "Shutdown"; } { label = "hyprland"; action = "hyprctl dispatch exit"; text = "Exit Hyprland"; } { label = "whatever"; action = ""; text = "whatever"; } { label = "reboot"; action = "systemctl reboot"; text = "Reboot"; } { label = "suspend"; action = "systemctl suspend"; text = "Suspend"; } { label = "hibernate"; action = "systemctl hibernate"; text = "Hibernate"; } ]; style = '' @import url("file:///home/willifan/.config/gtk-4.0/gtk.css"); * { background-image: none; box-shadow: none; } window { background-color: rgba(12, 12, 12, 0.9); } button { border-radius: 10px; border-color: #ffa44b; border-style: solid; border-width: 2px; background-repeat: no-repeat; background-position: center; background-size: 25%; } button:focus, button:active, button:hover { /*background-color: #3700B3;*/ outline-style: none; } #suspend { background-image: image(url("${icons}/suspend.png")); } #hibernate { background-image: image(url("${icons}/hibernate.png")); } #shutdown { background-image: image(url("${icons}/shutdown.png")); } #reboot { background-image: image(url("${icons}/reboot.png")); } ''; }; }; }