From 70c317381a2980f012024b9a8918556bd18441fa Mon Sep 17 00:00:00 2001 From: Siina Mashek Date: Tue, 6 Apr 2021 06:56:58 +0300 Subject: [PATCH] Moved weather from bashrc to script and updated vpn to use nordvpn --- common/song | 8 ++++++++ common/vpn | 6 +++--- common/weather | 3 ++- 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100755 common/song diff --git a/common/song b/common/song new file mode 100755 index 0000000..17abb51 --- /dev/null +++ b/common/song @@ -0,0 +1,8 @@ +#!/bin/sh + +player="spotifyd" +qdbus org.mpris.MediaPlayer2.$player /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata >/tmp/currentsong +artist=$(cat /tmp/currentsong | grep "xesam:artist" | sed 's/.*artist: //') +title=$(cat /tmp/currentsong | grep "xesam:title" | sed 's/.*title: //') + +echo ${artist} - ${title} diff --git a/common/vpn b/common/vpn index d95f2ae..8861a0d 100755 --- a/common/vpn +++ b/common/vpn @@ -1,12 +1,12 @@ #!/bin/sh if [ "$1" == "on" ]; then - cmd="c --p2p" + cmd="c P2P" elif [ "$1" == "off" ]; then cmd="d" elif [ "$1" == "status" ]; then - cmd="s" + cmd="status" else echo "Please pass an argument: on, off, status" exit fi -doas protonvpn $cmd +nordvpn $cmd diff --git a/common/weather b/common/weather index 18b330b..b2146e4 100755 --- a/common/weather +++ b/common/weather @@ -1,5 +1,6 @@ #!/bin/sh -WEATHER=$(curl -s wttr.in/?format='%l:+%C,+%t+(feels+like+%f)+Wind:+%w&M') +FORMAT="%C,+%t+(feels+like+%f)+Wind:+%w&M" +WEATHER=$(curl -s wttr.in/?format=$FORMAT) printf "$WEATHER\n"