From 97dc629b078788b68cee96ecb56a1f06ef1fb274 Mon Sep 17 00:00:00 2001 From: Matt C Date: Thu, 3 Feb 2022 17:30:00 -0500 Subject: [PATCH] testing: add kde geoip --- PKGBUILD | 2 +- citrine.internal.sh | 31 ++++++++++++++++++------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index bdabae5..7084e9b 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -8,7 +8,7 @@ arch=('any') url="https://git.tar.black/crystal/programs/citrine" license=('custom') source=("citrine.sh" "citrine.internal.sh") -depends=('arch-install-scripts' 'util-linux' 'parted' 'dialog' 'dosfstools' 'ntp') +depends=('arch-install-scripts' 'util-linux' 'parted' 'dialog' 'dosfstools' 'ntp' 'python' 'wget') md5sums=('c16f9c01d656886b905071cb5477d3e3' '2f9106ae2bfeb37ba85087a6b99a4035') diff --git a/citrine.internal.sh b/citrine.internal.sh index ebdda00..2a30ce7 100755 --- a/citrine.internal.sh +++ b/citrine.internal.sh @@ -206,8 +206,6 @@ if [[ ! "$?" == "0" ]]; then exit 1 fi -ntpd -g -q - inf "Setting up base Crystal System" pacstrap /mnt base linux linux-firmware systemd-sysvcompat networkmanager man-db man-pages texinfo micro sudo curl archlinux-keyring neofetch which @@ -228,18 +226,25 @@ genfstab -U /mnt > /mnt/etc/fstab clear -cd /usr/share/zoneinfo/ -var=$(echo */ | sed 's/\///g' | sed 's/ /" "" "/g') -var=$(echo \"$var\") -loc1=$(dialog --title "Citrine" --menu "Please pick a time zone" 20 100 43 $var "" --stdout) -loc1=$(echo $loc1 | sed 's/"//g') -cd /usr/share/zoneinfo/$loc1 -var1=$(echo * | sed 's/\///g' | sed 's/ /" "" "/g') -var1=$(echo \"$var1\") -loc2=$(dialog --title "Citrine" --menu "Please pick a time zone" 20 100 43 $var1 "" --stdout) -loc2=$(echo $loc1 | sed 's/"//g') -TZ="/usr/share/zoneinfo/$loc1/$loc2" cd / +wget https://geoip.kde.org/v1/calamares +cat >> extract.py << EOF +import json +with open("calamares") as f: + s = f.read() +foo = json.loads(s) +with open("out","w") as f: + f.write(foo['time_zone]) +EOF +python extract.py +rm extract.py +rm calamares +DAT=$(cat out) +rm out +TZ="/usr/share/zoneinfo/${DAT}" + +ln -sf $TZ /etc/localtime +ntpd -g -q arch-chroot /mnt ln -sf $TZ /etc/localtime inf "Set TZ to ${TZ}"