elenapan / dotfiles

There is no place like ~/
GNU General Public License v2.0
3.48k stars 178 forks source link

Weather, fortune and hostname issues #180

Open h0pes opened 1 year ago

h0pes commented 1 year ago

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

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

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.

amarena_dashboard

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