added a toggle for tipme command to change between normal and cowsay mode.
This commit is contained in:
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ ! -e ~/.config/tips.state ]; then
|
||||
echo "standard" > ~/.config/tips.state
|
||||
fi
|
||||
|
||||
SETTING=$(cat ~/.config/tips.state)
|
||||
|
||||
INPUT="$1"
|
||||
|
||||
case $INPUT in
|
||||
"")
|
||||
case $SETTING in
|
||||
standard)
|
||||
shuf -n 1 ~/.config/sdgos/tips/tips.list
|
||||
;;
|
||||
cow)
|
||||
cowsay -r $(shuf -n 1 ~/.config/sdgos/tips/tips.list) | lolcat
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
toggle)
|
||||
case $SETTING in
|
||||
standard)
|
||||
echo "cow" > ~/.config/tips.state
|
||||
;;
|
||||
cow)
|
||||
echo "standard" > ~/.config/tips.state
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
standard)
|
||||
echo "standard" > ~/.config/tips.state
|
||||
shuf -n 1 ~/.config/sdgos/tips/tips.list
|
||||
;;
|
||||
|
||||
cow)
|
||||
echo "cow" > ~/.config/tips.state
|
||||
cowsay -r $(shuf -n 1 ~/.config/sdgos/tips/tips.list) | lolcat
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user