-
Notifications
You must be signed in to change notification settings - Fork 1
/
.xinitrc
executable file
·76 lines (70 loc) · 1.85 KB
/
.xinitrc
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/sh
compton &
#picom -CGb &
#sudo apt-get install libx11-dev xorg xorg-dev
#sudo apt-get install compton feh sysstat xsetroot alsa-utils dmenu
#
feh --bg-scale ~/.image/7.jpg
#~/feh.sh &
dwm_cpu()
{
#CPU=$(sar -u 1 1 | grep Average | awk '{printf $3+$5}')
#printf ":%.2f%%" "$CPU"
sar -u 1 1 | sed -n '4{p;q}' | awk '{printf (":%d", $3+$5)}'
}
dwm_net()
{
#sar -n DEV 1 1 | sed -n '4{p;q}' | awk '{printf ("%3.1fk %3.1fk\n", $3,$4)}'
cat /proc/net/dev | sed -n '3{p;q}' | awk '{printf ("%2.2fk %2.2fk\n", ( $3 / 1024),($11/1024) )}'
}
dwm_date () {
#date "+%H:%M:%S"
date | awk '{printf ("%s%s %s %s",$2,$3,$4,$5)}'
}
dwm_alsa () {
VOL=$(amixer get Master | tail -n1 | sed -r "s/.*\[(.*)%\].*/\1/")
printf "%s" "$SEP1"
if [ "$IDENTIFIER" = "unicode" ]; then
if [ "$VOL" -eq 0 ]; then
printf ""
elif [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then
printf "%s%%" "$VOL"
elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then
printf " %s%%" "$VOL"
else
printf " %s%%" "$VOL"
fi
else
if [ "$VOL" -eq 0 ]; then
printf "MUTE"
elif [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then
printf "%s%%" "$VOL"
elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then
printf "%s%%" "$VOL"
else
printf "%s%%" "$VOL"
fi
fi
printf "%s\n" "$SEP2"
}
dwm_df()
{
printf "%s%s%s\n" "$(df -h / | awk ' /[0-9]/ {print $4"<"$2}')"
}
dwm_weather()
{
curl -sf 'wttr.in/GuangZhou?format=1'
}
dwm_free()
{
free --mebi | sed -n '2{p;q}' | awk '{printf ("%2.2fG<%2.2fG\n", ( $4 / 1024),($2/1024) )}'
}
dwm_xxx()
{
sarr
}
while xsetroot -name "":"$(dwm_free) ":"$(dwm_df) "墳:"$(dwm_alsa) "ﮮ:"$(dwm_date)"
do
sleep 1 # refresh per 1s
done &
exec dwm