-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbar.sh
executable file
·38 lines (33 loc) · 837 Bytes
/
bar.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
#INTERFACE=wlp3s0
#
##old rx and tx counts
#RXB='cat /sys/class/net/$INTERFACE/statistics/rx_bytes'
#TXB='cat /sys/class/net/$INTERFACE/statistics/tx_bytes'
#
#getNet(){
#
# RXBN='cat /sys/class/net/$INTERFACE/statistics/rx_bytes'
# TXBN='cat /sys/class/net/$INTERFACE/statistics/tx_bytes'
#
# RXR='echo '
# RXR=`echo "($RXBN - $RXB) / 1024 / $SLEEP" | xargs printf "%.2f"`
# TXR=`echo "($TXBN - $TXB) / 1024 / $SLEEP" | xargs printf "%.2f"`
# echo -ne "up : $RXR kB/s down : $TXR kB/s "
#
#}
##| bc -l
space(){
echo ' | '
}
getDate(){
date '+%m-%d %H:%M ' #print current date
}
getBat(){
BATC=/sys/class/power_supply/BAT0/capacity
BATS=/sys/class/power_supply/BAT0/status
echo -n "BAT: "
test "`cat $BATS`" = "Charging" && echo -n '+' || echo -n '-'
sed -n p $BATC
}
xsetroot -name "$(getBat)$(space)$(getDate)"