mirror of
https://github.com/kuhyx/scripts.git
synced 2026-11-20 15:12:24 +01:00
feat: add battery info
This commit is contained in:
parent
65a73b34c2
commit
42f582a6d3
12
i3blocks/battery_status.sh
Executable file
12
i3blocks/battery_status.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
acpi -b | awk -F', ' '
|
||||||
|
/Battery/ {
|
||||||
|
split($2, percent, "%")
|
||||||
|
split($3, time, " ")
|
||||||
|
printf " Battery: %d%%", percent[1]
|
||||||
|
if (time[1] != "") printf ", %s", time[1]
|
||||||
|
if ($1 ~ /Charging/) printf ", Charging"
|
||||||
|
printf "\n"
|
||||||
|
}'
|
||||||
|
|
||||||
@ -11,7 +11,6 @@ markup=pango
|
|||||||
command=~/.config/i3blocks/motherboard_temp.sh
|
command=~/.config/i3blocks/motherboard_temp.sh
|
||||||
interval=10
|
interval=10
|
||||||
|
|
||||||
|
|
||||||
[memory]
|
[memory]
|
||||||
command=free -h | awk '/^Mem:/ {print "RAM: " $3 "/" $2}' # for RAM
|
command=free -h | awk '/^Mem:/ {print "RAM: " $3 "/" $2}' # for RAM
|
||||||
interval=10
|
interval=10
|
||||||
@ -30,6 +29,10 @@ interval=1
|
|||||||
command=~/.config/i3blocks/bluetooth.sh
|
command=~/.config/i3blocks/bluetooth.sh
|
||||||
interval=5
|
interval=5
|
||||||
|
|
||||||
|
[battery]
|
||||||
|
command=~/.config/i3blocks/battery_status.sh
|
||||||
|
interval=30
|
||||||
|
color=#50FA7B
|
||||||
|
|
||||||
[ethernet]
|
[ethernet]
|
||||||
command=ip -o -4 addr show enp6s0 | awk '{print " LAN: "$4}' || echo " LAN: down" # for Ethernet
|
command=ip -o -4 addr show enp6s0 | awk '{print " LAN: "$4}' || echo " LAN: down" # for Ethernet
|
||||||
@ -43,3 +46,5 @@ interval=1
|
|||||||
command=echo " $(date '+%Y-%m-%d %H:%M')" # for time (Font Awesome icon)
|
command=echo " $(date '+%Y-%m-%d %H:%M')" # for time (Font Awesome icon)
|
||||||
interval=1
|
interval=1
|
||||||
color=#50FA7B
|
color=#50FA7B
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,4 +3,3 @@ sudo pacman -S --needed ttf-dejavu noto-fonts ttf-font-awesome
|
|||||||
cp -r i3blocks ~/.config/
|
cp -r i3blocks ~/.config/
|
||||||
cp -r i3 ~/.config/
|
cp -r i3 ~/.config/
|
||||||
i3-msg reload
|
i3-msg reload
|
||||||
reload
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user