From 568706c9df65ad1eadc21da806c40640c5ec0218 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 15 Dec 2022 22:54:21 -0600 Subject: [PATCH] fix gammastep-init.sh to not have issues when geoclue web service is rate limited, change format location data is saved as. add sway-audio-idle-inhibit-git to aur packages remove some packages from aur list --- gammastep-init.sh | 19 ++++++++++++++++--- installers/arch/SCRIPTS/aur-install.sh | 4 +--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/gammastep-init.sh b/gammastep-init.sh index 93f01a1..ca3b283 100755 --- a/gammastep-init.sh +++ b/gammastep-init.sh @@ -4,7 +4,20 @@ #modified to be a posix shell script, and to save location data to a file #so gammastep still works if internet is out. -FN="$HOME/.cache/gs_geoclue.json" +JSFN="$HOME/.cache/gs_geoclue.json" -curl -Ls https://ipapi.co/json > "$FN" -gammastep -l "$( cat "$FN" | jq ".latitude" )":"$( cat "$FN" | jq ".longitude" )" -m wayland +FN="$HOME/.cache/gs_geoclue.txt" + +curl -Ls https://ipapi.co/json > "$FN".tmp + +#dont update file if error received, could also check if an error flag is present +if [ "$(cat "$JSFN".tmp | wc -l)" -gt 4 ]; then + mv "$JSFN".tmp "$JSFN" + LAT="$( cat "$JSFN" | jq ".latitude" )" + LONG="$( cat "$JSFN" | jq ".longitude" )" + + echo "$LAT $LONG" > "$FN" + +fi + +gammastep -l "$( cat "$FN" | cut -d' ' -f1)":"$( cat "$FN" | cut -d' ' -f2)" -m wayland diff --git a/installers/arch/SCRIPTS/aur-install.sh b/installers/arch/SCRIPTS/aur-install.sh index bfce261..a6eb495 100755 --- a/installers/arch/SCRIPTS/aur-install.sh +++ b/installers/arch/SCRIPTS/aur-install.sh @@ -22,9 +22,7 @@ cli-visualizer wob wayland-idle-inhibitor-git tofi -librewolf-bin -hyprland -waybar-hyprland-git" +sway-audio-idle-inhibit-git" sudo pacman -S base-devel fakeroot