summaryrefslogtreecommitdiff
path: root/scripts/.local/bin
diff options
context:
space:
mode:
authorrafa_99 <raroma09@gmail.com>2022-01-01 21:46:53 +0000
committerrafa_99 <raroma09@gmail.com>2022-01-01 21:46:53 +0000
commited8e24d526f8a4a30a5c39bfc48b67d07d258be8 (patch)
treeb882fa3abd40449ae8eaee814f3e9e8dcbf4fc59 /scripts/.local/bin
parentac2d1c555d94a7938474ae13ded73df93ff700f9 (diff)
Updated Bluelight filter script
Diffstat (limited to 'scripts/.local/bin')
-rwxr-xr-xscripts/.local/bin/bluelight8
1 files 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