summaryrefslogtreecommitdiff
path: root/.local/bin/shufwall
blob: 086dd54ddcf6610e207c33dd7f09efd5cbc97855 (plain)
1
2
3
4
5
6
7
8
#!/bin/sh

if [ -z "$1" ]; then
	xwallpaper --maximize "$(find -L ~/pictures/wallpapers -type f | shuf -n 1)"
else
	xwallpaper --maximize "$(find -L "$@" -maxdepth 1 -type f | shuf -n 1)"
fi

n/sh # DATE From To while getopts cfF:t:T: opt; do case $opt in c) tz_from="Asia/Shanghai";; f) tz_from="$(tzselect)";; F) tz_from="$OPTARG";; # one extra ',' at the end will not let `for tz in ...` loop one extra time? t) for i in $(seq "$OPTARG"); do tz_to="$(tzselect),$tz_to" done;; T) tz_to="$OPTARG,$tz_to";; \?) exit 1;; esac done shift $((OPTIND-1))