From 2332056fe2cf8e7ae11aead17411fc2a10a4bf55 Mon Sep 17 00:00:00 2001 From: Ryan Kes Date: Thu, 12 Mar 2020 12:26:46 +0100 Subject: [PATCH] Added wttr to polybar --- bspwm/.config/bspwm/bspwmrc | 1 + polybar/.config/polybar/bin/wttr-and-wait | 3 +++ polybar/.config/polybar/config | 10 ++++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100755 polybar/.config/polybar/bin/wttr-and-wait diff --git a/bspwm/.config/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc index ba5b685..6dc91a3 100755 --- a/bspwm/.config/bspwm/bspwmrc +++ b/bspwm/.config/bspwm/bspwmrc @@ -40,6 +40,7 @@ bspc config gapless_monocle true bspc rule -a "Syncthing GTK" state=floating bspc rule -a Gimp state=floating +bspc rule -a wttr state=floating bspc rule -a Spotify desktop='^4' bspc rule -a Spt desktop='^4' bspc rule -a Emacs state=tiled diff --git a/polybar/.config/polybar/bin/wttr-and-wait b/polybar/.config/polybar/bin/wttr-and-wait new file mode 100755 index 0000000..ecc935b --- /dev/null +++ b/polybar/.config/polybar/bin/wttr-and-wait @@ -0,0 +1,3 @@ +#!/usr/bin/env fish + +wttr && read -n 1 -p "" diff --git a/polybar/.config/polybar/config b/polybar/.config/polybar/config index 2a25d95..db257b8 100644 --- a/polybar/.config/polybar/config +++ b/polybar/.config/polybar/config @@ -48,7 +48,7 @@ monitor = ${env:MONITOR:eDP1} modules-left = bspwm modules-center = battery0 battery1 wlan wireguard bluetooth -modules-right = xbacklight volume-laptop memory cpu temperature filesystem docker updates-arch-combined mail reddit github rss date +modules-right = xbacklight volume-laptop memory cpu temperature filesystem docker updates-arch-combined mail reddit github rss weather date tray-position = right @@ -58,7 +58,7 @@ monitor = ${env:MONITOR:DP-1} modules-left = bspwm modules-center = player-mpris-tail -modules-right = eth bluetooth volume memory cpu temperature system-usb-udev filesystem docker updates-arch-combined mail reddit github rss date +modules-right = eth bluetooth volume memory cpu temperature system-usb-udev filesystem docker updates-arch-combined mail reddit github rss weather date tray-position = right @@ -446,6 +446,12 @@ exec = ~/.config/polybar/bin/wireguard-status ;This doesn't work when run in the background for some reason click-left = ~/.local/bin/wireguard-switch +[module/weather] +type = custom/script +exec = curl --silent "https://wttr.in/?format=2" +click-left = setsid alacritty --class wttr,wttr -e ~/.config/polybar/bin/wttr-and-wait +interval = 900 + [settings] screenchange-reload = true ;compositing-background = xor