aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2021-07-10 17:11:33 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2021-07-10 17:11:33 +0100
commitc6163358090bc5c4123f634f3bdd91c987c78aa4 (patch)
treee16307bd396db687e18803c02db32937b159f96b
parentbe603ca4a273d60992130c658a182380a7984f7c (diff)
downloaddotfiles-c6163358090bc5c4123f634f3bdd91c987c78aa4.tar.gz
dotfiles-c6163358090bc5c4123f634f3bdd91c987c78aa4.tar.bz2
dotfiles-c6163358090bc5c4123f634f3bdd91c987c78aa4.zip
(Scripts/status)~few minor edits for functionality and cleanliness
Status scripts needed some updating for dwmblocks, so did it.
-rwxr-xr-xScripts/.local/scripts/status/battery3
-rwxr-xr-xScripts/.local/scripts/status/memory3
-rwxr-xr-xScripts/.local/scripts/status/music2
-rwxr-xr-xScripts/.local/scripts/status/volume11
4 files changed, 5 insertions, 14 deletions
diff --git a/Scripts/.local/scripts/status/battery b/Scripts/.local/scripts/status/battery
index c3e40f0..2a17301 100755
--- a/Scripts/.local/scripts/status/battery
+++ b/Scripts/.local/scripts/status/battery
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
capacity=$(cat /sys/class/power_supply/BAT0/capacity) || break
status=$(cat /sys/class/power_supply/BAT0/status)
+time_left=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep "time to empty" | sed 's/.*://' | xargs echo $1)
if [[ $status == "Charging" ]]
then
@@ -22,4 +23,4 @@ else
status=""
fi
fi
-echo "$status $capacity%"
+echo "$status $capacity% $time_left"
diff --git a/Scripts/.local/scripts/status/memory b/Scripts/.local/scripts/status/memory
index 9f50677..042596d 100755
--- a/Scripts/.local/scripts/status/memory
+++ b/Scripts/.local/scripts/status/memory
@@ -3,5 +3,4 @@
line=$(free -m | sed -n 2p);
used=$(echo $line | awk '{print $3}');
available=$(echo $line | awk '{print $2}');
-echo "100 * $used / $available" | bc -l | xargs printf " %.2f" $1
-echo "%"
+echo "" $(printf "%dMB" $used) $(echo "100 * $used / $available" | bc -l | xargs printf "%.2f" $1)
diff --git a/Scripts/.local/scripts/status/music b/Scripts/.local/scripts/status/music
index a1e734e..9c982e0 100755
--- a/Scripts/.local/scripts/status/music
+++ b/Scripts/.local/scripts/status/music
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
title=$(playerctl --player=spotify metadata title)
-echo "${title::40}"
+echo "${title::40}"
diff --git a/Scripts/.local/scripts/status/volume b/Scripts/.local/scripts/status/volume
index cbbafbe..eedd657 100755
--- a/Scripts/.local/scripts/status/volume
+++ b/Scripts/.local/scripts/status/volume
@@ -1,11 +1,2 @@
#!/usr/bin/env bash
-sinks="$(pactl list sinks)"
-vol="$(echo "$sinks" | grep '[0-9]\+%' | sed "s,.* \([0-9]\+\)%.*,\1,;1q")"
-mute="$(echo "$sinks" | grep "Mute: " | sed "s/.*Mute: //g")"
-case "$mute" in
- "no")
- printf "";;
- "yes")
- printf "";;
-esac
-echo " $vol%"
+echo "" $(pamixer --get-volume-human)