You are not logged in.
Cameo, I am sorry you are having trouble with shaman. If you have XDG_CONFIG_HOME defined, then shaman will look for files under that directory first. Second, you should definitely not need to download the .json files ahead-of-time; they are downloaded dynamically upon request for data (also, I am not sure what running `updatedb` would accomplish). Additionally, `-r` forces a cache to be refreshed (you cannot simply run it alone)—also, you should probably never use this option. Finally, if you read the man page a little more closely, you'll notice that the two-letter code is not the state, but rather the country, so the correct invocation for you would be `shaman -l'Los Gatos,US'`.
Do you have XDG_CONFIG_HOME defined? If not, did shaman create ~/.shaman, or did you try to manually create it yourself?
All the best,
-HG
Offline
Cameo, I am sorry you are having trouble with shaman. If you have XDG_CONFIG_HOME defined, then shaman will look for files under that directory first. Second, you should definitely not need to download the .json files ahead-of-time; they are downloaded dynamically upon request for data
Hi, thanks for your response. Dynamic download, good to know. But yet not for me.
(also, I am not sure what running `updatedb` would accomplish).
Well, since shaman is from the AUR, this was my last choice for finding eventually missing new files.
Additionally, `-r` forces a cache to be refreshed (you cannot simply run it alone)—also, you should probably never use this option.
Probably not, I just hoped this would create some kind of data base in the end. But it didn't.
Finally, if you read the man page a little more closely, you'll notice that the two-letter code is not the state, but rather the country, so the correct invocation for you would be `shaman -l'Los Gatos,US'`.
Be sure, I tried to invoke the program in many ways and with different global locations (like in the manpage in this thread). And I already tried yours also -- same result!
Do you have XDG_CONFIG_HOME defined? If not, did shaman create ~/.shaman, or did you try to manually create it yourself?
In fact I haven't. I just installed xdg-user-dirs, ran xdg-user-dirs-update, but this variable is still empty. Maybe I should also reboot or re-login first. -- Anyway ~/.shaman/ was created by shaman.
Last edited by cameo (2015-02-23 23:42:26)
Offline
No, if you don't have it defined, then it should default to ~/.shaman (and it sounds like it did). Try this:
$ shaman -l'Los Gatos,US' -c "$HOME/.shaman/imperial.json"
All the best,
-HG
Offline
... unfortunately remains the same, and ~/.shaman/ is still empty:
$ shaman -l'Los Gatos,US' -c "$HOME/.shaman/imperial.json"
The specified cache path does not exist
$ shaman -l'Los Gatos,US'
The specified cache path does not exist
Last edited by cameo (2015-02-24 00:06:05)
Offline
Okay, well I am truly not sure what is happening, but I think I know of a work around. try the following:
$ touch "$HOME/.shaman/{imperial,metric}.json"
Then try again. Let me know if that gets it working.
All the best,
-HG
Offline
$ touch "$HOME/.shaman/{imperial,metric}.json"
~ shaman -l'Los Gatos,US' # with or without the -c option
The specified cache path does not exist
$ ls ~/.shaman
{imperial,metric}.json
$ rm ~/.shaman/*
$ touch "$HOME/.shaman/metric.json"
$ touch "$HOME/.shaman/imperial.json"
$ shaman -l'Los Gatos,US'
Sky is Clear (61.07°F)
$ shaman -m -l'Los Gatos,US'
Sky is Clear (15.6°C)
$ shaman -m -l'London,GB'
overcast clouds (4.4°C)
$ shaman -m -l "London,GB"
overcast clouds (4.4°C)
$ shaman -m -l London,GB
overcast clouds (4.4°C)
$ shaman -m -l=London,GB
overcast clouds (4.4°C)
$ shaman -ml London,GB
overcast clouds (4.4°C)
$ touch $HOME/.shaman/{foo,bar} # leaving the "" away
$ ls ~/.shaman/
bar foo imperial.json metric.json
Terrific, there's some progress!
Cool then, this should work with any location on openweathermap.org, I guess.
Tomorrow I'll look for nice monochrome weather icons, including the moon for displaying weather at night. For this reason, is there a way to show an international location's local time? The -v option seems not to do it.
Offline
Ahh yes, that was my fault for quoting the brace expansion. I am glad it's now working correctly. You can get the timestamp of the data with a format specifier. See the man page for more details.
All the best,
-HG
Offline
Ah yes, sure. Looks e.g. like this then:
$ shaman -ml London, GB -f "%I,%j %c at %a"
London,United Kingdom light rain at 1424742709
Well, the country code is different, and here it's 3 am, and I'm too tired now to calculate the Unix time into human readable. So I'm going to sleep now. But shaman is cool stuff. Thanks for sharing! <3
Offline
You should quote the location string so that the `-l` option actually receives "London, GB" and not just "London,". And, allowing for specific formatting of time variables is a planned feature I'm glad you like it!
All the best,
-HG
Offline
$ shaman -ml "London, GB" -f "%I,%j %c at %a"
London,GB light rain at 1424743309
Agreed! ^^
Well, I'm sure there are nice time converters around. But the time shown here -- isn't this actually localhost's anyway?
Good night~
Edit: However, there's no format specifier for average temperature, just for low and high temperature.
Last edited by cameo (2015-02-24 11:05:34)
Offline
isn't this actually localhost's anyway?
it's the GMT in unixtime of the time the data was sent.
All the best,
-HG
Offline
Related to recent discussion about cache and time formatting, I thought I share my take on it. While ago I wrote simple wrapper around shaman which would handle multiple locations, simple output coloring and basic time formatting. For time formatting I use PKGBUILD with simple patch here https://github.com/mkoskar/pkgbuilds/tr … shaman-git. To handle multiple runs I do hash of all options for completeness. It's simple, straightforward but most likely overkill and probably better / faster fingerprint could be devised. Anyway, thanks goes to HalosGhost for shaman in first place, long-time user here .
$ cat ~/bin/wi
#!/bin/bash
set -e
ti_reset=$'\e[m'
ti_hi0=$'\e[1;37m'
ti_hi1=$'\e[1;32m'
ti_hi2=$'\e[1;31m'
ti_hi3=$'\e[1;33m'
format="%I, %j (%l, %L) at %a
----------------------------------------
Condition: ${ti_hi0}%c${ti_reset}
Clouds: ${ti_hi0}%d%%${ti_reset}
Barometric pressure: %bhPa
Precipitation: %pmm
Relative humidity: ${ti_hi0}%P%%${ti_reset}
Temperature: Low: ${ti_hi1}%h°C${ti_reset} / High: ${ti_hi2}%H°C${ti_reset} / Current: ${ti_hi3}%t°C${ti_reset}
Wind: %X (%x°), %wmps, %Wmps
Sun: %s / %S
"
get() {
local opts=(-m -l "$1")
local opts_digest=$(md5sum <<<"${opts[*]}" | awk '{print $1}')
local cache="$HOME/.cache/shaman-${opts_digest: -7}.json"
touch "$cache"
shaman "${opts[@]}" -f "$format" -c "$cache"
}
echo
get 'Prague,CZ'
get 'Berlin,DE'
get 'London,GB'
Last edited by mkoskar (2015-02-24 09:13:21)
Offline
Mmm, colored printing… I wonder how I'd never thought of that. Additionally, supporting multiple queries at once is a great idea.
Shaman has been left on the shelf for a bit too long I think. Perhaps it is about time I revive it again.
All the best,
-HG
Offline