kamek-pf / ntfd

A lightweight notification daemon for fancy desktop integrations
GNU General Public License v3.0
120 stars 5 forks source link

Weather icons don't show unless ntfd is started manually #12

Open trevorsweigart opened 2 years ago

trevorsweigart commented 2 years ago

I have followed the installation guide correctly, I believe. I put the polybar module in my polybar config, enabled the weather module in the config, and started ntfd in my bspwmrc. However, the weather icons on the bar don't actually show unless ntfd is started manually. Even if ntfd is running, there is just nothing in polybar. I have confirmed it with $ ps -aux | grep ntfd name 521 0.0 0.0 1073750228 7048 ? Sl 17:11 0:00 ntfd

Also, if ntfd isn't started, it shows an error message in polybar, which is expected. If I then immediatly kill ntfd and start it again manually, everything works as expected.

Polybar config:


font-0 = WeatherIcons:size=10
font-1 = NotoSans-Regular:size=8;-1
font-2 = MaterialIcons:size=10;0
font-3 = Termsynu:size=8:antialias=false;-2
font-4 = FontAwesome:size=10;0

modules-right = weather volume wireless-network wired-network battery date

[module/weather]
type = custom/script
exec = busctl --user -j get-property io.ntfd /weather openweathermap.strings RenderedTemplate | jq -r .data
interval = 60

bspwmrc:

#! /bin/sh

sxhkd &
ntfd & 
polybar top &
wmname LG3D

pgrep -x sxhkd > /dev/null || sxhkd &

bspc monitor -d '1' '2' '3' '4' '5' '6' '7' '8' '9' '10'

I've also tried replacing exec part of of the polybar module with the ntfd binary, which also causes the weather icons to not show up, however ntfd still runs. Maybe I'm overlooking something, but can't find what it is. Thanks!

kamek-pf commented 2 years ago

What if you run this in a terminal:

busctl --user -j get-property io.ntfd /weather openweathermap.strings RenderedTemplate | jq -r .data

while polybar doesn't show anything, do you get an error message or do you see the data you expect ?

trevorsweigart commented 2 years ago

When running ntfd from my bspwmrc, then I run that command, there is no output. Neither an error message or data. However, when I manually type ntfd in the terminal to start it, then run the command the correct data is output.

kamek-pf commented 2 years ago

What do you mean by "no output" ? Is it hanging forever ? Or is there just nothing ?

It's possible the first query fails because the network isn't quite ready or something. If that's the issue, the next query should succeed and you'll see data in polybar. You can try to add a sleep 15 in your bspwmrc before ntfd & to confirm.

You can also play with sync_frequency in your ntfd config file.