Merge branch 'master' of https://github.com/thevinter/styli.sh
This commit is contained in:
commit
240c72004e
21
LICENSE
Normal file
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Nikita Brancatisano
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
38
styli.sh
38
styli.sh
@ -40,18 +40,36 @@ reddit(){
|
||||
wget -T $timeout -U "$useragent" --no-check-certificate -q -P down -O "wallpaper.jpg" $target_url &>/dev/null
|
||||
|
||||
}
|
||||
usage(){
|
||||
echo "Usage: styli.sh [-s | --search <string>]
|
||||
[-h | --hight <hight>]
|
||||
[-w | --width <width>]
|
||||
[-b | --fehbg <feh bg opt>]
|
||||
[-c | --fehopt <feh opt>]
|
||||
[-r | --subreddit <subreddit>]
|
||||
[-l | --link <link>]
|
||||
[-p | --termcolor]"
|
||||
exit 2
|
||||
}
|
||||
pywal=0
|
||||
while getopts h:w:s:l:b:r:c:p flag
|
||||
PARSED_ARGUMENTS=$(getopt -a -n $0 -o h:w:s:l:b:r:c:p --long search:,hight:,width:,fehbg:,fehopt:,subreddit:,termcolor -- "$@")
|
||||
VALID_ARGUMENTS=$?
|
||||
if [ "$VALID_ARGUMENTS" != "0" ]; then
|
||||
usage
|
||||
fi
|
||||
while :
|
||||
do
|
||||
case "${flag}" in
|
||||
b) bgtype=${OPTARG};;
|
||||
s) search=${OPTARG};;
|
||||
h) height=${OPTARG};;
|
||||
w) width=${OPTARG};;
|
||||
l) link=${OPTARG};;
|
||||
r) sub=${OPTARG};;
|
||||
c) custom=${OPTARG};;
|
||||
p) pywal=1;;
|
||||
case "${1}" in
|
||||
-b | --fehbg) bgtype=${2} ; shift 2 ;;
|
||||
-s | --search) search=${2} ; shift 2 ;;
|
||||
-h | --height) height=${2} ; shift 2 ;;
|
||||
-w | --width) width=${2} ; shift 2 ;;
|
||||
-l | --link) link=${2} ; shift 2 ;;
|
||||
-r | --subreddit) sub=${2} ; shift 2 ;;
|
||||
-c | --fehopt) custom=${2} ; shift 2 ;;
|
||||
-p | --termcolor) pywal=1 ; shift ;;
|
||||
-- | '') shift; break ;;
|
||||
*) echo "Unexpected option: $1 - this should not happen." ; usage ;;
|
||||
esac
|
||||
done
|
||||
feh=(feh)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user