From 990568295b925739eece3d573170df7d6e6bfd8c Mon Sep 17 00:00:00 2001 From: Luke Else Date: Wed, 21 Sep 2022 20:51:46 +0100 Subject: [PATCH] Added Statusbad Commands (Not in correct location) --- statusbar/dwm_battery | 25 +++++++++++++++++++++++++ statusbar/dwm_brightness | 5 +++++ statusbar/dwm_clock | 4 ++++ statusbar/dwm_cpu_temp | 6 ++++++ statusbar/dwm_date | 4 ++++ statusbar/dwm_kernel | 7 +++++++ statusbar/dwm_keyboard_layout | 6 ++++++ statusbar/dwm_memory | 4 ++++ statusbar/dwm_network | 14 ++++++++++++++ statusbar/dwm_traffic | 23 +++++++++++++++++++++++ statusbar/dwm_uptime | 4 ++++ statusbar/dwm_volume | 23 +++++++++++++++++++++++ 12 files changed, 125 insertions(+) create mode 100755 statusbar/dwm_battery create mode 100755 statusbar/dwm_brightness create mode 100755 statusbar/dwm_clock create mode 100755 statusbar/dwm_cpu_temp create mode 100755 statusbar/dwm_date create mode 100755 statusbar/dwm_kernel create mode 100755 statusbar/dwm_keyboard_layout create mode 100755 statusbar/dwm_memory create mode 100755 statusbar/dwm_network create mode 100755 statusbar/dwm_traffic create mode 100755 statusbar/dwm_uptime create mode 100755 statusbar/dwm_volume diff --git a/statusbar/dwm_battery b/statusbar/dwm_battery new file mode 100755 index 0000000..fd921b3 --- /dev/null +++ b/statusbar/dwm_battery @@ -0,0 +1,25 @@ +#!/bin/bash + +bat_capacity=$(/dev/null) ]]; then + ssid=$(nmcli -t -f name connection show --active | head -n 1) + wireless_icon=" ^c#f7ca88^$ssid^d^" +elif [[ $(grep "" /sys/class/net/eth0/* 2>/dev/null) ]]; then + wired_icon=" ^c#f7ca88^LAN^d^" +fi + +if [[ $(nmcli con show --active | grep -i vpn 2>/dev/null) ]]; then + vpn_icon="旅 " +fi + +printf "$vpn_icon$wired_icon$wireless_icon" diff --git a/statusbar/dwm_traffic b/statusbar/dwm_traffic new file mode 100755 index 0000000..b67c4ae --- /dev/null +++ b/statusbar/dwm_traffic @@ -0,0 +1,23 @@ +#!/bin/bash + +cache_path=~/.cache/.traffic + +old_rx=$(head -n 1 $cache_path) +old_tx=$(tail -1 $cache_path) + +printf "0\n0\n" > $cache_path + +NETWORK_INTERFACE=$(ip route get 1.1.1.1 | grep -Po '(?<=dev\s)\w+' | cut -f1 -d ' ') + +new_rx=`