Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weather, fortune and hostname issues #180

Open
h0pes opened this issue Jan 29, 2023 · 0 comments
Open

Weather, fortune and hostname issues #180

h0pes opened this issue Jan 29, 2023 · 0 comments

Comments

@h0pes
Copy link

h0pes commented Jan 29, 2023

First of all, thanks for these awesome dotfiles. Incredible work.

I'm having some issues with a pretty default config of amarena.

  • Weather
    I just added my openweathermap API key and city_id in the rc.lua but the widget does not load data in the sidebar where a generic text Loading weather... with an exclamation point icon appears.

amarena_sidebar

Running the script:

#!/bin/bash
KEY="xxxxxxxxxxxxxxxxxxxxxx"
CITY="yyyyyy"
UNITS="metric"
SYMBOL="°C"

weather=$(curl -sf "http://api.openweathermap.org/data/2.5/weather?APPID=$KEY&id=$CITY&units=$UNITS")

if [ ! -z "$weather" ]; then
    weather_temp=$(echo "$weather" | jq ".main.temp" | cut -d "." -f 1)
    weather_icon=$(echo "$weather" | jq -r ".weather[].icon" | head -1)
    weather_description=$(echo "$weather" | jq -r ".weather[].description" | head -1)

    echo "$weather_icon" "$weather_description" "$weather_temp$SYMBOL"
else
    echo "... Info unavailable"
fi

in a terminal sessions works fine with an output like: 01d clear sky 6°C.

  • Fortune
    Works fine from the command line but output is not rendered correctly in the dashboard:
    amarena_fortune

amarena_dashboard

  • hostname
    The same problem seems to affect the hostname portion of the user widget in the dashboard (see screenshot above).

I have made no changes to the default config.

$ awesome -v                                                                                                                                                                                               dom 16:54
awesome v4.3-1588-gb54e50ad6 (Too long)
 • Compiled against Lua 5.4.4 (running with 0.9.2)
 • API level: 4
 • D-Bus support: yes
 • xcb-errors support: no
 • execinfo support: yes
 • xcb-randr version: 1.6
 • LGI version: /usr/share/lua/5.4/lgi/version.lua
 • Transparency enabled: yes
 • Custom search paths: no

Running Arch Linux with kernel 6.1.8-arch1-1 on VMWare.

The only error I see in .xsession-errors is related to helpers.lua:

2023-01-29 17:03:16 W: awesome: luaA_dofunction:78: error while running function!
stack traceback:
	/home/hopes/.config/awesome/helpers.lua:420: in function </home/hopes/.config/awesome/helpers.lua:412>
	(...tail calls...)
error: /home/hopes/.config/awesome/helpers.lua:420: attempt to perform arithmetic on a nil value

Any help would be greatly appreciated.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant