소스 검색

Add parameters to changepaper.sh script

Colin Powell 5 년 전
부모
커밋
2d8739d1e8
1개의 변경된 파일9개의 추가작업 그리고 3개의 파일을 삭제
  1. 9 3
      bin/.bin/changepaper.sh

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

@@ -9,9 +9,15 @@
 export DISPLAY=:0.0
 export XAUTHORITY=/home/powellc/.Xauthority
 
-# Choices: astrobin,natgeo,nasa,unsplash
-BASEDIR="$HOME/var/backgrounds/bing/"
-SEARX_BASEDIR="$HOME/var/backgrounds/natgeo/"
+if [ -n "$1" ]; then
+  SOURCE=$1
+else
+  SOURCE='astrobin'
+fi
+
+# Choices: astrobin,natgeo,nasa,unsplash,bing
+BASEDIR="$HOME/var/backgrounds/$SOURCE/"
+SEARX_BASEDIR="$HOME/var/backgrounds/bing/"
 
 # Get daily NatGeo POTD
 python3 ~/.bin/get_natgeo_potd.py