In awesome, floating windows disappear behind regular windows and it's
not ideal. I googled for the solution and there is one post thats
similar to my issue and basically the guy says use "c.on_top = true"
only I have no idea where exactly in my rc.lua I am supposed to put
this. Can anyone help please? I've pasted my rc.lua (I'm using awesome
3) in below with line numbers. I'd really appreciate the help.
I've already modified my rc.lua to use different keybindings and
terminal apps I'll paste it below. I can't seem to find an awesome
mailing list so this is a pretty hopeful post.
Also does anyone know how to enable "on all tags / workspaces" as
well? Basically I run Kopete and Amarok 1.4's floating window and they
keep disappearing or I forget where they are because they're behind
the tag I'm looking at.
Any help would be really appreciated.
Thank you
Phill
---
1 :-- Standard awesome library
2 :require("awful")
3 :-- Theme handling library
4 :require("beautiful")
5 :-- Notification library
6 :require("naughty")
7 :
8 :require("revelation")
9 :
10 :-- {{{ Variable definitions
11 :-- Themes define colours, icons, and wallpapers
12 :-- The default is a dark theme
13 :theme_path = "/usr/share/awesome/themes/default/theme.lua"
14 :-- Uncommment this for a lighter theme
15 :-- theme_path = "/usr/share/awesome/themes/sky/theme.lua"
16 :
17 :-- Actually load theme
18 :beautiful.init(theme_path)
19 :
20 :-- This is used later as the default terminal and editor to run.
21 :terminal = "uxterm"
22 :editor = os.getenv("EDITOR") or "vim"
23 :editor_cmd = terminal .. " -e " .. editor
24 :
25 :-- Default modkey.
26 :-- Usually, Mod4 is the key with a logo between Control and Alt.
27 :-- If you do not like this or do not have such a key,
28 :-- I suggest you to remap Mod4 to another key using xmodmap or
other tools.
29 :-- However, you can use another modifier like Mod1, but it may
interact with others.
30 :modkey = "Mod1"
31 :
32 :-- Table of layouts to cover with awful.layout.inc, order matters.
33 :layouts =
34 :{
35 : awful.layout.suit.tile,
36 : awful.layout.suit.tile.left,
37 : awful.layout.suit.tile.bottom,
38 : awful.layout.suit.tile.top,
39 : awful.layout.suit.fair,
40 : awful.layout.suit.fair.horizontal,
41 : awful.layout.suit.max,
42 : awful.layout.suit.max.fullscreen,
43 : awful.layout.suit.magnifier,
44 : awful.layout.suit.floating
45 :}
46 :
47 :-- Table of clients that should be set floating. The index may be
either
48 :-- the application class or instance. The instance is useful when
running
49 :-- a console app in a terminal like (Music on Console)
50 :-- xterm -name mocp -e mocp
51 :floatapps =
52 :{
53 : -- by class
54 : ["MPlayer"] = true,
55 : ["pinentry"] = true,
56 : ["gimp"] = true,
57 : ["gnome-calculator"] = true,
58 : ["gnome-screenshot"] = true,
59 : ["kopete"] = true,
60 : ["grip"] = true,
61 : -- by instance
62 : ["mocp"] = true
63 :}
64 :
65 :-- Applications to be moved to a pre-defined tag by class or
instance.
66 :-- Use the screen and tags indices.
67 :apptags =
68 :{
69 : -- ["Firefox"] = { screen = 1, tag = 2 },
70 : -- ["mocp"] = { screen = 2, tag = 4 },
71 :}
72 :
73 :-- Define if we want to use titlebar on all applications.
74 :use_titlebar = false
75 :-- }}}
76 :
77 :-- {{{ Tags
78 :-- Define tags table.
79 :tags = {}
80 :for s = 1, screen.count() do
81 : -- Each screen has its own tag table.
82 : tags[s] = {}
83 : -- Create 9 tags per screen.
84 : for tagnumber = 1, 9 do
85 : tags[s][tagnumber] = tag(tagnumber)
86 : -- Add tags to screen one by one
87 : tags[s][tagnumber].screen = s
88 : awful.layout.set(layouts[1], tags[s][tagnumber])
89 : end
90 : -- I'm sure you want to see at least one tag.
91 : tags[s][1].selected = true
92 :end
93 :-- }}}
94 :
95 :-- {{{ Wibox
96 :-- Create a textbox widget
97 :mytextbox = widget({ type = "textbox", align = "right" })
98 :-- Set the default text in textbox
99 :mytextbox.text = "<b><small> " .. awesome.release .. " </small></
b>"
100 :
101 :-- Create a laucher widget and a main menu
102 :myawesomemenu = {
103 : { "manual", terminal .. " -e man awesome" },
104 : { "edit config", editor_cmd .. " " .. awful.util.getdir
("config") .. "/rc.lua" },
105 : { "restart", awesome.restart },
106 : { "quit", awesome.quit }
107 :}
108 :
109 :mymainmenu = awful.menu.new({ items = { { "awesome",
myawesomemenu, beautiful.awesome_icon },
110 : { "open terminal",
terminal }
111 : }
112 : })
113 :
114 :mylauncher = awful.widget.launcher({ image = image
(beautiful.awesome_icon),
115 : menu = mymainmenu })
116 :
117 :-- Create a systray
118 :mysystray = widget({ type = "systray", align = "right" })
119 :
120 :-- Create a wibox for each screen and add it
121 :mywibox = {}
122 :mypromptbox = {}
123 :mylayoutbox = {}
124 :mytaglist = {}
125 :mytaglist.buttons = awful.util.table.join(
126 : awful.button({ }, 1, awful.tag.viewonly),
127 : awful.button({ modkey }, 1,
awful.client.movetotag),
128 : awful.button({ }, 3, function (tag)
tag.selected = not tag.selected end),
129 : awful.button({ modkey }, 3,
awful.client.toggletag),
130 : awful.button({ }, 4, awful.tag.viewnext),
131 : awful.button({ }, 5, awful.tag.viewprev)
132 : )
133 :mytasklist = {}
134 :mytasklist.buttons = awful.util.table.join(
135 : awful.button({ }, 1, function (c)
136 : if not c:isvisible
() then
137 :
awful.tag.viewonly(c:tags()[1])
138 : end
139 : client.focus = c
140 : c:raise()
141 : end),
142 : awful.button({ }, 3, function ()
143 : if instance then
144 : instance:hide()
145 : instance = nil
146 : else
147 : instance =
awful.menu.clients({ width=250 })
148 : end
149 : end),
150 : awful.button({ }, 4, function ()
151 :
awful.client.focus.byidx(1)
152 : if client.focus
then client.focus:raise() end
153 : end),
154 : awful.button({ }, 5, function ()
155 :
awful.client.focus.byidx(-1)
156 : if client.focus
then client.focus:raise() end
157 : end))
158 :
159 :for s = 1, screen.count() do
160 : -- Create a promptbox for each screen
161 : mypromptbox[s] = awful.widget.prompt({ align = "left" })
162 : -- Create an imagebox widget which will contains an icon
indicating which layout we're using.
163 : -- We need one layoutbox per screen.
164 : mylayoutbox[s] = widget({ type = "imagebox", align =
"right" })
165 : mylayoutbox[s]:buttons(awful.util.table.join(
166 : awful.button({ }, 1, function ()
awful.layout.inc(layouts, 1) end),
167 : awful.button({ }, 3, function ()
awful.layout.inc(layouts, -1) end),
168 : awful.button({ }, 4, function ()
awful.layout.inc(layouts, 1) end),
169 : awful.button({ }, 5, function ()
awful.layout.inc(layouts, -1) end)))
170 : -- Create a taglist widget
171 : mytaglist[s] = awful.widget.taglist(s,
awful.widget.taglist.label.all, mytaglist.buttons)
172 :
173 : -- Create a tasklist widget
174 : mytasklist[s] = awful.widget.tasklist(function(c)
175 : return
awful.widget.tasklist.label.currenttags(c, s)
176 : end,
mytasklist.buttons)
177 :
178 : -- Create the wibox
179 : mywibox[s] = wibox({ position = "top", fg =
beautiful.fg_normal, bg = beautiful.bg_normal })
180 : -- Add widgets to the wibox - order matters
181 : mywibox[s].widgets = { mylauncher,
182 : mytaglist[s],
183 : mytasklist[s],
184 : mypromptbox[s],
185 : mytextbox,
186 : mylayoutbox[s],
187 : s == 1 and mysystray or nil }
188 : mywibox[s].screen = s
189 :end
190 :-- }}}
191 :
192 :-- {{{ Mouse bindings
193 :root.buttons(awful.util.table.join(
194 : awful.button({ }, 3, function () mymainmenu:toggle() end),
195 : awful.button({ }, 4, awful.tag.viewnext),
196 : awful.button({ }, 5, awful.tag.viewprev)
197 :))
198 :-- }}}
199 :
200 :-- {{{ Key bindings
201 :globalkeys = awful.util.table.join(
202 : awful.key({ modkey, "Control" }, "Left",
awful.tag.viewprev ),
203 : awful.key({ modkey, "Control" }, "Right",
awful.tag.viewnext ),
204 : awful.key({ modkey, }, "Tab",
awful.tag.history.restore),
205 :
206 : awful.key({ modkey, }, "j",
207 : function ()
208 : awful.client.focus.byidx( 1)
209 : if client.focus then client.focus:raise() end
210 : end),
211 : awful.key({ modkey, }, "k",
212 : function ()
213 : awful.client.focus.byidx(-1)
214 : if client.focus then client.focus:raise() end
215 : end),
216 : awful.key({ modkey, }, "w", function ()
mymainmenu:show(true) end),
217 :
218 : -- Layout manipulation
219 : awful.key({ modkey, "Shift" }, "j", function ()
awful.client.swap.byidx( 1) end),
220 : awful.key({ modkey, "Shift" }, "k", function ()
awful.client.swap.byidx( -1) end),
221 :-- awful.key({ modkey, "Control" }, "j", function ()
awful.screen.focus( 1) end),
222 :-- awful.key({ modkey, "Control" }, "k", function ()
awful.screen.focus(-1) end),
223 : awful.key({ modkey, }, "u",
awful.client.urgent.jumpto),
224 :-- awful.key({ modkey, }, "Tab",
225 :-- function ()
226 :-- awful.client.focus.history.previous()
227 :-- if client.focus then
228 :-- client.focus:raise()
229 :-- end
230 :-- end),
231 :
232 : -- Standard program
233 : awful.key({ modkey, "Shift" }, "Return", function ()
awful.util.spawn(terminal) end),
234 : awful.key({ modkey, "Control" }, "r", awesome.restart),
235 : awful.key({ modkey, "Shift" }, "q", awesome.quit),
236 :
237 : awful.key({ modkey, }, "l", function ()
awful.tag.incmwfact( 0.05) end),
238 : awful.key({ modkey, }, "h", function ()
awful.tag.incmwfact(-0.05) end),
239 : awful.key({ modkey, "Shift" }, "h", function ()
awful.tag.incnmaster( 1) end),
240 : awful.key({ modkey, "Shift" }, "l", function ()
awful.tag.incnmaster(-1) end),
241 : awful.key({ modkey, "Control" }, "h", function ()
awful.tag.incncol( 1) end),
242 : awful.key({ modkey, "Control" }, "l", function ()
awful.tag.incncol(-1) end),
243 : awful.key({ modkey, }, "space", function ()
awful.layout.inc(layouts, 1) end),
244 : awful.key({ modkey, "Shift" }, "space", function ()
awful.layout.inc(layouts, -1) end),
245 :
246 : -- Prompt
247 : awful.key({ modkey }, "r", function ()
mypromptbox[mouse.screen]:run() end),
248 :
249 : awful.key({ modkey }, "x",
250 : function ()
251 : awful.prompt.run({ prompt = "Run Lua code: " },
252 : mypromptbox[mouse.screen].widget,
253 : awful.util.eval, nil,
254 : awful.util.getdir("cache") .. "/history_eval")
255 : end)
256 :)
257 :
258 :-- Client awful tagging: this is useful to tag some clients and
then do stuff like move to tag on them
259 :clientkeys = awful.util.table.join(
260 : awful.key({ modkey, }, "f", function (c)
c.fullscreen = not c.fullscreen end),
261 : awful.key({ modkey, "Shift" }, "c", function (c) c:kill
() end),
262 : awful.key({ modkey, "Control" }, "space",
awful.client.floating.toggle ),
263 : awful.key({ modkey, }, "Return", function (c) c:swap
(awful.client.getmaster()) end),
264 : awful.key({ modkey, }, "o",
awful.client.movetoscreen ),
265 : awful.key({ modkey, "Shift" }, "r", function (c)
c:redraw() end),
266 : awful.key({ modkey, }, "e",
revelation.revelation ),
267 : awful.key({ modkey }, "t", awful.client.togglemarked),
268 : awful.key({ modkey,}, "m",
269 : function (c)
270 : c.maximized_horizontal = not c.maximized_horizontal
271 : c.maximized_vertical = not c.maximized_vertical
272 : end)
273 :)
274 :
275 :-- Compute the maximum number of digit we need, limited to 9
276 :keynumber = 0
277 :for s = 1, screen.count() do
278 : keynumber = math.min(9, math.max(#tags[s], keynumber));
279 :end
280 :
281 :for i = 1, keynumber do
282 : globalkeys = awful.util.table.join(globalkeys,
283 : awful.key({ modkey }, i,
284 : function ()
285 : local screen = mouse.screen
286 : if tags[screen][i] then
287 : awful.tag.viewonly(tags[screen][i])
288 : end
289 : end),
290 : awful.key({ modkey, "Control" }, i,
291 : function ()
292 : local screen = mouse.screen
293 : if tags[screen][i] then
294 : tags[screen][i].selected = not tags
[screen][i].selected
295 : end
296 : end),
297 : awful.key({ modkey, "Shift" }, i,
298 : function ()
299 : if client.focus and tags
[client.focus.screen][i] then
300 : awful.client.movetotag(tags
[client.focus.screen][i])
301 : end
302 : end),
303 : awful.key({ modkey, "Control", "Shift" }, i,
304 : function ()
305 : if client.focus and tags
[client.focus.screen][i] then
306 : awful.client.toggletag(tags
[client.focus.screen][i])
307 : end
308 : end),
309 : awful.key({ modkey, "Shift" }, "F" .. i,
310 : function ()
311 : local screen = mouse.screen
312 : if tags[screen][i] then
313 : for k, c in pairs(awful.client.getmarked
()) do
314 : awful.client.movetotag(tags[screen]
[i], c)
315 : end
316 : end
317 : end))
318 :end
319 :
320 :-- Set keys
321 :root.keys(globalkeys)
322 :-- }}}
323 :
324 :-- {{{ Hooks
325 :-- Hook function to execute when focusing a client.
326 :awful.hooks.focus.register(function (c)
327 : if not awful.client.ismarked(c) then
328 : c.border_color = beautiful.border_focus
329 : c.on_top = true
330 : end
331 :end)
332 :
333 :-- Hook function to execute when unfocusing a client.
334 :awful.hooks.unfocus.register(function (c)
335 : if not awful.client.ismarked(c) then
336 : c.border_color = beautiful.border_normal
337 : c.on_top = false
338 : end
339 :end)
340 :
341 :-- Hook function to execute when marking a client
342 :awful.hooks.marked.register(function (c)
343 : c.border_color = beautiful.border_marked
344 :end)
345 :
346 :-- Hook function to execute when unmarking a client.
347 :awful.hooks.unmarked.register(function (c)
348 : c.border_color = beautiful.border_focus
349 :end)
350 :
351 :-- Hook function to execute when the mouse enters a client.
352 :awful.hooks.mouse_enter.register(function (c)
353 : -- Sloppy focus, but disabled for magnifier layout
354 : if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
355 : and awful.client.focus.filter(c) then
356 : client.focus = c
357 : end
358 :end)
359 :
360 :-- Hook function to execute when a new client appears.
361 :awful.hooks.manage.register(function (c, startup)
362 : -- If we are not managing this application at startup,
363 : -- move it to the screen where the mouse is.
364 : -- We only do it for filtered windows (i.e. no dock, etc).
365 : if not startup and awful.client.focus.filter(c) then
366 : c.screen = mouse.screen
367 : end
368 :
369 : if use_titlebar then
370 : -- Add a titlebar
371 : awful.titlebar.add(c, { modkey = modkey })
372 : end
373 : -- Add mouse bindings
374 : c:buttons(awful.util.table.join(
375 : awful.button({ }, 1, function (c) client.focus = c;
c:raise() end),
376 : awful.button({ modkey }, 1, awful.mouse.client.move),
377 : awful.button({ modkey }, 3, awful.mouse.client.resize)
378 : ))
379 : -- New client may not receive focus
380 : -- if they're not focusable, so set border anyway.
381 : c.border_width = beautiful.border_width
382 : c.border_color = beautiful.border_normal
383 :
384 : -- Check if the application should be floating.
385 : local cls = c.class
386 : local inst = c.instance
387 : if floatapps[cls] ~= nil then
388 : awful.client.floating.set(c, floatapps[cls])
389 : c.on_top=true
390 : elseif floatapps[inst] ~= nil then
391 : awful.client.floating.set(c, floatapps[inst])
392 : c.on_top=true
393 : end
394 :
395 : -- Check application->screen/tag mappings.
396 : local target
397 : if apptags[cls] then
398 : target = apptags[cls]
399 : elseif apptags[inst] then
400 : target = apptags[inst]
401 : end
402 : if target then
403 : c.screen = target.screen
404 : awful.client.movetotag(tags[target.screen][target.tag],
c)
405 : end
406 :
407 : -- Do this after tag mapping, so you don't see it on the
wrong tag for a split second.
408 : client.focus = c
409 :
410 : -- Set key bindings
411 : c:keys(clientkeys)
412 :
413 : -- Set the windows at the slave,
414 : -- i.e. put it at the end of others instead of setting it
master.
415 : -- awful.client.setslave(c)
416 :
417 : -- Honor size hints: if you want to drop the gaps between
windows, set this to false.
418 : -- c.size_hints_honor = false
419 :end)
420 :
421 :-- Hook function to execute when arranging the screen.
422 :-- (tag switch, new client, etc)
423 :awful.hooks.arrange.register(function (screen)
424 : local layout = awful.layout.getname(awful.layout.get(screen))
425 : if layout and beautiful["layout_" ..layout] then
426 : mylayoutbox[screen].image = image(beautiful["layout_" ..
layout])
427 : else
428 : mylayoutbox[screen].image = nil
429 : end
430 :
431 : -- Give focus to the latest client in history if no window
has focus
432 : -- or if the current window is a desktop or a dock one.
433 : if not client.focus then
434 : local c = awful.client.focus.history.get(screen, 0)
435 : if c then client.focus = c end
436 : end
437 :end)
438 :
439 :-- Hook called every minute
440 :awful.hooks.timer.register(60, function ()
441 : mytextbox.text = os.date(" %a %b %d, %H:%M ")
442 :end)
443 :-- }}}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit our group at
http://groups.google.com/group/linuxusersgroup
-~----------~----~----~----~------~----~------~--~---