Generate geoclue /etc/geolocation based on the current time zone.
Usage:
geoclue-tz [flags]
Flags:
-c, --completion string completion script for bash, zsh or fish
-d, --dry-run dry run debug mode
-h, --help help for geoclue-tz
-l, --location string enable custom location
--version display version
Update /etc/geolocation
based on the current time zone.
sudo geoclue-tz
Update /etc/geolocation
based on your custom home location.
sudo geoclue-tz -l home
Make sure that GOPATH
and GOBIN
env vars are set. Then run:
go install github.com/zquestz/geoclue-tz@latest
sudo cp $GOPATH/bin/geoclue-tz /usr/bin
Arch Linux users can install from the AUR:
yay -S geoclue-tz
To setup your own configuration just create /etc/geoclue-tz.conf
. The configuration file is in UCL format. This makes it super easy to set the values for your custom locations, and restore them whenever you want.
For more information about UCL visit: https://github.com/vstakhov/libucl
The following keys are supported:
- locations - array (custom locations)
- verbose - bool (verbose mode)
- dryRun - bool (dry run mode)
Here is a sample configuration, with a single custom location. The only required keys are latitude
, longitude
, and name
.
locations [
{
latitude = 19.520960
longitude = 155.920517
altitude = 0
accuracy = 1000
name = home
}
]
To set up autocompletion:
sudo bash -c "geoclue-tz --completion bash > /etc/bash_completion.d/geoclue-tz"
Generate a _geoclue-tz
completion script and put it somewhere in your $fpath
:
sudo zsh -c "geoclue-tz --completion zsh > /usr/share/zsh/site-functions/_geoclue-tz"
geoclue-tz --completion fish > ~/.config/fish/completions/geoclue-tz.fish
geoclue-tz is released under the MIT license.