forked from yshui/.files
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwmiirc_local
158 lines (156 loc) · 4.27 KB
/
wmiirc_local
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/bin/dash -f
MODKEY=Mod4
#WMII_FONT="xft:WenQuanYi Micro Hei Light Mono-9"
WMII_FONT="xft:sans-9"
WMII_TERM="urxvtc"
#WMII_NORMCOLORS='#000000 #333333 #000000'
#WMII_FOCUSCOLORS='#000000 #ffffff #000000'
WMII_FOCUSCOLORS='#EEEEEE #005577 #006699'
WMII_BACKGROUND='#111111'
WMII_NORMCOLORS='#BBBBBB #222222 #000000'
status() {
# echo -n label $(acpi -b | sed 's/Battery\s*[0-9]:\s*//g;s/\([0-9]\)[^0-9]*$/\1/g') '|' \
# $(sensors | grep --color=never 'Core' | sed 's/.*Core */CPU/g' | sed 's/(.*)//g') '|' \
# $(mpc | sed -r 'N;s/\n/ /g;N;s/\n/ /g;s/\[(playing|(p)aused)\]/\u\2/g;s/#//g;s/volume: */Vo:/g;s/\S*: *off//g;s/(\S\S)\S*: *on/\u\1 /g;s/\s+/ /g;s/\s+$//g;s|[0-9]+/[0-9]+||g;s/\s+[0-9]+:+[0-9]+//g;s/\([0-9]*%\)\s//g') '|' \
echo -n label $(date +"%Y/%m/%d,%a,%H:%M:%S")
}
startup() {
export WMII_FOCUSCOLORS='#EEEEEE #005577 #006699'
export WMII_BACKGROUND='#111111'
export WMII_NORMCOLORS='#BBBBBB #222222 #000000'
urxvtd -q -o -f &
xset m 8/5 3/2
witray -s 16 &
wmiir xwrite /ctl "focuscolors $WMII_FOCUSCOLORS"
wmiir xwrite /ctl "normcolors $WMII_NORMCOLORS"
wmiir write /rules <<!
/MPlayer|VLC/ floating=on
/^ROX-Filer:/ group=0
/wesnoth.*/ floating=on
/Gimp/ floating=on
/Are you sure/ floating=on
/^skype.*Options$/ floating=on
/fetion/ floating=on
/gmpc/ tags=music
!
/home/shui/.conky/conky.sh &
}
local_events(){
wi_events <<'!'
Event Unresponsive
wmiir xwrite /client/$1/tags "UNRES"
Menu Client-3-Kill
wmiir xwrite /client/$1/ctl slay &
Menu Client-3-Delete
wmiir xwrite /client/$1/ctl kill &
#Event RightBarMouseDown
# if [ "$2" = "weather" ]; then
# if [ $1 = 1 ]; then
#wmii9menu $(/home/shui/getweather)
# wmii9menu showeather
# fi
# fi
Event ClientMouseDown
if [ $2 = 3 ]; then
wi_fnmenu Client $2 $1 &
fi
if [ $2 = 4 ]; then
wmiir xwrite /tag/sel/ctl select up
fi
if [ $2 = 5 ]; then
wmiir xwrite /tag/sel/ctl select down
fi
if [ $2 = 6 ]; then
wmiir xwrite /tag/sel/ctl send sel left
fi
if [ $2 = 7 ]; then
wmiir xwrite /tag/sel/ctl send sel right
fi
KeyGroup Custom
Key $MODKEY-z
mpc toggle
Key $MODKEY-v
mpc next
Key $MODKEY-c
mpc prev
Key $MODKEY-x
mpc shuffle
Key $MODKEY-Shift-r
mpc repeat
Key $MODKEY-Shift-s
mpc single
Key $MODKEY-w
mpc volume +3
Key $MODKEY-q
mpc volume -3
Key $MODKEY-r
mpc seek +3%
Key $MODKEY-e
mpc seek -3%
Key $MODKEY-Shift-z
isplaying=$(mpc | grep -c '\[play')
mpc update
mpc clear
mpc ls | mpc add
[ $isplaying = 0 ] || mpc toggle
Key $MODKEY-Control-z
isplaying=$(mpc | grep -c '\[play')
mpc update
export tmpname="$(mpc listall | /home/shui/dlist.pl | sort -u | sed 's/^$/ /g'| wimenu)"
echo "$tmpname" >> /home/shui/tmptmptmp
if [ "x$tmpname" != "x" ]; then
mpc clear
echo $tmpname | mpc add
fi
[ $isplaying = 0 ] || mpc toggle
Key $MODKEY-Shift-b
/home/shui/mysync.sh &
Key $MODKEY-Control-l
xlock &
Key $MODKEY-Control-s
ibus-daemon -r -d --xim
feh --bg-scale ~/pictures/sh.jpg
gmpc &
nm-applet &
urxvtc
Key $MODKEY-Shift-x
mpc playlist > ~/.mympcplaylist
sed -r -i 's/(.*)/\L\1/' ~/.mympcplaylist
export tmpname="$(cat ~/.mympcplaylist | sed 's/^$/ /g' | wimenu)"
if [ "x$tmpname" != "x" ]; then
mpc play $(cat ~/.mympcplaylist | grep -F --color=never -n "$tmpname" | sed 's/:.*$//')
fi
Key $MODKEY-mod1-space
isplaying=$(mpc | grep -c '\[play')
a=`echo 'any\nArtist\nAlbum\nAlbumArtist\nTitle\nTrack\nName\nGenre\nDate\nComposer\nPerformer\nComment\nDisc' | wimenu`
if [ "$?" = "0" ]; then
if [ $a != "any" ]; then
b=`mpc list $a | sed 's/^$/ /g' | wimenu`
if [ "$?" = "0" ]; then
mpc clear
mpc search $a "$b" | mpc add
[ $isplaying = 0 ] || mpc toggle
fi
else
b=`echo ' ' | wimenu`
if [ "$?" = "0" ]; then
c=`mpc search $a "$b"| sed 's/^$/ /g' | wimenu`
if [ "$?" = "0" ]; then
mpc clear
echo $c | mpc add
[ $isplaying = 0 ] || mpc toggle
fi
fi
fi
fi
Key $MODKEY-Control-w
notify-send -t 0 Weather "`perl programs/ttrss.pl `"
Key XF86AudioRaiseVolume
amixer sset 'Master' 6%+
echo -n label $(amixer sget 'Master' | grep --color=never 'Mono[^\[]*\[[0-9]*%\]' | sed -r 's/^.*\[([0-9]*%)\].*$/\1/') | wmiir write /rbar/status
Key XF86AudioLowerVolume
amixer sset 'Master' 6%-
echo -n label $(amixer sget 'Master' | grep --color=never 'Mono[^\[]*\[[0-9]*%\]' | sed -r 's/^.*\[([0-9]*%)\].*$/\1/') | wmiir write /rbar/status
!
true;
}