ソースを参照

Add more flexible bg setting script

Colin Powell 5 年 前
コミット
c9452242de
1 ファイル変更16 行追加3 行削除
  1. 16 3
      bin/.bin/changepaper.sh

+ 16 - 3
bin/.bin/changepaper.sh

@@ -10,7 +10,7 @@ export DISPLAY=:0.0
 export XAUTHORITY=/home/powellc/.Xauthority
 
 # Choices: astrobin,natgeo,nasa
-BASEDIR="$HOME/var/backgrounds/astrobin/"
+BASEDIR="$HOME/var/backgrounds/natgeo/"
 
 # Get daily NatGeo POTD
 python3 ~/.bin/get_natgeo_potd.py
@@ -20,9 +20,22 @@ date=$(date '+%Y-%m-%d')
 
 #set the current image as wallpaper
 hsetroot -cover $BASEDIR/$date.jpg
+
 #link slim background to new image
-rm /usr/share/slim/themes/default/background.jpg
-ln -s $BASEDIR/$date.jpg /usr/share/slim/themes/default/background.jpg
+SLIM_BG_FILE=/usr/share/slim/themes/default/background.jpg
+if test -f "$SLIM_BG_FILE"; then
+	echo "Setting Slim background image"
+	rm $SLIM_BG_FILE
+	ln -s $BASEDIR/$date.jpg $SLIM_BG_FILE
+fi
+
+SEARX_BG_FILE=/usr/local/lib/python2.7/site-packages/searx/static/themes/courgette/img/bg-body-index.jpg
+if test -f "$SEARX_BG_FILE"; then
+	echo "Setting Searx background image"
+	rm $SEARX_BG_FILE
+	ln -s $BASEDIR/$date.jpg $SEARX_BG_FILE
+fi
+
 echo "Background and slim wallpaper set using Astrobin PotD"