feat:added auto NTP and timezone handling

This commit is contained in:
Rick van Lieshout 2022-11-14 22:46:26 +02:00
parent 8b033f7fc1
commit 101b00c4fd
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,6 @@
#!/bin/sh
case "$2" in
up)
timedatectl set-timezone "$(curl --fail https://ipapi.co/timezone)"
;;
esac

View File

@ -75,6 +75,13 @@ function install_trizen {
sudo rm -dRf trizen/ sudo rm -dRf trizen/
} }
# Sets up time and date related stuff
function setDateTimeConfig {
systemctl enable ntpd
timedatectl set-ntp true
sudo ln -sf "$PWD"/config/networkmanager/09-timezone /etc/NetworkManager/dispatcher.d/09-timezone
}
# install other configs # install other configs
function install_config { function install_config {
@ -123,6 +130,8 @@ function install_config {
# system fixes # system fixes
echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system
mkdir -p ~/Pictures/Screenshots mkdir -p ~/Pictures/Screenshots
setDateTimeConfig
} }
# Installs the dependencies on Arch Linux # Installs the dependencies on Arch Linux