~kiwec/dotfiles

ref: 1013c30993ca4a94301347ddc24b20b7ccfef92e dotfiles/.config/i3status/cmus.sh -rwxr-xr-x 435 bytes
1013c309 — Wolf Clement Wireguard VPN detection 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

i3status | while :
do
	read line

	ip addr | grep 10\\. > /dev/null
	if [ $? -eq 1 ]; then
		line="$line  no vpn"
	else
		line="$line  vpn ok"
	fi

	artist=$(cmus-remote -Q | grep ' artist ' | cut -d ' ' -f3-)
	title=$(cmus-remote -Q | grep ' title ' | cut -d ' ' -f3-)

	if [ -n "$(cmus-remote -Q | grep "status playing")" ]; then
		echo "$artist - $title  |  $line  " || exit 1
	else
		echo "$line  " || exit 1
	fi
done