added scripts dir
This commit is contained in:
parent
763748c252
commit
7697ba34fe
5
.local/share/scripts/random-bg.sh
Executable file
5
.local/share/scripts/random-bg.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env sh
|
||||
SCRIPT=$(readlink -f "$0")
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
|
||||
$SCRIPTPATH/set-bg.sh $(shuf -n1 -e ~/pictures/wallpapers/*)
|
9
.local/share/scripts/reddit-wp.sh
Executable file
9
.local/share/scripts/reddit-wp.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env sh
|
||||
# required packages:
|
||||
# - wget
|
||||
# - jq
|
||||
|
||||
set -e
|
||||
|
||||
#wget -O - http://www.reddit.com/r/wallpapers.rss 2> /dev/null | grep -Eo "https://?[^&]+(jpg|png)" | grep -v "thumbs" | head -1
|
||||
wget -O - "http://www.reddit.com/r/wallpapers/top/.json?t=day" 2> /dev/null | jq -r ".data.children[0].data.url"
|
10
.local/share/scripts/select-bg.sh
Executable file
10
.local/share/scripts/select-bg.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env sh
|
||||
# required packages:
|
||||
# - sxiv
|
||||
|
||||
SELECT=$(sxiv -N "floatme" -t -o ~/pictures/wallpapers | tail -n1 )
|
||||
SCRIPT=$(readlink -f "$0")
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
|
||||
$SCRIPTPATH/set-bg.sh "$SELECT"
|
||||
|
15
.local/share/scripts/set-bg.sh
Executable file
15
.local/share/scripts/set-bg.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env sh
|
||||
# required packages:
|
||||
# - feh
|
||||
|
||||
set -e
|
||||
|
||||
[ -z "$@" ] && exit 0
|
||||
|
||||
LAST_BG_LOCATION="$XDG_CACHE_HOME/.last-bg"
|
||||
|
||||
feh --bg-scale $1
|
||||
|
||||
rm -f "$LAST_BG_LOCATION"
|
||||
ln -s $1 $(realpath "$LAST_BG_LOCATION")
|
||||
|
11
.local/share/scripts/set-reddit-bg.sh
Executable file
11
.local/share/scripts/set-reddit-bg.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env sh
|
||||
SCRIPT=$(readlink -f "$0")
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
|
||||
URL=$($SCRIPTPATH/reddit-wp.sh)
|
||||
NAME=$(basename "$URL")
|
||||
FILENAME=~/pictures/wallpapers/"$NAME"
|
||||
wget "$URL" -nc -O "$FILENAME"
|
||||
sleep 1
|
||||
$SCRIPTPATH/set-bg.sh $FILENAME
|
||||
|
Loading…
Reference in New Issue
Block a user