polybar: display current weather

This commit is contained in:
Vincent Bernat 2021-08-10 13:08:15 +02:00
parent eb3e05e488
commit 0559c830ef
5 changed files with 197 additions and 1 deletions

View file

@ -29,9 +29,10 @@ foreground = ${colors.foreground}
font-0 = Iosevka:style=Regular:size=10;2
font-1 = Font Awesome 6 Pro:style=Solid:size=10;2
font-2 = Font Awesome 6 Brands:style=Regular:size=10;2
font-3 = Weather Icons:style=Regular:size=10;2
modules-left = i3
modules-center = date
modules-center = date weather
[bar/alone]
inherit = bar/common
@ -43,6 +44,7 @@ modules-right = cpu memory brightness battery bluetooth network disk dunst pulse
[bar/secondary]
inherit = bar/common
modules-center = date
modules-right = pulseaudio
[module/i3]
@ -106,6 +108,12 @@ type = custom/ipc
hook-0 = cat $XDG_RUNTIME_DIR/i3/bluetooth.txt 2> /dev/null
initial = 1
[module/weather]
type = custom/ipc
hook-0 = cat $XDG_RUNTIME_DIR/i3/weather.txt 2> /dev/null
initial = 1
click-left = xdg-open https://www.meteoblue.com/en/weather/week
[module/dunst]
type = custom/ipc
hook-0 = cat $XDG_RUNTIME_DIR/i3/dunst.txt 2> /dev/null

View file

@ -3,6 +3,8 @@ Description=i3 session
BindsTo=graphical-session.target
Wants=wallpaper.service
Wants=wallpaper.timer
Wants=weather.service
Wants=weather.timer
Wants=polybar.service
Wants=i3-companion.service
Wants=misc-x.service

View file

@ -0,0 +1,11 @@
[Unit]
Description=Build and display wallpaper
PartOf=graphical-session.target
After=polybar.service
[Service]
Environment=OWM_API_KEY=81687c78e0376836871a6cb9fc347249
ExecStart=/usr/bin/mkdir -p %h/.cache/i3
ExecStart=%h/.config/i3/bin/polybar-weather
Type=oneshot
RemainAfterExit=false

View file

@ -0,0 +1,7 @@
[Unit]
Description=Weather update
PartOf=graphical-session.target
[Timer]
OnUnitActiveSec=1h
OnClockChange=true