zaterdag 15 september 2018

Location info based on an IP address

Recently redshift broke due to a change in geoclue2.

My solution was to go back to the previous working version of geoclue2 (2.4.7-1) and just wait for a fix upstream. It seems that this compatibility issue will not be fixed in redshift or geoclue2 in their packages, so I neew a beter workarround.

I decided to just enter my location in the startup file, as suggested by several people.

One of the nice suggestions was to use a simple query to get your ip-based location info in json and extract wat was needed for redshift.

curl ipinfo.io | jq -j .loc | tr ',' ':'

I decided to just put the result of that query into the redshift desktop-file for my pc at home, not the query itself. I noticed that the json returned by the ipinfo.io site looked quite nice.

The location is close enough for use with redshift (well inside a 30 km radius), however it actually suggest another town :-)