diff options
author | Shubham Saini <shubham6405@gmail.com> | 2020-05-17 14:45:19 +0000 |
---|---|---|
committer | Shubham Saini <shubham6405@gmail.com> | 2020-05-17 14:45:19 +0000 |
commit | 73a9b71bc6f3a987d1c9e8601ffd85bd87c3eb51 (patch) | |
tree | cbf7de687f299adc14de72ed37c00f6fb2e9a708 /bin | |
parent | 5bc01819f4c9b453e5b66994217aa61260a49201 (diff) |
switched dwm
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/.local/bin/statusbar | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/bin/.local/bin/statusbar b/bin/.local/bin/statusbar index 00b5d2b..c506244 100755 --- a/bin/.local/bin/statusbar +++ b/bin/.local/bin/statusbar | |||
@@ -1,29 +1,45 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | 2 | ||
3 | BOLD='\033[1m' | 3 | # Color definitions. |
4 | BB='\033[00m' | 4 | export BLK="\e[30m" |
5 | export RED="\e[31m" | ||
6 | export GRN="\e[32m" | ||
7 | export YLW="\e[33m" | ||
8 | export BLU="\e[34m" | ||
9 | export PUR="\e[35m" | ||
10 | export CYN="\e[36m" | ||
11 | export RST="\e[0m" | ||
12 | |||
13 | # Other formatting. | ||
14 | export BLD="\e[1m" | ||
15 | export DIM="\e[2m" | ||
16 | export ITA="\e[3m" | ||
17 | export UND="\e[4m" | ||
18 | export FLS="\e[5m" | ||
19 | export REV="\e[7m" | ||
20 | export INV="\e[8m" | ||
21 | export STR="\e[9m" | ||
5 | 22 | ||
6 | vol(){ | 23 | vol(){ |
7 | vol=$(pulsemixer --get-volume | awk '{print $1}') | 24 | vol=$(pulsemixer --get-volume | awk '{print $1}') |
8 | echo -e "vol $vol% " | 25 | echo -e "vol $vol%" |
9 | } | 26 | } |
10 | 27 | ||
11 | bat() { | 28 | bat() { |
12 | power=$(cat /sys/class/power_supply/BAT0/capacity) | 29 | power=$(cat /sys/class/power_supply/BAT0/capacity) |
13 | echo -e "bat $power% " | 30 | echo -e "bat $power%" |
14 | } | 31 | } |
15 | 32 | ||
16 | dte() { | 33 | dte() { |
17 | dte=$(date +"%A, %B %d") | 34 | dte=$(date +"%A, %B %d") |
18 | echo -e "date $dte " | 35 | echo -e "date $dte" |
19 | } | 36 | } |
20 | 37 | ||
21 | tie() { | 38 | tie() { |
22 | tme=$(date +"%I:%M %p") | 39 | tme=$(date +"%I:%M %p") |
23 | echo -e "time $tme " | 40 | echo -e "time $tme" |
24 | } | 41 | } |
25 | |||
26 | while :; do | 42 | while :; do |
27 | echo "$(vol) $(bat) $(tie) $(dte)" | 43 | echo "$(vol) $(bat) $(tie) $(dte)" |
28 | sleep 2 | 44 | sleep 2 |
29 | done | 45 | done |