From 16193e7c9340932e7947e9447f45f6268d31e414 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 20 May 2026 22:10:46 +0200 Subject: [PATCH] Convert tz setting to a QS menu --- bin/omarchy-menu-timezone | 10 ++++++++++ bin/omarchy-tz-select | 8 -------- default/omarchy/omarchy-menu.jsonc | 2 +- install/config/timezones.sh | 4 ++-- migrations/1779307210.sh | 6 ++++++ shell/plugins/bar/widgets/Clock.qml | 16 ++++++++++++++-- 6 files changed, 33 insertions(+), 13 deletions(-) create mode 100755 bin/omarchy-menu-timezone delete mode 100755 bin/omarchy-tz-select create mode 100644 migrations/1779307210.sh diff --git a/bin/omarchy-menu-timezone b/bin/omarchy-menu-timezone new file mode 100755 index 00000000..52d55635 --- /dev/null +++ b/bin/omarchy-menu-timezone @@ -0,0 +1,10 @@ +#!/bin/bash + +# omarchy:summary=Select and set the system timezone +# omarchy:group=menu +# omarchy:name=timezone + +timezone=$(timedatectl list-timezones | omarchy-menu-select "Set timezone" -- --width 520 --maxheight 520) || exit 1 +sudo timedatectl set-timezone "$timezone" +omarchy-shell -q Clock refresh +omarchy-notification-send "Timezone is now set to $timezone" diff --git a/bin/omarchy-tz-select b/bin/omarchy-tz-select deleted file mode 100755 index 6c8ffe49..00000000 --- a/bin/omarchy-tz-select +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# omarchy:summary=Select and set the system timezone -# omarchy:requires-sudo=true - -timezone=$(timedatectl list-timezones | gum filter --height 20 --header "Set timezone") || exit 1 -sudo timedatectl set-timezone "$timezone" -echo "Timezone is now set to $timezone" diff --git a/default/omarchy/omarchy-menu.jsonc b/default/omarchy/omarchy-menu.jsonc index 224ff314..5a07e8f3 100644 --- a/default/omarchy/omarchy-menu.jsonc +++ b/default/omarchy/omarchy-menu.jsonc @@ -286,7 +286,7 @@ "update.hardware": {"icon":"󰇅","label":"Hardware","keywords":"restart audio wifi bluetooth trackpad"}, "update.firmware": {"icon":"","label":"Firmware","keywords":"fwupd","action":"omarchy-launch-floating-terminal-with-presentation omarchy-update-firmware"}, "update.password": {"icon":"","label":"Password","keywords":"drive user"}, - "update.timezone": {"icon":"","label":"Timezone","keywords":"time zone","action":"omarchy-launch-floating-terminal-with-presentation omarchy-tz-select"}, + "update.timezone": {"icon":"","label":"Timezone","keywords":"time zone","action":"omarchy-menu-timezone"}, "update.time": {"icon":"","label":"Time","keywords":"clock ntp","action":"omarchy-launch-floating-terminal-with-presentation omarchy-update-time"}, "update.channel.stable": {"icon":"🟢","label":"Stable","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-channel-set stable'"}, "update.channel.rc": {"icon":"🟡","label":"RC","keywords":"release candidate","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-channel-set rc'"}, diff --git a/install/config/timezones.sh b/install/config/timezones.sh index 24e96a0f..1dbda987 100644 --- a/install/config/timezones.sh +++ b/install/config/timezones.sh @@ -1,5 +1,5 @@ -# Ensure timezone can be updated without needing to sudo +# Ensure timezone can be updated without a password prompt sudo tee /etc/sudoers.d/omarchy-tzupdate >/dev/null </dev/null <