added custom command support

This commit is contained in:
thevinter 2021-06-03 16:35:38 +02:00
parent da49b07be1
commit d008f4947e
3 changed files with 17 additions and 1 deletions

View File

@ -32,6 +32,18 @@ $ ./styli.sh -s sea -w 1080
# To get a random wallpaper from one of the set subreddits
# NOTE: The width/height/search parameters DON't work with reddit
$ ./styli.sh -l reddit
# To get a random wallpaper from a custom subreddit
$ ./styli.sh -r <custom_reddit>
$ ./styli.sh -r wallpaperdump
# To use the builtin feh --bg options
$ ./styli.sh -b <option>
$ ./styli.sh -b bg-scale -r widescreen-wallpaper
# To add custom feh flags
$ ./styli.sh -c <flags>
$ ./styli.sh -c --no-xinerama -r widescreen-wallpaper
```
## Tips And Tricks
To set a new background every time you reboot your computer add the following to your ```i3/config``` file

View File

@ -40,7 +40,7 @@ reddit(){
wget -T $timeout -U "$useragent" --no-check-certificate -q -P down -O "wallpaper.jpg" $target_url &>/dev/null
}
while getopts h:w:s:l:b:r: flag
while getopts h:w:s:l:b:r:c: flag
do
case "${flag}" in
b) bgtype=${OPTARG};;
@ -49,6 +49,7 @@ do
w) width=${OPTARG};;
l) link=${OPTARG};;
r) sub=${OPTARG};;
c) custom=${OPTARG};;
esac
done
@ -73,6 +74,9 @@ if [ ! -z $bgtype ]; then
else
feh+=(--bg-scale)
fi
if [ ! -z $custom ]; then
feh+=($custom)
fi
if [ $link = "reddit" ] || [ ! -z $sub ]
then
reddit "$sub"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 635 KiB