Set GUI time zone from geolocation
The wonderful *ipapi.co* service can help identify the time zone of a device based on the geolocation information for its IP address. We can use this to set the `TZ` environment variable in the user session, which Firefox will respect. This has the effect of showing the correct time in e.g. Grafana dashboards, without hard-coding the time zone in the rootfs image.
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
|
||||
xset s off
|
||||
xset -dpms
|
||||
systemctl --user import-environment DISPLAY
|
||||
|
||||
TZ="$(curl https://ipapi.co/timezone)"
|
||||
export TZ
|
||||
|
||||
systemctl --user import-environment DISPLAY TZ
|
||||
systemctl --user start firefox-marionette.socket firefox
|
||||
exec openbox
|
||||
|
||||
Reference in New Issue
Block a user