summaryrefslogtreecommitdiff
path: root/i3/.config/i3blocks
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2020-10-02 10:16:37 +0100
committerUrbain Vaes <urbain@vaes.uk>2020-10-02 10:16:37 +0100
commit93eab33d13f8f30c8ba0088f20721d14c981fd16 (patch)
tree81625a57a7e915f3fe539fe3ccfd5bea3a7af22d /i3/.config/i3blocks
parent60496da375fa7355a0f01d0e3dd6bf8afc46ffe5 (diff)
parent104ca1e11721518f9224527459e8506a858692c9 (diff)
Merge branch 'master' of localhost:public/dotfiles into master
Diffstat (limited to 'i3/.config/i3blocks')
-rwxr-xr-xi3/.config/i3blocks/bin/battery15
-rw-r--r--i3/.config/i3blocks/config5
2 files changed, 11 insertions, 9 deletions
diff --git a/i3/.config/i3blocks/bin/battery b/i3/.config/i3blocks/bin/battery
index 378ee3f..0286809 100755
--- a/i3/.config/i3blocks/bin/battery
+++ b/i3/.config/i3blocks/bin/battery
@@ -5,7 +5,6 @@ if [ ! -d /sys/class/power_supply/BAT0 ]; then
exit
fi
-current_now=$(cat /sys/class/power_supply/BAT0/current_now)
charge_now=$(cat /sys/class/power_supply/BAT0/charge_now)
charge_full=$(cat /sys/class/power_supply/BAT0/charge_full)
bat_status=$(cat /sys/class/power_supply/BAT0/status)
@@ -16,7 +15,7 @@ if [ "$bat_status" = "Full" ]; then
fi
if [ "$bat_status" = "Discharging" ]; then
- tot_minutes_remaining=$(( charge_now*60/current_now ))
+ # tot_minutes_remaining=$(( charge_now*60/current_now ))
if [[ $charge_percent -lt 20 ]]; then
icon=""
@@ -36,14 +35,16 @@ if [ "$bat_status" = "Discharging" ]; then
fi
elif [ "$bat_status" = "Charging" ]; then
- tot_minutes_remaining=$(( (charge_full-charge_now)*60/current_now ))
+ # current_now=$(cat /sys/class/power_supply/BAT0/current_now)
+ # tot_minutes_remaining=$(( (charge_full-charge_now)*60/current_now ))
icon=
color="lightblue"
fi
-time_remaining=$(printf "%02d:%02d" \
- $(( tot_minutes_remaining/60 )) \
- $(( tot_minutes_remaining - (tot_minutes_remaining/60)*60 )))
+# time_remaining=$(printf "%02d:%02d" \
+# $(( tot_minutes_remaining/60 )) \
+# $(( tot_minutes_remaining - (tot_minutes_remaining/60)*60 )))
-echo "<span color='$color'>$icon</span> $charge_percent% ($time_remaining)"
+# echo "<span color='$color'>$icon</span> $charge_percent% ($time_remaining)"
+echo "<span color='$color'>$icon</span> $charge_percent%"
diff --git a/i3/.config/i3blocks/config b/i3/.config/i3blocks/config
index e736e7e..0f0c207 100644
--- a/i3/.config/i3blocks/config
+++ b/i3/.config/i3blocks/config
@@ -73,15 +73,16 @@ label=<span color='gray'></span>
command=echo $(free | grep '^Mem' | awk '{ printf "%3.0f%\n", 100*$3/$2 }')
interval=30
+# Requires i3blocks-contrib (AUR)
[diskhome]
label=<span color='gray'></span>
-command=/usr/lib/i3blocks/disk
+command=/usr/lib/i3blocks/disk/disk
instance=/home/urbain
interval=300
[diskroot]
label=<span color='gray'></span>
-command=/usr/lib/i3blocks/disk
+command=/usr/lib/i3blocks/disk/disk
instance=/
interval=300