Added base
|
After Width: | Height: | Size: 965 KiB |
|
After Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 632 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 672 KiB |
|
After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 146 KiB |
|
After Width: | Height: | Size: 150 KiB |
@@ -0,0 +1,62 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
pwd=`pwd`
|
||||||
|
|
||||||
|
sep="--------------------------------------------------------------------------"
|
||||||
|
echo $sep
|
||||||
|
echo "*** 8bit Day Wallpaper Rotator for Linux ***"
|
||||||
|
echo "*** Rotator Script: http://www.reddit.com/u/javajames64 ***"
|
||||||
|
echo "*** Auto Installer: http://www.reddit.com/u/OhMrBigshot ***"
|
||||||
|
echo $sep
|
||||||
|
echo
|
||||||
|
|
||||||
|
|
||||||
|
echo "* Changing permissions... [1/2]"
|
||||||
|
chmod +x update.sh
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo "* Creating cron jobs... [2/2]"
|
||||||
|
echo
|
||||||
|
|
||||||
|
read -p "Create a cron job every hour? [y/n] " yn
|
||||||
|
case $yn in
|
||||||
|
[Yy]*)
|
||||||
|
line="0 * * * * ${pwd}/update.sh"
|
||||||
|
if ! crontab -l | grep -Fxq "$line"; then
|
||||||
|
(crontab -l ; echo "$line") | crontab -
|
||||||
|
else
|
||||||
|
echo "[cron already exists, skipping]"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
echo
|
||||||
|
|
||||||
|
read -p "Create a cron job after each reboot? [y/n] " yn
|
||||||
|
case $yn in
|
||||||
|
[Yy]*)
|
||||||
|
line="@reboot ${pwd}/update.sh"
|
||||||
|
if ! crontab -l | grep -Fxq "$line"; then
|
||||||
|
(crontab -l ; echo "$line") | crontab -
|
||||||
|
else
|
||||||
|
echo "[cron already exists, skipping]"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
echo
|
||||||
|
|
||||||
|
read -p "Run script after system resume (from suspension)? (requires root) [y/n] " yn
|
||||||
|
case $yn in
|
||||||
|
[Yy]*)
|
||||||
|
sudo -k sh -c "echo -e \"case \"\${1}\" in\n\tresume|thaw)\n\t\t${pwd}/update.sh\n\t;;\nesac\" > /etc/pm/sleep.d/RotatingWallpaper.sh"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo " --> ERROR: Return from suspension script not created";
|
||||||
|
else
|
||||||
|
sudo sh -c "chmod +x /etc/pm/sleep.d/RotatingWallpaper.sh"
|
||||||
|
sudo sh -c "chown $USER /etc/pm/sleep.d/RotatingWallpaper.sh"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
echo
|
||||||
|
|
||||||
|
|
||||||
|
echo "Done!"
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
pwd=`pwd`
|
||||||
|
|
||||||
|
sep="--------------------------------------------------------------------------"
|
||||||
|
echo $sep
|
||||||
|
echo "*** 8bit Day Wallpaper Rotator for Linux ***"
|
||||||
|
echo $sep
|
||||||
|
echo
|
||||||
|
|
||||||
|
|
||||||
|
echo "This will revert all the changes."
|
||||||
|
echo
|
||||||
|
|
||||||
|
read -p "Are you sure that's what you want? [y/n] " yn
|
||||||
|
case $yn in
|
||||||
|
[Yy]* )
|
||||||
|
echo
|
||||||
|
echo "Removing tasks..."
|
||||||
|
|
||||||
|
line="${pwd}/update.sh"
|
||||||
|
crontab -l | grep -v "$line1" | crontab -
|
||||||
|
|
||||||
|
if [ -f /etc/pm/sleep.d/RotatingWallpaper.sh ]; then
|
||||||
|
echo "We need root permissions to delete '/etc/pm/sleep.d/RotatingWallpaper.sh': "
|
||||||
|
sudo -k sh -c "rm /etc/pm/sleep.d/RotatingWallpaper.sh"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
echo
|
||||||
|
|
||||||
|
read -p "Delete this directory and its files? [y/n] " yn
|
||||||
|
case $yn in
|
||||||
|
[Yy]* )
|
||||||
|
echo "rm -R $pwd"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
echo
|
||||||
|
|
||||||
|
|
||||||
|
echo "Done! We're sorry to see you go!"
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
sessionfile=`find "${HOME}/.dbus/session-bus/" -type f`
|
||||||
|
export `grep "DBUS_SESSION_BUS_ADDRESS" "${sessionfile}" | sed '/^#/d'`
|
||||||
|
|
||||||
|
files=(
|
||||||
|
01-Morning.png
|
||||||
|
02-Late-Morning.png
|
||||||
|
03-Afternoon.png
|
||||||
|
04-Late-Afternoon.png
|
||||||
|
05-Evening.png
|
||||||
|
06-Late-Evening.png
|
||||||
|
07-Night.png
|
||||||
|
08-Late-Night.png
|
||||||
|
)
|
||||||
|
|
||||||
|
#Timings for the backgrounds in order. Your life may vary.
|
||||||
|
timing=(
|
||||||
|
7
|
||||||
|
10
|
||||||
|
12
|
||||||
|
17
|
||||||
|
18
|
||||||
|
19
|
||||||
|
21
|
||||||
|
23
|
||||||
|
)
|
||||||
|
|
||||||
|
hour=`date +%H`
|
||||||
|
|
||||||
|
case $XDG_CURRENT_DESKTOP in
|
||||||
|
Mint|Mate) setcmd="gsettings set org.mate.background picture-uri";;
|
||||||
|
Cinnamon) setcmd="gsettings set org.cinnamon.background picture-uri";;
|
||||||
|
*) setcmd="feh --bg-fill";;
|
||||||
|
esac
|
||||||
|
if [[ -z $XDG_CURRENT_DESKTOP ]]; then
|
||||||
|
case $DESKTOP_SESSION in
|
||||||
|
i3) setcmd="feh --bg-fill"
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
for i in {7..0..-1}
|
||||||
|
do
|
||||||
|
if [[ $hour -ge ${timing[i]} ]]; then
|
||||||
|
$setcmd file://$DIR/${files[i]}
|
||||||
|
echo "Wallpaper set to ${files[i]}"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
$setcmd file://$DIR/${files[7]}
|
||||||
|
echo "Wallpaper set to ${files[7]}"
|
||||||