aboutsummaryrefslogtreecommitdiff
path: root/Scripts/.local/scripts/set_bar
diff options
context:
space:
mode:
authordx <aryadevchavali1@gmail.com>2020-05-14 18:04:02 +0100
committerdx <aryadevchavali1@gmail.com>2020-05-14 18:07:02 +0100
commitb2859688ba2d412098bcd539ac5e831c10c8c935 (patch)
tree8c2ca42f0c10f6426405e5596c692fb56147faae /Scripts/.local/scripts/set_bar
parentd20fcb86b844a3ed0cdb3973fbdcd91591227592 (diff)
downloaddotfiles-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.
Diffstat (limited to 'Scripts/.local/scripts/set_bar')
-rwxr-xr-xScripts/.local/scripts/set_bar18
1 files changed, 14 insertions, 4 deletions
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