From e84246021af73a165e7130ad008da78a8b5053b1 Mon Sep 17 00:00:00 2001 From: Miles Alan Date: Wed, 27 May 2020 16:08:57 -0500 Subject: [PATCH] Add script to allow user to change timezone from the config menu --- scripts/core/sxmo_appmenu.sh | 1 + scripts/core/sxmo_timezonechange.sh | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100755 scripts/core/sxmo_timezonechange.sh diff --git a/scripts/core/sxmo_appmenu.sh b/scripts/core/sxmo_appmenu.sh index 367ca74..dffb2d0 100755 --- a/scripts/core/sxmo_appmenu.sh +++ b/scripts/core/sxmo_appmenu.sh @@ -51,6 +51,7 @@ programchoicesinit() { Modem Log ^ 0 ^ sxmo_modemlog.sh Flash $(cat /sys/class/leds/white:flash/brightness | grep -E '^0$' > /dev/null && echo -n "Off → On" || echo -n "On → Off") ^ 1 ^ sxmo_flashtoggle.sh Bar Toggle ^ 1 ^ key Alt+b + Change Timezone ^ 1 ^ sxmo_timezonechange.sh Rotate ^ 1 ^ sxmo_rotate.sh Upgrade Pkgs ^ 0 ^ st -e sxmo_upgrade.sh ")" && WINNAME=Config && return diff --git a/scripts/core/sxmo_timezonechange.sh b/scripts/core/sxmo_timezonechange.sh new file mode 100755 index 0000000..4b1dc67 --- /dev/null +++ b/scripts/core/sxmo_timezonechange.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env sh +T="$( + find /usr/share/zoneinfo -type f | + sed 's#^/usr/share/zoneinfo/##g' | + sort | + sxmo_dmenu_with_kb.sh -p Timezone -c -l 10 -fn Terminus-20 -i +)" + +st -e sh -c 'sudo setup-timezone -z '$T' && echo 1 > /tmp/sxmo_bar && echo Timezone changed ok && read'