[zsh:wp] add restore functionality
This commit is contained in:
parent
4f88b04ea4
commit
54def17385
|
@ -121,7 +121,7 @@ function timer() {
|
||||||
function wp() {
|
function wp() {
|
||||||
(
|
(
|
||||||
if [ -z "$1" ] || ([ "$1" = "rand" ] && [ -z "$2" ]); then
|
if [ -z "$1" ] || ([ "$1" = "rand" ] && [ -z "$2" ]); then
|
||||||
echo "USAGE: $0 rand|default [path]"
|
echo "USAGE: $0 rand|restore|default [path]"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "default" ];then
|
if [ "$1" = "default" ];then
|
||||||
|
@ -132,6 +132,9 @@ function wp() {
|
||||||
rand=$(shuf -n1 -e $base/$2/*)
|
rand=$(shuf -n1 -e $base/$2/*)
|
||||||
[ -z "$rand" ] || feh --bg-fill "$rand"
|
[ -z "$rand" ] || feh --bg-fill "$rand"
|
||||||
fi
|
fi
|
||||||
|
if [ "$1" = "restore" ]; then
|
||||||
|
~/.fehbg
|
||||||
|
fi
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue