Closed JohnCosta27 closed 1 year ago
Same issue here. Whereas it seems you're Arch based, I'm on Pop!_OS and tried creating an executable under /lib/systemd/system-sleep. For Arch users, I believe it'd be /usr/lib/pm-utils/sleep.d. The script does run on suspend/wake but the wallpaper does not run unless manually run after logging in. I've seen some have better luck with adding a line to their WM start script but that seems "hacky" and a standalone script to handle the update seems more stable, safer for the layperson (like me), and easier to update.
I used a systemd service, and it works quite well. I use Ubuntu, but it should work on any systemd system. I used this guide as reference.
I started by creating a bash script to run dwall set_dwall.sh
, using the same environmental variables that I used in my crontab:
#!/bin/bash
env PATH=/usr/local/bin:/usr/bin DISPLAY=:0 DESKTOP_SESSION=Openbox DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus" /usr/bin/dwall -s firewatch #switch out firewatch for wallpaper you want
Don't forget to add permissions:
chmod +x /path/to/set_dwall.sh
From there, I created a systemd service, called /etc/systemd/system/dwall.service
and it it, I made it like this, adding in my username and the env vars used in the crontab:
[Unit]
Description=Run set_dwall.sh
After=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target
[Service]
ExecStart=/path/to/set_dwall.sh
User=my_user_name
Environment=All_vars_used_in crontab
[Install]
WantedBy=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target
After that, I did a
sudo systemctl enable dwall
sudo systemctl start dwall
and then
sudo systemctl status dwall
to check if everything was running fine. After suspending, and then resuming, it only takes a second before the wallpaper is updated to the one you want
Is the issue solved ??
Yes, that did the trick!
Message ID: @.***>
It's quite complicated with a systemd service. The readme mentions a @reboot
cronjob but that didn't work for me so I just added the command at the end of my ~/.profile
:
# Dynamic Wallpaper
env ... (all the variables here) dwall -s (the wallpaper set you want here)
Updated the readme.
@adi1090x bashrc file is not the right place for this. it's .profile. .bashrc will be executed on ssh logins as well.
Hi,
I find that the program works fine when changing the wallpaper every hour, but whenever I turn the computer on the wallpaper remains the same as it was when it turned off. This can be fixed manually by running "dwall -s" but I can't seem to do it automatically.
Here is system information.