added automatic time zone

This commit is contained in:
paul-loedige
2025-09-30 11:53:56 +01:00
parent 3b5524c5cb
commit dc4abc1c00
+32 -15
View File
@@ -31,11 +31,11 @@
- [[#build-tools][Build Tools]]
- [[#system-locale][System Locale]]
- [[#keyboard-layout][Keyboard Layout]]
- [[#ntp][NTP]]
- [[#system-time][System Time]]
- [[#audio][Audio]]
- [[#additional-firmware][Additional Firmware]]
- [[#ntfs-compatibility][NTFS Compatibility]]
- [[#timeshift][Timeshift]]
- [[#backup][Backup]]
- [[#desktop-environments-and-window-manager][Desktop Environments and Window Manager]]
- [[#lightdm][LightDM]]
- [[#xfce][Xfce]]
@@ -664,7 +664,8 @@ if ! localectl status | grep -q "X11 Layout.*de"; then
sudo localectl set-x11-keymap --no-convert de
fi
#+end_src
** NTP
** System Time
*** NTP
#+begin_src shell :tangle update.sh
systemd_service="systemd-timesyncd"
if ! systemctl is-enabled --quiet "$systemd_service"; then
@@ -672,6 +673,19 @@ if ! systemctl is-enabled --quiet "$systemd_service"; then
sudo systemctl enable "$systemd_service"
fi
#+end_src
*** Automatic Time Zone Update
As per the [[https://wiki.archlinux.org/title/NetworkManager#Automatically_set_the_timezone][Arch Wiki]] the following script automatically updates the timezone when the Network Manager connects to the web.
#+begin_src bash :tangle "/sudo::/etc/NetworkManager/dispatcher.d/09-timezone" :shebang #!/bin/sh
# DO NOT EDIT THIS FILE DIRECTLY
# This is a file generated from a literate programing source file
# You should make any changes there and regenerate it from Emacs org-mode
# using org-babel-tangle (C-c C-v t)
case "$2" in
connectivity-change)
timedatectl set-timezone "$(curl --fail https://ipapi.co/timezone)"
;;
esac
#+end_src
** Audio
#+begin_src shell :tangle pkg-list.txt
@@ -703,10 +717,13 @@ amd-ucode
#+begin_src conf :tangle pkg-list.txt
ntfs-3g
#+end_src
** Timeshift
** Backup
*** Timeshift
utility for backing up system files
#+begin_src conf :tangle pkg-list.txt
timeshift
#+end_src
* Desktop Environments and Window Manager
** [[https://wiki.archlinux.org/title/LightDM][LightDM]]
install the required packages
@@ -2252,8 +2269,7 @@ autorandr
#+end_src
**** Configuration
***** Config File Header
#+begin_src shell :mkdirp yes :tangle ~/.config/autorandr/postswitch
#!/bin/sh
#+begin_src shell :mkdirp yes :tangle ~/.config/autorandr/postswitch :shebang #!/bin/sh
# DO NOT EDIT THIS FILE DIRECTLY
# This is a file generated from a literate programing source file
# You should make any changes there and regenerate it from Emacs org-mode
@@ -2265,16 +2281,17 @@ autorandr
sleep 1
qtile cmd-obj -o cmd -f restart
#+end_src
make the postswitch file executable
#+begin_src shell :tangle update.sh
FILE="$HOME/.config/autorandr/postswitch"
# Check if the file is already executable
if [ ! -x "$FILE" ]; then
echo "Making $FILE script executable"
chmod +x "$FILE"
fi
#+end_src
# make the postswitch file executable
# #+begin_src shell :tangle update.sh
# FILE="$HOME/.config/autorandr/postswitch"
# # Check if the file is already executable
# if [ ! -x "$FILE" ]; then
# echo "Making $FILE script executable"
# chmod +x "$FILE"
# fi
# #+end_src
* Doom Emacs
** Installation