From b2859688ba2d412098bcd539ac5e831c10c8c935 Mon Sep 17 00:00:00 2001 From: dx Date: Thu, 14 May 2020 18:04:02 +0100 Subject: +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. --- Scripts/.local/scripts/reboot_services | 4 +--- Scripts/.local/scripts/set_bar | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'Scripts') 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 -- cgit v1.2.3-13-gbd6f