blob: 79e28ea3fc2173a0f746751bd9054373a9f6e5d8 (
plain) (
blame)
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
46
47
48
49
50
|
#!/usr/bin/env bash
#./lemonbar.sh| lemonbar -f "DejaVuSansMono Nerd Font Mono-12" -g "x16"
NORMAL="%{F-}%{B-}"
sep_left=""
sep_right=""
sep_l_left=""
sep_l_right=""
DATETIME() {
DATETIME=$(date "+%a %b %d, %T")
echo -n " $DATETIME"
}
MEM_RAM() {
RESULT=$(free -m | sed "1d"| gawk '{if (NR==1){print int($3/100)/10"G""/"int($2/100)/10"G"}}')
echo -n " M:$RESULT"
}
MEM_SWAP() {
RESULT=$(free -m | sed "1d"| gawk '{if (NR==2){print int($3/100)/10"G""/"int($2/100)/10"G"}}')
echo -n " S:$RESULT"
}
HOME_FREE() {
RESULT=$("df" | grep "/home$" | gawk '{print int($4/100000)/10"G"}')
echo -n " HOME:$RESULT"
}
ROOT_FREE() {
RESULT=$("df" | grep "/$" | gawk '{print int($4/100000)/10"G"}')
echo -n " ROOT:$RESULT"
}
EXT1_FREE() {
RESULT=$("df" | grep "/home/devi/storage/ext1$" | gawk '{print int($4/100000)/10"G"}')
echo -n " EXT1:$RESULT"
}
DATETIME_SEGMENT="%{B#ff005f5f}%{F#ffcc6666}$sep_left%{B#ffcc6666}%{F#ffeeeeee}$(DATETIME)"
MEM_RAM_SEGMENT="%{B#ff0087ff}%{F#ff005f5f}$sep_left%{B#ff005f5f}%{F#ffeeeeee}$(MEM_RAM)"
MEM_SWAP_SEGMENT="%{B#ffff5f00}%{F#ff0087ff}$sep_left%{B#ff0087ff}%{F#ffeeeeee}$(MEM_SWAP)"
EXTRA_FREE_SEGMENT="%{B#ff875fd7}%{F#ffff5f00}$sep_left%{B#ffff5f00}%{F#ffeeeeee}$(EXT1_FREE)"
HOME_FREE_SEGMENT="%{B#ff5f00ff}%{F#ff875fd7}$sep_left%{B#ff875fd7}%{F#ffeeeeee}$(HOME_FREE)"
ROOT_FREE_SEGMENT="%{B#ff000000}%{F#ff5f00ff}$sep_left%{B#ff5f00ff}%{F#ffeeeeee}$(ROOT_FREE)"
while true; do
echo -e "%{r} $ROOT_FREE_SEGMENT $HOME_FREE_SEGMENT $EXTRA_FREE_SEGMENT $MEM_SWAP_SEGMENT $MEM_RAM_SEGMENT $DATETIME_SEGMENT $NORMAL"
sleep 60
done
|