summaryrefslogtreecommitdiff
path: root/bin/.bin/statusbar
blob: c506244d2ce2e70b4a4c8849c7a4f808c781c54b (plain)
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
39
40
41
42
43
44
45
#!/bin/bash

# Color definitions.
export BLK="\e[30m"
export RED="\e[31m"
export GRN="\e[32m"
export YLW="\e[33m"
export BLU="\e[34m"
export PUR="\e[35m"
export CYN="\e[36m"
export RST="\e[0m"

# Other formatting.
export BLD="\e[1m"
export DIM="\e[2m"
export ITA="\e[3m"
export UND="\e[4m"
export FLS="\e[5m"
export REV="\e[7m"
export INV="\e[8m"
export STR="\e[9m"

vol(){
    vol=$(pulsemixer --get-volume | awk '{print $1}')
	echo -e "vol $vol%"
}

bat() {
	power=$(cat /sys/class/power_supply/BAT0/capacity)
	echo -e "bat $power%"
}

dte() {
  dte=$(date +"%A, %B %d")
  echo -e "date $dte"
}

tie() {
  tme=$(date +"%I:%M %p")
  echo -e "time $tme"
}
while :; do
   echo "$(vol) $(bat) $(tie) $(dte)" 
	sleep 2
done