diff --git a/scripts/README.md b/scripts/README.md index 02a62d9..6898f11 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -2,4 +2,4 @@ For these custom scripts to work, you need to add `$HOME/.local/bin` to your `PATH`. If you use my Zsh config, this is already taken care of. -My scripts use the `dash` shell as the interpreter (the shebang line), so install that to use them. Othewise, change `#!/usr/bin/env dash` to `#!/usr/bin/env bash` or anything else that suits you. +My scripts use the `dash` shell as the interpreter (the shebang line), so install that to use them. Otherwise, change `#!/usr/bin/env dash` to `#!/usr/bin/env bash` or anything else that suits you. diff --git a/waybar/.config/waybar/ivpn-reconnect.sh b/waybar/.config/waybar/ivpn-reconnect.sh index 0cdc255..6a0fb9d 100755 --- a/waybar/.config/waybar/ivpn-reconnect.sh +++ b/waybar/.config/waybar/ivpn-reconnect.sh @@ -1,5 +1,7 @@ -#!/bin/sh +#!/usr/bin/env dash -ivpn connect -last \ - && notify-send -u low "IVPN" "Successfully reconnected to IVPN server:\n$(ivpn status | sed -n 2p | xargs)" \ - || notify-send -u critical "IVPN" "Failed to reconnect to IVPN\!" +if ivpn connect -last; then + notify-send -u low "IVPN" "Successfully reconnected to IVPN server:\n$(ivpn status | sed -n 2p | xargs)" +else + notify-send -u critical "IVPN" "Failed to reconnect to IVPN\!" +fi diff --git a/waybar/.config/waybar/ivpn-status.sh b/waybar/.config/waybar/ivpn-status.sh index f01b2d5..e361721 100755 --- a/waybar/.config/waybar/ivpn-status.sh +++ b/waybar/.config/waybar/ivpn-status.sh @@ -1,14 +1,13 @@ -#!/bin/sh +#!/usr/bin/env dash STATUS=`ivpn status | awk '{print "\\\n"$0}' | head -n -1` -TOOLTIP=`echo -E ${STATUS} | cut -c 3-` -CLASS=`echo ${STATUS} | grep 'VPN' | awk '{print $3}' | tr [:upper:] [:lower:]` -TEXT="" +TOOLTIP=`env echo -E ${STATUS} | cut -c 3-` +CLASS=`env echo ${STATUS} | grep 'VPN' | awk '{print $3}' | tr [:upper:] [:lower:]` -if [ "$CLASS" == "connected" ]; then +if [ "$CLASS" = "connected" ]; then TEXT="\uf084" # key else TEXT="\uf071" # exclamation-triangle fi -echo "{\"text\": \"${TEXT}\", \"tooltip\": \"${TOOLTIP}\", \"class\": \"${CLASS}\"}" +env echo "{\"text\": \"${TEXT}\", \"tooltip\": \"${TOOLTIP}\", \"class\": \"${CLASS}\"}" diff --git a/waybar/README.md b/waybar/README.md index 96404f5..781d6dd 100644 --- a/waybar/README.md +++ b/waybar/README.md @@ -1,3 +1,5 @@ # Waybar config This is a beautifully styled config for Waybar, featuring a solarized dark coloscheme and a custom module for showing IVPN connection status (thus requires IVPN client). + +Note that the included IVPN scripts use the `dash` shell as the interpreter (the shebang line), so install that to use them. Otherwise, change `#!/usr/bin/env dash` to `#!/usr/bin/env bash` or anything else that suits you.