diff options
author | dx <aryadevchavali1@gmail.com> | 2020-05-14 18:04:02 +0100 |
---|---|---|
committer | dx <aryadevchavali1@gmail.com> | 2020-05-14 18:07:02 +0100 |
commit | b2859688ba2d412098bcd539ac5e831c10c8c935 (patch) | |
tree | 8c2ca42f0c10f6426405e5596c692fb56147faae | |
parent | d20fcb86b844a3ed0cdb3973fbdcd91591227592 (diff) | |
download | dotfiles-b2859688ba2d412098bcd539ac5e831c10c8c935.tar.gz dotfiles-b2859688ba2d412098bcd539ac5e831c10c8c935.tar.bz2 dotfiles-b2859688ba2d412098bcd539ac5e831c10c8c935.zip |
+connections block for dwmbar
Basically checks if connected to some form of internet, and prints
'Connected' or 'Not connected'. Removed the applet refresh because this
is better. If I need access to those managers, I'll just launch them.
-rwxr-xr-x | Scripts/.local/scripts/reboot_services | 4 | ||||
-rwxr-xr-x | Scripts/.local/scripts/set_bar | 18 |
2 files changed, 15 insertions, 7 deletions
diff --git a/Scripts/.local/scripts/reboot_services b/Scripts/.local/scripts/reboot_services index 85f0c88..2555d64 100755 --- a/Scripts/.local/scripts/reboot_services +++ b/Scripts/.local/scripts/reboot_services @@ -1,8 +1,6 @@ #!/bin/bash -killall nm-applet; -killall blueman-applet; killall sxhkd; killall mpd; -nm-applet & blueman-applet & refresh_bar & mpd & sxhkd; +refresh_bar & mpd & sxhkd; diff --git a/Scripts/.local/scripts/set_bar b/Scripts/.local/scripts/set_bar index 06271fe..c139115 100755 --- a/Scripts/.local/scripts/set_bar +++ b/Scripts/.local/scripts/set_bar @@ -7,8 +7,8 @@ timedate() { } battery() { - capacity=$(cat /sys/class/power_supply/BAT0/capacity) || break - status=$(cat /sys/class/power_supply/BAT0/status) + capacity=$(cat /sys/class/power_supply/BAT0/capacity) || break + status=$(cat /sys/class/power_supply/BAT0/status) if [[ $status == "Charging" ]] then @@ -42,7 +42,7 @@ volume() { icon="" elif [[ $vol -gt 10 ]] then - icon="" + icon="" else icon="" fi @@ -58,7 +58,17 @@ disk() { echo $(df | grep /dev/sda2 | awk '{print $5}') } +connections() { + internet=$(nmcli g | sed -n 2p | awk '{print $1}') + if [[ $internet == "connected" ]] + then + echo "Connected" + else + echo "Not connected" + fi +} + while true; do - xsetroot -name "Meme level at $(disk) $delimiter $(ram) $delimiter $(volume) $delimiter $(battery) $delimiter $(timedate)" + xsetroot -name "Meme level at $(disk) $delimiter $(ram) $delimiter $(volume) $delimiter $(battery) $delimiter $(connections) $delimiter $(timedate)" sleep 30s; done |