~mil/sxmo-utils

ref: dbc3b1ab509aab5f1db72c5cece2ee2a6eb521e8 sxmo-utils/scripts/core/sxmo_timezonechange.sh -rwxr-xr-x 375 bytes
dbc3b1abStacy Harper Allow the sendnewtextmenu to be used with a number as arg 1 year, 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env sh

change() {
	echo "Changing timezone to $1"
	sudo setup-timezone -z "$1"
	sxmo_statusbarupdate.sh
	echo Timezone changed ok
	read -r
}

menu() {
	T="$(
		find /usr/share/zoneinfo -type f |
		sed  's#^/usr/share/zoneinfo/##g' |
		sort |
		sxmo_dmenu_with_kb.sh -p Timezone -c -l 10 -i
	)"
	st -e "$0" change "$T"
}

if [ $# -gt 0 ]; then
	"$@"
else
	menu
fi