From 1a1c7369361f62aba3d7a894754380cd6a40e1ca Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 17 Oct 2025 12:50:02 +0300 Subject: [PATCH] Make setting timezone an explicit act Since we can't always rely on geo guessing everywhere and it is slow --- bin/omarchy-cmd-tzupdate | 8 -------- bin/omarchy-menu | 2 +- bin/omarchy-tz-select | 6 ++++++ config/waybar/config.jsonc | 2 +- migrations/1760693222.sh | 3 +++ 5 files changed, 11 insertions(+), 10 deletions(-) delete mode 100755 bin/omarchy-cmd-tzupdate create mode 100755 bin/omarchy-tz-select create mode 100644 migrations/1760693222.sh diff --git a/bin/omarchy-cmd-tzupdate b/bin/omarchy-cmd-tzupdate deleted file mode 100755 index eb39bf0a..00000000 --- a/bin/omarchy-cmd-tzupdate +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -notify-send " Updating time and timezone..." -sudo systemctl restart systemd-timesyncd -sudo tzupdate -new_timezone=$(timedatectl show -p Timezone --value) -omarchy-restart-waybar -notify-send " Time updated and timezone set to $new_timezone" diff --git a/bin/omarchy-menu b/bin/omarchy-menu index 1dea5905..fa62d198 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -395,7 +395,7 @@ show_update_menu() { *Process*) show_update_process_menu ;; *Hardware*) show_update_hardware_menu ;; *Firmware*) present_terminal omarchy-update-firmware ;; - *Timezone*) omarchy-cmd-tzupdate ;; + *Timezone*) present_terminal omarchy-tz-select ;; *Password*) show_update_password_menu ;; *) show_main_menu ;; esac diff --git a/bin/omarchy-tz-select b/bin/omarchy-tz-select new file mode 100755 index 00000000..24003228 --- /dev/null +++ b/bin/omarchy-tz-select @@ -0,0 +1,6 @@ +#!/bin/bash + +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" +omarchy-restart-waybar diff --git a/config/waybar/config.jsonc b/config/waybar/config.jsonc index adb981ae..8db620ba 100644 --- a/config/waybar/config.jsonc +++ b/config/waybar/config.jsonc @@ -61,7 +61,7 @@ "format": "{:L%A %H:%M}", "format-alt": "{:L%d %B W%V %Y}", "tooltip": false, - "on-click-right": "omarchy-cmd-tzupdate" + "on-click-right": "omarchy-launch-floating-terminal-with-presentation omarchy-tz-select" }, "network": { "format-icons": ["󰤯", "󰤟", "󰤢", "󰤥", "󰤨"], diff --git a/migrations/1760693222.sh b/migrations/1760693222.sh new file mode 100644 index 00000000..cc9828e8 --- /dev/null +++ b/migrations/1760693222.sh @@ -0,0 +1,3 @@ +echo "Use explicit timezone selector when right-clicking on clock" + +sed -i 's/omarchy-cmd-tzupdate/omarchy-launch-floating-terminal-with-presentation omarchy-tz-select/g' ~/.config/waybar/config.jsonc