forked from skx/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.kpie.lua
145 lines (114 loc) · 2.93 KB
/
.kpie.lua
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
--
-- Configuration for KPie
--
if ( DEBUG ) then
print( "Title " .. window_title() )
print( "\tApplication: " .. window_application() )
print( "\tClass " .. window_class() )
end
--
-- The music-player should be on all windows
--
if ( window_class() == "sonata" ) then
pin()
minimize()
end
--
-- Media players deserve to be always-on-top
--
-- NOTE: Xine will update its title/application/class to include the
-- name of the media that is being played.
--
--
if ( ( string.sub(window_application(), 0, 5) == "xine:" ) or
( window_application() == "MPlayer" ) or
( window_application() == "Totem Movie Player" ) ) then
above()
end
--
-- Web-browsers.
--
-- I use three browsers, constantly:
--
-- * iceweasel in the first desktop
--
-- * epiphany in the third destkop (gaim is in desktop2)
-- * Match on both "class" and "application" to be sure we find it.
--
-- * chromium in the fourth destkop
-- * Look for a suffix of ' - Chromium' in the title to find it.
--
--
-- Chromium
--
if ( string.match( window_application(), " - Chromium$" ) ) then
workspace(4)
if ( not is_maximized() ) then maximize() end
end
--
-- Epiphany
--
if ( window_class() == "Epiphany-browser" ) then
workspace(3)
if ( not is_maximized() ) then maximize() end
end
--
-- Iceweasel
--
if ( window_application() == "Iceweasel" ) then
workspace(1)
if ( not is_maximized() ) then maximize() end
end
--
-- HipChat goes to workspace 2.
--
if ( window_class() == "HipChat" ) then
workspace(2)
if ( not is_maximized() ) then maximize() end
end
--
-- This is configuration for Pidgin.
--
-- The rough layout is a pair of windows looking like this, on workspace 2:
--
-- ---------------------------------------
-- | Chat Window | Buddy List |
-- | | |
-- ---------------------------------------
--
-- The values are calculated by looking at the screen-size, with the
-- buddy-list occupying 1/5th of the screen estate.
--
--
if ( window_class() == "Pidgin" ) then
-- The width/height of the screen.
width = screen_width()
height = screen_height()
-- The buddy window will be 1/5 of the screen width.
buddy = width / 5;
--
-- Move the buddy-window to the correct location
--
if ( window_title() == "Buddy List" ) then
if ( is_maximized() ) then unmaximize() end
if ( is_minimized() ) then unminimize() end
if ( is_fullscreen() ) then unfullscreen() end
-- x,y
xy(width-buddy,0 )
-- width,height
size(buddy,height )
else
if ( is_maximized() ) then unmaximize() end
if ( is_minimized() ) then unminimize() end
if ( is_fullscreen() ) then unfullscreen() end
-- x,y
xy(0,0)
-- width,height
size(width-buddy,height )
end
-- Both windows on workspace two.
workspace(2)
end
if ( window_application() == "Terminal" ) then
maximize_vertically()
end