From 97241f63cf56ec51f9b993956e842d770e90937f Mon Sep 17 00:00:00 2001 From: Evan Reichard Date: Thu, 10 Apr 2025 11:41:47 -0400 Subject: [PATCH] swww --- .../default.nix | 1 + .../config/ghostty-catppuccin-macchiato.conf | 23 ++++++ .../config/ghostty-catppuccin-mocha.conf | 23 ++++++ .../ghostty/config/ghostty-melange-dark.conf | 21 ++++++ .../wms/hyprland/config/hyprland.conf | 2 +- .../graphical/wms/hyprland/default.nix | 3 +- modules/home/services/swww/default.nix | 73 +++++++++++++++++++ 7 files changed, 143 insertions(+), 3 deletions(-) create mode 100644 modules/home/programs/graphical/ghostty/config/ghostty-catppuccin-macchiato.conf create mode 100644 modules/home/programs/graphical/ghostty/config/ghostty-catppuccin-mocha.conf create mode 100644 modules/home/programs/graphical/ghostty/config/ghostty-melange-dark.conf create mode 100644 modules/home/services/swww/default.nix diff --git a/homes/aarch64-linux/evanreichard@lin-va-mbp-personal/default.nix b/homes/aarch64-linux/evanreichard@lin-va-mbp-personal/default.nix index cb14879..914a987 100755 --- a/homes/aarch64-linux/evanreichard@lin-va-mbp-personal/default.nix +++ b/homes/aarch64-linux/evanreichard@lin-va-mbp-personal/default.nix @@ -14,6 +14,7 @@ in services = { ssh-agent = enabled; fusuma = enabled; + swww = enabled; sops = { enable = true; defaultSopsFile = lib.snowfall.fs.get-file "secrets/default.yaml"; diff --git a/modules/home/programs/graphical/ghostty/config/ghostty-catppuccin-macchiato.conf b/modules/home/programs/graphical/ghostty/config/ghostty-catppuccin-macchiato.conf new file mode 100644 index 0000000..bfda76d --- /dev/null +++ b/modules/home/programs/graphical/ghostty/config/ghostty-catppuccin-macchiato.conf @@ -0,0 +1,23 @@ +# https://github.com/catppuccin/ghostty/blob/main/themes/catppuccin-macchiato.conf +palette = 0=#494d64 +palette = 1=#ed8796 +palette = 2=#a6da95 +palette = 3=#eed49f +palette = 4=#8aadf4 +palette = 5=#f5bde6 +palette = 6=#8bd5ca +palette = 7=#b8c0e0 +palette = 8=#5b6078 +palette = 9=#ed8796 +palette = 10=#a6da95 +palette = 11=#eed49f +palette = 12=#8aadf4 +palette = 13=#f5bde6 +palette = 14=#8bd5ca +palette = 15=#a5adcb +background = 24273a +foreground = cad3f5 +cursor-color = f4dbd6 +cursor-text = 24273a +selection-background = 3a3e53 +selection-foreground = cad3f5 diff --git a/modules/home/programs/graphical/ghostty/config/ghostty-catppuccin-mocha.conf b/modules/home/programs/graphical/ghostty/config/ghostty-catppuccin-mocha.conf new file mode 100644 index 0000000..5eb849d --- /dev/null +++ b/modules/home/programs/graphical/ghostty/config/ghostty-catppuccin-mocha.conf @@ -0,0 +1,23 @@ +# https://github.com/catppuccin/ghostty/blob/main/themes/catppuccin-mocha.conf +palette = 0=#45475a +palette = 1=#f38ba8 +palette = 2=#a6e3a1 +palette = 3=#f9e2af +palette = 4=#89b4fa +palette = 5=#f5c2e7 +palette = 6=#94e2d5 +palette = 7=#bac2de +palette = 8=#585b70 +palette = 9=#f38ba8 +palette = 10=#a6e3a1 +palette = 11=#f9e2af +palette = 12=#89b4fa +palette = 13=#f5c2e7 +palette = 14=#94e2d5 +palette = 15=#a6adc8 +background = 1e1e2e +foreground = cdd6f4 +cursor-color = f5e0dc +cursor-text = 1e1e2e +selection-background = 353749 +selection-foreground = cdd6f4 diff --git a/modules/home/programs/graphical/ghostty/config/ghostty-melange-dark.conf b/modules/home/programs/graphical/ghostty/config/ghostty-melange-dark.conf new file mode 100644 index 0000000..caf4915 --- /dev/null +++ b/modules/home/programs/graphical/ghostty/config/ghostty-melange-dark.conf @@ -0,0 +1,21 @@ +# Melange Dark - Adapted From: https://github.com/savq/melange-nvim/blob/master/term/kitty/melange_dark.conf +palette = 0=#34302C +palette = 1=#BD8183 +palette = 2=#78997A +palette = 3=#E49B5D +palette = 4=#7F91B2 +palette = 5=#B380B0 +palette = 6=#7B9695 +palette = 7=#C1A78E +palette = 8=#867462 +palette = 9=#D47766 +palette = 10=#85B695 +palette = 11=#EBC06D +palette = 12=#A3A9CE +palette = 13=#CF9BC2 +palette = 14=#89B3B6 +palette = 15=#ECE1D7 +background = 292522 +foreground = ECE1D7 +selection-background = 403A36 +selection-foreground = ECE1D7 diff --git a/modules/home/programs/graphical/wms/hyprland/config/hyprland.conf b/modules/home/programs/graphical/wms/hyprland/config/hyprland.conf index 9cb9c1d..28131fa 100755 --- a/modules/home/programs/graphical/wms/hyprland/config/hyprland.conf +++ b/modules/home/programs/graphical/wms/hyprland/config/hyprland.conf @@ -3,7 +3,7 @@ ################ # See https://wiki.hyprland.org/Configuring/Monitors/ -monitor=,highres,auto,1.68 # 2 +monitor=,highres,auto,2 # 1.68 debug:disable_scale_checks = true ################### diff --git a/modules/home/programs/graphical/wms/hyprland/default.nix b/modules/home/programs/graphical/wms/hyprland/default.nix index b6caf60..f118378 100755 --- a/modules/home/programs/graphical/wms/hyprland/default.nix +++ b/modules/home/programs/graphical/wms/hyprland/default.nix @@ -12,7 +12,6 @@ in config = mkIf cfg.enable { services.swaync = enabled; - services.hyprpaper = enabled; wayland.windowManager.hyprland = { enable = true; @@ -176,10 +175,10 @@ in }; home.packages = with pkgs; [ + brightnessctl hyprshot wofi wofi-emoji - brightnessctl ]; xdg.configFile = { diff --git a/modules/home/services/swww/default.nix b/modules/home/services/swww/default.nix new file mode 100644 index 0000000..5c0a075 --- /dev/null +++ b/modules/home/services/swww/default.nix @@ -0,0 +1,73 @@ +{ config, lib, pkgs, namespace, ... }: +let + cfg = config.${namespace}.services.swww; +in +{ + options.${namespace}.services.swww = { + enable = lib.mkEnableOption "swww wallpaper service"; + }; + + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ + swww + ]; + + systemd.user = { + services = { + swww-daemon = { + Unit = { + Description = "SWWW Wallpaper Daemon"; + After = [ "graphical-session.target" ]; + }; + + Install = { + WantedBy = [ "graphical-session.target" ]; + }; + + Service = { + Type = "simple"; + ExecStart = "${pkgs.swww}/bin/swww-daemon"; + Restart = "on-failure"; + RestartSec = 5; + }; + }; + + change-wallpaper = { + Unit = { + Description = "SWWW Wallpaper Changer"; + After = [ "swww-daemon.service" ]; + Requires = [ "swww-daemon.service" ]; + }; + + Install = { + WantedBy = [ "swww-daemon.service" ]; + }; + + Service = { + Type = "oneshot"; + ExecStart = "${pkgs.writeShellScript "change-wallpaper-script" '' + WALLPAPER=$(${pkgs.findutils}/bin/find $HOME/Wallpapers -type f | ${pkgs.coreutils}/bin/shuf -n 1) + ${pkgs.swww}/bin/swww img "$WALLPAPER" --transition-type random + ''}"; + }; + }; + }; + + timers.swww-schedule = { + Unit = { + Description = "SWWW Wallpaper Schedule"; + }; + + Install = { + WantedBy = [ "timers.target" ]; + }; + + Timer = { + OnBootSec = "1min"; + OnUnitActiveSec = "1h"; + Unit = "change-wallpaper.service"; + }; + }; + }; + }; +}