diff --git a/INSTALL.md b/INSTALL.md index 8264019..c2d1bb7 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -48,7 +48,8 @@ To enable plugins set up the `@dracula-plugins` option in you `.tmux.conf` file, The order that you define the plugins will be the order on the status bar left to right. ```bash -# available plugins: battery, cpu-usage, git, gpu-usage, ram-usage, network, network-bandwidth, network-ping, attached-clients, weather, time +# available plugins: battery, cpu-usage, git, gpu-usage, ram-usage, network, network-bandwidth, network-ping, attached-clients, network-vpn, weather, time + set -g @dracula-plugins "cpu-usage gpu-usage ram-usage" ``` @@ -210,13 +211,13 @@ set -g @dracula-git-disable-status true Set symbol to use for when branch is up to date with HEAD ```bash -# default is ✓. Avoid using non unicode characters that bash uses like $, * and ! +# default is ✓. Avoid using non unicode characters that bash uses like $, * and ! set -g @dracula-git-show-current-symbol ✓ ``` Set symbol to use for when branch diverges from HEAD ```bash -# default is unicode !. Avoid bash special characters +# default is unicode !. Avoid bash special characters set -g @dracula-git-show-diff-symbol ! ``` diff --git a/scripts/dracula.sh b/scripts/dracula.sh index e5da329..43f8b8f 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -139,7 +139,6 @@ main() IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-git-colors" "green dark_gray") tmux set-option -g status-right-length 250 script="#($current_dir/git.sh)" - elif [ $plugin = "battery" ]; then IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-battery-colors" "pink dark_gray") @@ -170,6 +169,10 @@ main() IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-network-ping-colors" "cyan dark_gray") script="#($current_dir/network_ping.sh)" + elif [ $plugin = "network-vpn" ]; then + IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-network-vpn-colors" "cyan dark_gray") + script="#($current_dir/network_vpn.sh)" + elif [ $plugin = "attached-clients" ]; then IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-attached-clients-colors" "cyan dark_gray") script="#($current_dir/attached_clients.sh)" diff --git a/scripts/network_vpn.sh b/scripts/network_vpn.sh new file mode 100755 index 0000000..74b1eea --- /dev/null +++ b/scripts/network_vpn.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# setting the locale, some users have issues with different locales, this forces the correct one +export LC_ALL=en_US.UTF-8 + +current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +source $current_dir/utils.sh + +vpn_function() { + case $(uname -s) in + Linux) + # TODO + ;; + + Darwin) + vpn=$(scutil --nc list | grep Connected) + + if [ -z $vpn ]; then + echo "" + else + echo "VPN" + fi + ;; + + CYGWIN* | MINGW32* | MSYS* | MINGW*) + # TODO - windows compatability + ;; + esac +} + +main() { + + echo $(vpn_function) +} + +# run main driver +main