-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnews
More file actions
executable file
·42 lines (36 loc) · 1016 Bytes
/
news
File metadata and controls
executable file
·42 lines (36 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
# shellcheck disable=1090,2154
label=
. ~/.cache/wal/colors.sh
blockcolor=$color9
txtcolor=$color0
case $BLOCK_BUTTON in
1) # Left Click
$TERMINAL --class float -e newsboat
;;
2) # Middle Click
systemctl --user restart nbupdate
;;
3) # Right Click
;;
esac
[ ! -f ~/.local/share/newsboat/cache.db.lock ] &&
newsboat -x print-unread | awk '{print $1}' > ~/.local/share/newsboat/unread
if [ -z "$(cat ~/.local/share/newsboat/unread)" ]; then
if [ -f /tmp/nbupdate ]; then
command=""
else
command=""
fi
else
if [ -f /tmp/nbupdate ]; then
command="$(cat ~/.local/share/newsboat/unread) "
else
command="$(cat ~/.local/share/newsboat/unread)"
fi
fi
printf "\
<b><span foreground='$blockcolor' background='$color0'></span>\
<span foreground='$txtcolor' background='$blockcolor'> %s </span>\
<span foreground='$color0' background='$blockcolor'></span></b>\n" \
"$label $command"