diff options
author | Yaroslav <contact@yaroslavps.com> | 2020-04-06 09:23:11 +0300 |
---|---|---|
committer | Yaroslav <contact@yaroslavps.com> | 2020-04-06 09:23:11 +0300 |
commit | 4025848a7bbcc789b194940fc3c2aa9020b1aaa1 (patch) | |
tree | aac8b8c4a6d2ea4867e05c958d0d832c618a94ac | |
parent | 4e7f7cd77cb2d66aefa7ab574d1f6edf66482f41 (diff) | |
download | swayrice-4025848a7bbcc789b194940fc3c2aa9020b1aaa1.tar.gz swayrice-4025848a7bbcc789b194940fc3c2aa9020b1aaa1.zip |
show unread rss articles on waybar
-rw-r--r-- | dotfiles/.config/waybar/config | 11 | ||||
-rw-r--r-- | dotfiles/.config/waybar/style.css | 1 | ||||
-rwxr-xr-x | dotfiles/.local/bin/barnewsstatus | 12 | ||||
-rwxr-xr-x | dotfiles/.local/bin/newssync | 13 |
4 files changed, 36 insertions, 1 deletions
diff --git a/dotfiles/.config/waybar/config b/dotfiles/.config/waybar/config index a0f95ba..a708bb1 100644 --- a/dotfiles/.config/waybar/config +++ b/dotfiles/.config/waybar/config @@ -19,6 +19,7 @@ "custom/ds4battery", "backlight", "custom/pac-status", + "custom/news-status", "custom/vpn-status", "network", "battery#bat0", @@ -180,7 +181,15 @@ "format": "<span color=\"#5b8277\"></span> {}", "signal": 7, "interval": "once", - "exec": "barpacstatus" + "exec": "barpacstatus", + "tooltip": false + }, + "custom/news-status": { + "format": "<span color=\"#5b8277\"></span> {}", + "signal": 8, + "interval": "once", + "exec": "barnewsstatus", + "tooltip": false }, "custom/weather": { "format": "{}", diff --git a/dotfiles/.config/waybar/style.css b/dotfiles/.config/waybar/style.css index ce29c25..75f63a3 100644 --- a/dotfiles/.config/waybar/style.css +++ b/dotfiles/.config/waybar/style.css @@ -66,6 +66,7 @@ window#waybar { #custom-rec-status, #custom-vpn-status, #custom-pac-status, +#custom-news-status, #custom-swaykbd { padding: 0 6px; } diff --git a/dotfiles/.local/bin/barnewsstatus b/dotfiles/.local/bin/barnewsstatus new file mode 100755 index 0000000..77457aa --- /dev/null +++ b/dotfiles/.local/bin/barnewsstatus @@ -0,0 +1,12 @@ +#!/bin/sh + +if [ -f ~/.cache/newssynclive ]; then + echo "syncing" + exit +fi + +unreadno=$(newsboat -x print-unread | cut -f1 -d' ') + +if [ $unreadno -gt 0 ]; then + echo $unreadno +fi diff --git a/dotfiles/.local/bin/newssync b/dotfiles/.local/bin/newssync new file mode 100755 index 0000000..0c0e866 --- /dev/null +++ b/dotfiles/.local/bin/newssync @@ -0,0 +1,13 @@ +#!/bin/sh + +ping -q -c 1 1.1.1.1 > /dev/null || exit + +. ~/.cache/sessionenv + +touch ~/.cache/newssynclive +killall -42 waybar + +newsboat -x reload || true + +rm -f ~/.cache/newssynclive +killall -42 waybar |