0

All I want to do is create a shell script that runs in the background. It turns on when I log in/on boot up.

Every hour it checks the time for 9:00 pm, (if you can figure out sun sets and rises that would be great), if it is past it switches the background.

Then it changes the back if it is past 9:00 pm. But past 7:00 am it would turn that background off.

Basically just switching between 2 backgrounds. How can I do this?

Prolight
  • 101

1 Answers1

0

Automatically change Ubuntu wallpaper at a certain hour

But with this script instead:

#!/bin/bash -e
user=$(whoami)

fl=$(find /proc -maxdepth 2 -user "$user" -name environ -print -quit)
for i in {1..5}
do
  fl=$(find /proc -maxdepth 2 -user "$user" -name environ -newer "$fl" -print -quit)
done

export DBUS_SESSION_BUS_ADDRESS
DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS "$fl" | cut -d= -f2-)

IMG=$1
gsettings set org.gnome.desktop.background picture-uri "'file://${IMG}'"



Prolight
  • 101