Allow updating timezone from right-clicking the clock

Closes #314
This commit is contained in:
David Heinemeier Hansson
2025-07-26 11:15:06 -04:00
parent 51e2fa8598
commit eace29af7d
4 changed files with 21 additions and 1 deletions

5
bin/omarchy-cmd-tzupdate Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
sudo tzupdate
new_timezone=$(timedatectl show -p Timezone --value)
notify-send "Timezone has been set to $new_timezone"

View File

@ -50,7 +50,8 @@
"clock": { "clock": {
"format": "{:%A %H:%M}", "format": "{:%A %H:%M}",
"format-alt": "{:%d %B W%V %Y}", "format-alt": "{:%d %B W%V %Y}",
"tooltip": false "tooltip": false,
"on-click-right": "omarchy-cmd-tzupdate"
}, },
"network": { "network": {
"format-icons": ["󰤯","󰤟","󰤢","󰤥","󰤨"], "format-icons": ["󰤯","󰤟","󰤢","󰤥","󰤨"],

View File

@ -0,0 +1,9 @@
#!/bin/bash
if [[ ! -f /etc/sudoers.d/omarchy-tzupdate ]]; then
yay -S --noconfirm --needed tzupdate
sudo tee /etc/sudoers.d/omarchy-tzupdate >/dev/null <<EOF
%wheel ALL=(root) NOPASSWD: /usr/bin/tzupdate, /usr/bin/timedatectl
EOF
sudo chmod 0440 /etc/sudoers.d/omarchy-tzupdate
fi

5
migrations/1753495989.sh Normal file
View File

@ -0,0 +1,5 @@
echo "Allow updating of timezone by right-clicking on the clock (or running omarchy-cmd-tzupdate)"
if [[ ! -f /etc/sudoers.d/omarchy-tzupdate ]]; then
bash ~/.local/share/omarchy/install/config/timezones.sh
omarchy-refresh-waybar
fi