I’m trying to set a slideshow via home manager using variety. But it seems that systemd isnt picking up the executable:
{pkgs,config,...}:
{
systemd.user.services = {
wallpaper-slideshow = {
Unit = {
Description = "Sets up the wallpaper slideshow";
};
Install = {
# WantedBy = [ "multi-user.target" ];
WantedBy = [ "default.target" ];
};
Service = {
Type = "exec";
ExecStart = "${pkgs.writeShellApplication
{ name = "wallpaper-slideshow";
runtimeInputs = [pkgs.variety pkgs.libappindicator ];
text = builtins.readFile ./scripts/wallpaper.sh;}
}/bin/wallpaper-slideshow";
Restart = "no";
Environment = [
"BACKGROUNDS=${config.home.sessionVariables.BACKGROUNDS}"
];
};
};
};
}
The contents of wallpaper.sh
is as follows:
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p bash
while true
do
for filename in "$BACKGROUNDS"/*; do
echo "$filename"
variety --set "$filename"
sleep 10s
done
done
After switching, restarting the service, and doing systemctl --user status wallpaper-slideshow.service
I get the following logs:
dic 31 01:21:22 nixos systemd[1368]: Starting Sets up the wallpaper slideshow...
dic 31 01:21:22 nixos systemd[1368]: Started Sets up the wallpaper slideshow.
dic 31 01:21:22 nixos wallpaper-slideshow[63486]: /home/dan/.config/home-manager/rio/background_pics/cg01_07A.png
dic 31 01:21:23 nixos wallpaper-slideshow[63488]: WARNING: 2024-12-31 01:21:23,197: create_menu() 'Variety Slideshow is not installed. This is an optional extension adding pan-and-zoom slideshows to Variety: see https://github.>
dic 31 01:21:23 nixos .variety-wrappe[63488]: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
I checked that the output of writeShellApplication indeed appends the variety bin folder to the path variable. Moreover, the bash script generated also works if I execute it myself. Any idea of what might be happening?