From ed8e24d526f8a4a30a5c39bfc48b67d07d258be8 Mon Sep 17 00:00:00 2001 From: rafa_99 Date: Sat, 1 Jan 2022 21:46:53 +0000 Subject: Updated Bluelight filter script --- scripts/.local/bin/bluelight | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/.local/bin/bluelight b/scripts/.local/bin/bluelight index 8dca501..1aa16a8 100755 --- a/scripts/.local/bin/bluelight +++ b/scripts/.local/bin/bluelight @@ -1,12 +1,12 @@ #!/bin/sh +# Obtains the current coordinates +COORDINATES=$(curl -s "https://location.services.mozilla.com/v1/geolocate?key=geoclue" | awk 'OFS=":" {print $3,$5}' | tr -d ',}') + #This is a script to turn on bluelight filter if pgrep redshift > /dev/null then killall redshift else - LATITUDE=$(curl https://ipinfo.io/ip | xargs -I {} curl -s --get https://ipvigilante.com/{} | jq | grep latitude | awk '{print $2}' \ - | sed s:'"'::g | sed s:','::g) && LONGITUDE=$(curl https://ipinfo.io/ip \ - | xargs -I {} curl -s --get https://ipvigilante.com/{} | jq | grep longitude | awk '{print $2}' | sed s:'"'::g \ - | sed s:','::g) && redshift -l "$LATITUDE":"$LONGITUDE" -m randr + redshift -l "$COORDINATES" -m randr fi -- cgit v1.2.3