feat(user/malte): hyprpaper systemd service

This commit is contained in:
Malte Tammena 2024-04-26 20:32:18 +02:00
parent 28b7457847
commit 445f625606

View file

@ -45,6 +45,18 @@
${pkgs.hyprland}/bin/hyprctl hyprpaper wallpaper ${monitor},${bg} ${pkgs.hyprland}/bin/hyprctl hyprpaper wallpaper ${monitor},${bg}
''; '';
hyprpaperSystemdService = {
Unit = {
Description = "Hyprland wallpaper daemon";
PartOf = ["graphical-session.target"];
};
Service = {
ExecStart = "${lib.getExe pkgs.hyprpaper}";
Restart = "on-failure";
};
Install.WantedBy = ["graphical-session.target"];
};
wobFifo = "~/.local/share/wob/fifo"; wobFifo = "~/.local/share/wob/fifo";
runWob = pkgs.writeShellApplication { runWob = pkgs.writeShellApplication {
name = "run-wob"; name = "run-wob";
@ -129,7 +141,6 @@
"$blue" = "458588"; "$blue" = "458588";
"$green" = "98971a"; "$green" = "98971a";
exec-once = [ exec-once = [
"${lib.getExe pkgs.hyprpaper}"
"${lib.getExe runWob}" "${lib.getExe runWob}"
"hyprctl setcursor ${config.home.pointerCursor.name} ${builtins.toString config.home.pointerCursor.size}" "hyprctl setcursor ${config.home.pointerCursor.name} ${builtins.toString config.home.pointerCursor.size}"
]; ];
@ -371,12 +382,12 @@
}; };
in { in {
imports = [ imports = [
./waybar.nix
./gtk.nix ./gtk.nix
./qt.nix
./pass.nix
./mako.nix
./kanshi.nix ./kanshi.nix
./mako.nix
./pass.nix
./qt.nix
./waybar.nix
]; ];
options.settings.hyprland = with lib; { options.settings.hyprland = with lib; {
@ -398,7 +409,6 @@ in {
home.packages = [ home.packages = [
pkgs.hyprpicker pkgs.hyprpicker
pkgs.grimblast pkgs.grimblast
pkgs.hyprpaper
]; ];
# If running from tty1 start hyprland # If running from tty1 start hyprland
@ -414,6 +424,7 @@ in {
# Configure wob # Configure wob
xdg.configFile."wob/wob.ini".text = wobConfig; xdg.configFile."wob/wob.ini".text = wobConfig;
systemd.user.services.hyprpaper = hyprpaperSystemdService;
services.darkman.lightModeScripts."hyprpaper" = builtins.concatStringsSep "\n" (lib.mapAttrsToList (monitor: config: mkHyprpaperSwitch monitor config.background.light) monitors); services.darkman.lightModeScripts."hyprpaper" = builtins.concatStringsSep "\n" (lib.mapAttrsToList (monitor: config: mkHyprpaperSwitch monitor config.background.light) monitors);
services.darkman.darkModeScripts."hyprpaper" = builtins.concatStringsSep "\n" (lib.mapAttrsToList (monitor: config: mkHyprpaperSwitch monitor config.background.dark) monitors); services.darkman.darkModeScripts."hyprpaper" = builtins.concatStringsSep "\n" (lib.mapAttrsToList (monitor: config: mkHyprpaperSwitch monitor config.background.dark) monitors);
}; };