1
1
Fork 0

wallpaper: convert to systemd service

This commit is contained in:
Myned 2025-04-05 19:07:14 -05:00
parent 4af7963adf
commit 3b75df4b94
Signed by: myned
GPG key ID: C7224454F7881A34
7 changed files with 42 additions and 16 deletions
options/custom
profiles/desktop

View file

@ -39,7 +39,6 @@ in {
lockscreen = mkOption {default = "hyprlock";};
menu = mkOption {default = "rofi";};
wallpaper = mkOption {default = false;};
browser = {
# TODO: Use lib.getExe' instead of /bin/ where possible

View file

@ -105,9 +105,6 @@ in {
"[workspace special:hidden silent] ${command loupe}"
"[workspace special:hidden silent] ${command nautilus}"
]
++ optionals config.custom.wallpaper [
(command wallpaper)
]
++ optionals config.custom.settings.vm.passthrough.blacklist [
# HACK: Delay driver initialization to work around reset issues
(command "${virsh} list | ${grep} ${config.custom.settings.vm.passthrough.guest} || sudo ${modprobe} ${config.custom.settings.vm.passthrough.driver}")

View file

@ -52,15 +52,11 @@ in {
#!! Not executed in a shell
# https://github.com/YaLTeR/niri/wiki/Configuration:-Key-Bindings#spawn
# https://github.com/sodiboo/niri-flake/blob/main/docs.md#programsnirisettingsspawn-at-startup
spawn-at-startup =
[
{command = [audio "--init"];} # Enforce audio profile state
{command = [config.custom.menus.clipboard.clear-silent];} # Clear clipboard history
{command = [sway-audio-idle-inhibit];} # Inhibit while audio is playing
]
++ optionals config.custom.wallpaper [
{command = [wallpaper];}
];
spawn-at-startup = [
{command = [audio "--init"];} # Enforce audio profile state
{command = [config.custom.menus.clipboard.clear-silent];} # Clear clipboard history
{command = [sway-audio-idle-inhibit];} # Inhibit while audio is playing
];
# https://github.com/sodiboo/niri-flake/blob/main/docs.md#programsnirisettingsswitch-eventslid-close
switch-events = {

View file

@ -41,7 +41,7 @@ in {
background = {
blur_passes = 5;
color = "rgb(073642)"; # Fallback
path = mkIf config.custom.wallpaper "/tmp/wallpaper.png";
path = mkIf config.custom.services.wallpaper.enable "/tmp/wallpaper.png";
};
# https://wiki.hyprland.org/Hypr-Ecosystem/hyprlock/#input-field

View file

@ -32,7 +32,7 @@ in {
indicator-radius = 150;
font-size = 48 * config.custom.scale;
font = config.stylix.fonts.monospace.name;
image = mkIf config.custom.wallpaper "/tmp/altered.png";
image = mkIf config.custom.services.wallpaper.enable "/tmp/altered.png";
bs-hl-color = "93a1a1";
color = "073642";
inside-caps-lock-color = "002b36";

View file

@ -0,0 +1,34 @@
{
config,
lib,
...
}:
with lib; let
cfg = config.custom.services.wallpaper;
hm = config.home-manager.users.${config.custom.username};
in {
options.custom.services.wallpaper = {
enable = mkEnableOption "wallpaper";
};
config = mkIf cfg.enable {
home-manager.sharedModules = [
{
systemd.user.services.wallpaper = {
Unit = {
Description = "Periodically change wallpaper";
};
Install = {
WantedBy = ["default.target"];
};
Service = {
Type = "simple";
ExecStart = hm.home.file.".local/bin/wallpaper".source;
};
};
}
];
};
}

View file

@ -3,11 +3,11 @@
full = true;
profile = "desktop";
desktop = "niri";
wallpaper = true;
services = {
ollama.download = "high";
power-profiles-daemon.enable = true;
wallpaper.enable = true;
};
};
}