Files
dotfiles/bin/.bin/changepaper

66 lines
2.0 KiB
Plaintext
Raw Normal View History

2020-01-27 01:01:51 -05:00
#!/bin/sh
2020-01-20 21:47:41 -05:00
# This Script downloads National Geographic Photo of the day, and sets it as desktop background (gnome, unity)
# Copyright (C) 2012 Saman Barghi - All Rights Reserved
# Permission to copy, modify, and distribute is granted under GPLv3
# Last Revised 22 May 2019
#######################
# For feh, we need display set properly
2020-01-20 21:47:41 -05:00
export DISPLAY=:0.0
2020-01-27 01:01:51 -05:00
export XAUTHORITY=/home/powellc/.Xauthority
2020-01-20 21:47:41 -05:00
if [ -n "$1" ]; then
SOURCE=$1
else
SOURCE='astrobin'
fi
# Choices: astrobin,natgeo,nasa,unsplash,bing
2020-07-23 13:10:56 -04:00
BASEDIR="$HOME/var/media/backgrounds/$SOURCE"
SEARX_BASEDIR="$HOME/var/media/backgrounds/bing"
2020-01-20 21:47:41 -05:00
2020-01-30 15:07:35 -05:00
# Get daily NatGeo POTD
python3 ~/.bin/get_natgeo_potd.py
2020-01-20 21:47:41 -05:00
python3 ~/.bin/get_astrobin_potd.py
python3 ~/.bin/get_unsplash_potd.py
python3 ~/.bin/get_bing_potd.py
2020-01-20 21:47:41 -05:00
date=$(date '+%Y-%m-%d')
#set the current image as wallpaper
2020-02-06 13:30:17 -05:00
echo "Setting desktop background"
feh --bg-fill $BASEDIR/$date.jpg
2020-02-06 13:27:56 -05:00
2020-01-20 21:47:41 -05:00
#link slim background to new image
2020-02-06 13:27:56 -05:00
SLIM_BG_FILE=/usr/share/slim/themes/default/background.jpg
2020-11-19 08:46:34 -05:00
echo "Setting Slim background image"
rm $SLIM_BG_FILE
cp $BASEDIR/$date.jpg $SLIM_BG_FILE
2020-02-06 13:27:56 -05:00
2021-03-04 23:20:03 -05:00
SEARX_BG_FILE=/usr/local/src/searx/searx/static/themes/oscar/img/bg.jpg
2020-10-26 00:17:10 -04:00
echo "Setting Searx background image"
scp $BASEDIR/$date.jpg search.local:$SEARX_BG_FILE
2020-02-06 13:27:56 -05:00
# Then grab our APOD image and store it for now
#Change directory to where the script resides.
#BASEDIR="$HOME/var/inbox/apod_photos"
#cd $BASEDIR
########################
#
## Get the APoD image from NASA
#img="$(curl https://api.nasa.gov/planetary/apod\?api_key=AdfgdnmmInYgpDMEq3ShMLKjJ7DZ7jyUcgLHWdgw | jq .hdurl | tr -d \")"
#
##check to see if there is any wallpaper to download
#if [ -n "$img" ]
#then
# img_file=`echo $img | cut -d/ -f 7 | tr -d \"`
# curl $img > $img_file
# #set the current image as wallpaper
2020-02-01 00:01:30 -05:00
# #hsetroot -sane $BASEDIR/$img_file
# ##link slim background to new image
# #rm /usr/share/slim/themes/default/background.jpg
# #ln -s $BASEDIR/$img_file /usr/share/slim/themes/default/background.jpg
#else
# echo "No Wallpaper today"
#fi