]> git.madduck.net Git - etc/awesome.git/blob - .config/awesome/rc.lua

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

make xpdf windows maximised
[etc/awesome.git] / .config / awesome / rc.lua
1 -- awesome 3 configuration file
2
3 AWESOME_DATADIR = "/home/madduck/code/awesome"
4 package.path = AWESOME_DATADIR .. "/lib/?.lua;" .. package.path
5
6 -- Include awesome library, with lots of useful function!
7 require("awful")
8 require("tabulous")
9 require("beautiful")
10
11 -- {{{ Variable definitions
12 -- This is a file path to a theme file which will defines colors.
13 theme_path = AWESOME_DATADIR .. "/themes/default"
14
15 -- This is used later as the default terminal to run.
16 terminal = "x-terminal-emulator"
17
18 -- Default modkey.
19 -- Usually, Mod4 is the key with a logo between Control and Alt.
20 -- If you do not like this or do not have such a key,
21 -- I suggest you to remap Mod4 to another key using xmodmap or other tools.
22 -- However, you can use another modifier like Mod1, but it may interact with others.
23 modkey = "Mod4"
24
25 -- Table of layouts to cover with awful.layout.inc, order matters.
26 layouts =
27 {
28     "tile",
29     "tileleft",
30     "tilebottom",
31     "tiletop",
32     "magnifier",
33     "max",
34 --    "spiral",
35 --    "dwindle",
36     "floating"
37 }
38
39 -- Table of clients that should be set floating. The index may be either
40 -- the application class or instance. The instance is useful when running
41 -- a console app in a terminal like (Music on Console)
42 --    xterm -name mocp -e mocp
43 -- OVERRULED BY TILEDAPPS BELOW
44 floatapps =
45 {
46     -- by class
47     ["MPlayer"] = true,
48     ["pinentry"] = true,
49     ["GIMP"] = true,
50     ["twinkle"] = true,
51     ["Add-ons"] = true,
52     ["Play stream"] = true
53 }
54
55 -- Applications that should never float, assuming everything else floats
56 -- (by instance)
57 tiledapps =
58 {
59     ["urxvt"] = true
60 }
61
62 -- Applications that should be maximised
63 -- (by instance)
64 maxapps =
65 {
66     ["Navigator"] = true,
67     -- jpilot is -v
68     ["-v"] = true,
69     ["Xpdf"] = true
70 }
71
72 -- Applications to be moved to a pre-defined tag by class or instance.
73 -- Use the screen and tags indices.
74 apptags =
75 {
76     ["Iceweasel"] = { screen = 1, tag = 9 },
77     -- jpilot is -v
78     ["-v"] = { screen = 1, tag = 8 },
79 }
80
81 -- Define if we want to use titlebar on all applications.
82 use_titlebar = false
83 -- }}}
84
85 -- {{{ Initialization
86 -- Initialize theme (colors).
87 beautiful.init(theme_path)
88
89 -- Register theme in awful.
90 -- This allows to not pass plenty of arguments to each function
91 -- to inform it about colors we want it to draw.
92 awful.beautiful.register(beautiful)
93
94 -- Uncomment this to activate autotabbing
95 -- tabulous.autotab_start()
96 -- }}}
97
98 -- {{{ Tags
99 -- Define tags table.
100 tags = {}
101 for s = 1, screen.count() do
102     -- Each screen has its own tag table.
103     tags[s] = {}
104     -- Create 9 tags per screen.
105     for tagnumber = 1, 9 do
106         tags[s][tagnumber] = tag({ name = tagnumber, layout = layouts[1] })
107         -- Add tags to screen one by one
108         -- split at 0.5/50% exactly
109         -- tags[s][tagnumber].mwfact = 0.5
110         tags[s][tagnumber].screen = s
111     end
112     -- I'm sure you want to see at least one tag.
113     tags[s][1].selected = true
114 end
115 -- }}}
116
117 -- {{{ Statusbar
118 -- Create a taglist widget
119 mytaglist = widget({ type = "taglist", name = "mytaglist" })
120 mytaglist:mouse_add(mouse({}, 1, function (object, tag) awful.tag.viewonly(tag) end))
121 mytaglist:mouse_add(mouse({ modkey }, 1, function (object, tag) awful.client.movetotag(tag) end))
122 mytaglist:mouse_add(mouse({}, 3, function (object, tag) tag.selected = not tag.selected end))
123 mytaglist:mouse_add(mouse({ modkey }, 3, function (object, tag) awful.client.toggletag(tag) end))
124 mytaglist:mouse_add(mouse({ }, 4, awful.tag.viewnext))
125 mytaglist:mouse_add(mouse({ }, 5, awful.tag.viewprev))
126 mytaglist.label = awful.widget.taglist.label.all
127
128 -- Create a tasklist widget
129 mytasklist = widget({ type = "tasklist", name = "mytasklist" })
130 mytasklist:mouse_add(mouse({ }, 1, function (object, c) client.focus = c; c:raise() end))
131 mytasklist:mouse_add(mouse({ }, 4, function () awful.client.focusbyidx(1) end))
132 mytasklist:mouse_add(mouse({ }, 5, function () awful.client.focusbyidx(-1) end))
133 mytasklist.label = awful.widget.tasklist.label.currenttags
134
135 -- Create a textbox widget
136 mytimebox = widget({ type = "textbox", name = "mytimebox", align = "right" })
137 mybatterybox = widget({ type = "textbox", name = "mybatterybox", align = "right" })
138 mypromptbox = widget({ type = "textbox", name = "mypromptbox", align = "left" })
139
140 -- Create an iconbox widget
141 myiconbox = widget({ type = "textbox", name = "myiconbox", align = "left" })
142 myiconbox.text = "<bg image=\"" .. AWESOME_DATADIR .. "/icons/awesome16.png\" resize=\"true\"/>"
143
144 -- Create a systray
145 mysystray = widget({ type = "systray", name = "mysystray", align = "right" })
146
147 -- Create an iconbox widget which will contains an icon indicating which layout we're using.
148 -- We need one layoutbox per screen.
149 mylayoutbox = {}
150 for s = 1, screen.count() do
151     mylayoutbox[s] = widget({ type = "textbox", name = "mylayoutbox", align = "right" })
152     mylayoutbox[s]:mouse_add(mouse({ }, 1, function () awful.layout.inc(layouts, 1) end))
153     mylayoutbox[s]:mouse_add(mouse({ }, 3, function () awful.layout.inc(layouts, -1) end))
154     mylayoutbox[s]:mouse_add(mouse({ }, 4, function () awful.layout.inc(layouts, 1) end))
155     mylayoutbox[s]:mouse_add(mouse({ }, 5, function () awful.layout.inc(layouts, -1) end))
156     mylayoutbox[s].text = "<bg image=\"" .. AWESOME_DATADIR .. "/layouts/tilew.png\" resize=\"true\"/>"
157 end
158
159 --Battery widget
160 batterywidget = widget({ type = 'progressbar', name = 'batterywidget' })
161 batterywidget.width = 100
162 batterywidget.height = 0.8
163 batterywidget.gap = 1
164 batterywidget.border_padding = 1
165 batterywidget.border_width = 1
166 batterywidget.ticks_count = 10
167 batterywidget.ticks_gap = 1
168 batterywidget.vertical = false
169 batterywidget:bar_properties_set('bat', {
170   bg = 'black',
171   fg = 'blue4',
172   fg_off = 'red',
173   reverse = false,
174   min_value = 0,
175   max_value = 100
176 })
177 -- }}}
178
179 -- Create a statusbar for each screen and add it
180 mystatusbar = {}
181 for s = 1, screen.count() do
182     mystatusbar[s] = statusbar({ position = "top", name = "mystatusbar" .. s,
183                                  fg = beautiful.fg_normal, bg = beautiful.bg_normal })
184     -- Add widgets to the statusbar - order matters
185     mystatusbar[s]:widgets({
186         mytaglist,
187         mytasklist,
188         mypromptbox,
189 --        batterywidget,
190         mybatterybox,
191         mytimebox,
192         mylayoutbox[s],
193         s == screen.count() and mysystray or nil
194     })
195     mystatusbar[s].screen = s
196 end
197 -- }}}
198
199 -- {{{ Mouse bindings
200 awesome.mouse_add(mouse({ }, 3, function () awful.spawn(terminal) end))
201 awesome.mouse_add(mouse({ }, 4, awful.tag.viewnext))
202 awesome.mouse_add(mouse({ }, 5, awful.tag.viewprev))
203 -- }}}
204
205 -- {{{ Key bindings
206
207 -- Bind keyboard digits
208 -- Compute the maximum number of digit we need, limited to 9
209 keynumber = 0
210 for s = 1, screen.count() do
211    keynumber = math.min(9, math.max(#tags[s], keynumber));
212 end
213
214 for i = 1, keynumber do
215     keybinding({ modkey }, i,
216                    function ()
217                        local screen = mouse.screen
218                        if tags[screen][i] then
219                            awful.tag.viewonly(tags[screen][i])
220                        end
221                    end):add()
222     keybinding({ modkey, "Control" }, i,
223                    function ()
224                        local screen = mouse.screen
225                        if tags[screen][i] then
226                            tags[screen][i].selected = not tags[screen][i].selected
227                        end
228                    end):add()
229     keybinding({ modkey, "Shift" }, i,
230                    function ()
231                        local sel = client.focus
232                        if sel then
233                            if tags[sel.screen][i] then
234                                awful.client.movetotag(tags[sel.screen][i])
235                            end
236                        end
237                    end):add()
238     keybinding({ modkey, "Control", "Shift" }, i,
239                    function ()
240                        local sel = client.focus
241                        if sel then
242                            if tags[sel.screen][i] then
243                                awful.client.toggletag(tags[sel.screen][i])
244                            end
245                        end
246                    end):add()
247 end
248
249 keybinding({ modkey }, "Left", awful.tag.viewprev):add()
250 keybinding({ modkey }, "Right", awful.tag.viewnext):add()
251 keybinding({ modkey }, "Escape", awful.tag.history.restore):add()
252
253 -- Standard program
254 keybinding({ modkey }, "Return", function () awful.spawn(terminal) end):add()
255
256 keybinding({ modkey, "Control" }, "r", awesome.restart):add()
257 keybinding({ modkey, "Shift" }, "q", awesome.quit):add()
258
259 -- Client manipulation
260 keybinding({ modkey }, "m", awful.client.maximize):add()
261 keybinding({ modkey, "Shift" }, "c", function () client.focus:kill() end):add()
262 keybinding({ modkey }, "j", function () awful.client.focusbyidx(1); client.focus:raise() end):add()
263 keybinding({ modkey }, "k", function () awful.client.focusbyidx(-1);  client.focus:raise() end):add()
264 keybinding({ modkey, "Shift" }, "j", function () awful.client.swap(1) end):add()
265 keybinding({ modkey, "Shift" }, "k", function () awful.client.swap(-1) end):add()
266 keybinding({ modkey, "Control" }, "j", function () awful.screen.focus(1) end):add()
267 keybinding({ modkey, "Control" }, "k", function () awful.screen.focus(-1) end):add()
268 keybinding({ modkey, "Control" }, "space", awful.client.togglefloating):add()
269 keybinding({ modkey, "Control" }, "Return", function () client.focus:swap(awful.client.master()) end):add()
270 keybinding({ modkey }, "o", awful.client.movetoscreen):add()
271 keybinding({ modkey }, "Tab", awful.client.focus.history.previous):add()
272 keybinding({ modkey }, "u", awful.client.urgent.jumpto):add()
273 keybinding({ modkey, "Shift" }, "r", function () client.focus:redraw() end):add()
274
275 -- Layout manipulation
276 keybinding({ modkey }, "l", function () awful.tag.incmwfact(0.05) end):add()
277 keybinding({ modkey }, "h", function () awful.tag.incmwfact(-0.05) end):add()
278 keybinding({ modkey, "Shift" }, "h", function () awful.tag.incnmaster(1) end):add()
279 keybinding({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end):add()
280 keybinding({ modkey, "Control" }, "h", function () awful.tag.incncol(1) end):add()
281 keybinding({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end):add()
282 keybinding({ modkey }, "space", function () awful.layout.inc(layouts, 1) end):add()
283 keybinding({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end):add()
284
285 -- Prompt
286 keybinding({ modkey }, "F1", function ()
287                                  awful.prompt.run({ prompt = "Run: " }, mypromptbox, awful.spawn, awful.completion.bash,
288 os.getenv("HOME") .. "/.cache/awesome/history") end):add()
289 keybinding({ modkey }, "F4", function ()
290                                  awful.prompt.run({ prompt = "Run Lua code: " }, mypromptbox, awful.eval, awful.prompt.bash,
291 os.getenv("HOME") .. "/.cache/awesome/history_eval") end):add()
292 keybinding({ modkey, "Ctrl" }, "i", function ()
293                                         if mypromptbox.text then
294                                             mypromptbox.text = nil
295                                         else
296                                             mypromptbox.text = nil
297                                             if client.focus.class then
298                                                 mypromptbox.text = "Class: " .. client.focus.class .. " "
299                                             end
300                                             if client.focus.instance then
301                                                 mypromptbox.text = mypromptbox.text .. "Instance: ".. client.focus.instance .. " "
302                                             end
303                                             if client.focus.role then
304                                                 mypromptbox.text = mypromptbox.text .. "Role: ".. client.focus.role
305                                             end
306                                         end
307                                     end):add()
308
309 --- Tabulous, tab manipulation
310 keybinding({ modkey, "Control" }, "y", function ()
311     local tabbedview = tabulous.tabindex_get()
312     local nextclient = awful.client.next(1)
313
314     if not tabbedview then
315         tabbedview = tabulous.tabindex_get(nextclient)
316
317         if not tabbedview then
318             tabbedview = tabulous.tab_create()
319             tabulous.tab(tabbedview, nextclient)
320         else
321             tabulous.tab(tabbedview, client.focus)
322         end
323     else
324         tabulous.tab(tabbedview, nextclient)
325     end
326 end):add()
327
328 keybinding({ modkey, "Shift" }, "y", tabulous.untab):add()
329
330 keybinding({ modkey }, "y", function ()
331    local tabbedview = tabulous.tabindex_get()
332
333    if tabbedview then
334        local n = tabulous.next(tabbedview)
335        tabulous.display(tabbedview, n)
336    end
337 end):add()
338
339 -- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them
340 keybinding({ modkey }, "t", awful.client.togglemarked):add()
341 keybinding({ modkey, 'Shift' }, "t", function ()
342     local tabbedview = tabulous.tabindex_get()
343     local clients = awful.client.getmarked()
344
345     if not tabbedview then
346         tabbedview = tabulous.tab_create(clients[1])
347         table.remove(clients, 1)
348     end
349
350     for k,c in pairs(clients) do
351         tabulous.tab(tabbedview, c)
352     end
353
354 end):add()
355
356 for i = 1, keynumber do
357     keybinding({ modkey, "Shift" }, "F" .. i,
358                    function ()
359                        local screen = mouse.screen
360                        if tags[screen][i] then
361                            for k, c in pairs(awful.client.getmarked()) do
362                                awful.client.movetotag(tags[screen][i], c)
363                            end
364                        end
365                    end):add()
366 end
367 -- }}}
368
369 -- {{{ Hooks
370 -- Hook function to execute when focusing a client.
371 function hook_focus(c)
372     if not awful.client.ismarked(c) then
373         c.border_color = beautiful.border_focus
374     end
375 end
376
377 -- Hook function to execute when unfocusing a client.
378 function hook_unfocus(c)
379     if not awful.client.ismarked(c) then
380         c.border_color = beautiful.border_normal
381     end
382 end
383
384 -- Hook function to execute when marking a client
385 function hook_marked(c)
386     c.border_color = beautiful.border_marked
387 end
388
389 -- Hook function to execute when unmarking a client
390 function hook_unmarked(c)
391     c.border_color = beautiful.border_focus
392 end
393
394 -- Hook function to execute when the mouse is over a client.
395 function hook_mouseover(c)
396     -- Sloppy focus, but disabled for magnifier layout
397     if awful.layout.get(c.screen) ~= "magnifier" then
398         client.focus = c
399     end
400 end
401
402 -- Hook function to execute when a new client appears.
403 function hook_manage(c)
404     -- Set floating placement to be smart!
405     c.floating_placement = "smart"
406     if use_titlebar then
407         -- Add a titlebar
408         awful.titlebar.add(c, { modkey = modkey })
409     end
410     -- Add mouse bindings
411     c:mouse_add(mouse({ }, 1, function (c) client.focus = c; c:raise() end))
412     c:mouse_add(mouse({ modkey }, 1, function (c) c:mouse_move() end))
413     c:mouse_add(mouse({ modkey }, 3, function (c) c:mouse_resize() end))
414     -- New client may not receive focus
415     -- if they're not focusable, so set border anyway.
416     c.border_width = beautiful.border_width
417     c.border_color = beautiful.border_normal
418     client.focus = c
419
420     -- Check if the application should be floating.
421     -- OVERRIDDEN, SEE tiledapps BELOW
422     local cls = c.class
423     local inst = c.instance
424     if floatapps[cls] then
425         c.floating = floatapps[cls]
426     elseif floatapps[inst] then
427         c.floating = floatapps[inst]
428     end
429
430     -- Override with tiledapps
431     c.floating = not tiledapps[inst]
432
433     -- Check application->screen/tag mappings.
434     local target
435     if apptags[cls] then
436         target = apptags[cls]
437     elseif apptags[inst] then
438         target = apptags[inst]
439     end
440     if target then
441         c.screen = target.screen
442         awful.client.movetotag(tags[target.screen][target.tag], c)
443     end
444
445     -- Honor size hints
446     c.honorsizehints = true
447
448     -- Maximise some
449     if maxapps[inst] then
450       awful.client.maximize(c)
451     end
452 end
453
454 -- Hook function to execute when arranging the screen
455 -- (tag switch, new client, etc)
456 function hook_arrange(screen)
457     local layout = awful.layout.get(screen)
458     if layout then
459         mylayoutbox[screen].text =
460             "<bg image=\"/home/madduck/code/awesome/share/awesome/icons/layouts/" .. awful.layout.get(screen) .. "w.png\" resize=\"true\"/>"
461         else
462             mylayoutbox[screen].text = "No layout."
463     end
464
465     -- If no window has focus, give focus to the latest in history
466     if not client.focus then
467         local c = awful.client.focus.history.get(screen, 0)
468         if c then client.focus = c end
469     end
470
471     -- Uncomment if you want mouse warping
472     --[[
473     local sel = client.focus
474     if sel then
475         local c_c = sel:coords()
476         local m_c = mouse.coords()
477
478         if m_c.x < c_c.x or m_c.x >= c_c.x + c_c.width or
479             m_c.y < c_c.y or m_c.y >= c_c.y + c_c.height then
480             if table.maxn(m_c.buttons) == 0 then
481                 mouse.coords({ x = c_c.x + 5, y = c_c.y + 5})
482             end
483         end
484     end
485     ]]
486 end
487
488 -- Hook called every second
489 function hook_timer()
490     -- For unix time_t lovers
491     -- mytextbox.text = " " .. os.time() .. " time_t "
492     -- Otherwise use:
493     mytimebox.text = " " .. os.date() .. " "
494 end
495
496 -- Hook called every sixty seconds
497 function hook_battery()
498     mybatterybox.text = " " .. get_acpibatt() .. " "
499 end
500
501 -- {{{ Statusbar battery
502 --
503 function get_acpibatt()
504
505     local f = io.popen('acpi -b', 'r')
506     if not f then
507       return "acpi -b failed"
508     end
509
510     local s = f:read('*l')
511     f:close()
512     if not s then
513       return laststring;
514     end
515
516     -- Battery 0: Discharging, 89%, 00:02:14 remaining
517     -- Battery 0: Charging, 58%, 00:02:14 until charged
518     -- Battery 0: Full, 100%
519     -- so find the first bit first and then go look for the time
520     local st, en, status, percent = string.find(s, '%a+%s%d:%s(%a+),%s(%d+%%)');
521     local st, en, time = string.find(s, ',%s(%d+:%d+:%d+)%s%a+', en);
522
523     if not status or not percent then -- time can be empty if we're full
524       return "couldn't parse line " .. s
525     end
526
527     if not time then
528       return percent
529     end
530
531     if status == 'Charging' then
532       status = 'c';
533     elseif status == 'Discarching' then
534       status = 'd';
535     else
536       status = '';
537     end
538
539     return percent; -- .. ' (' .. status .. ')'; -- .. ' ' .. time .. ' left';
540 end
541 -- }}}
542
543 --{{{ batt hook
544 local function get_bat()
545   local a = io.open("/sys/class/power_supply/BAT1/charge_full")
546   for line in a:lines() do
547     full = line
548   end
549   a:close()
550   local b = io.open("/sys/class/power_supply/BAT1/charge_now")
551   for line in b:lines() do
552     now = line
553   end
554   b:close()
555   batt=math.floor(now*100/full)
556   batterywidget:bar_data_add("bat",batt )
557 end
558 --}}}
559
560 -- Set up some hooks
561 awful.hooks.focus.register(hook_focus)
562 awful.hooks.unfocus.register(hook_unfocus)
563 awful.hooks.marked.register(hook_marked)
564 awful.hooks.unmarked.register(hook_unmarked)
565 awful.hooks.manage.register(hook_manage)
566 awful.hooks.mouseover.register(hook_mouseover)
567 awful.hooks.arrange.register(hook_arrange)
568 awful.hooks.timer.register(1, hook_timer)
569 awful.hooks.timer.register(120, hook_battery)
570 -- awful.hooks.timer.register(5, get_bat)
571 -- }}}
572
573 cmdmodkey = "Mod3"
574
575 -- xmms2 & sound
576 keybinding({ cmdmodkey }, "Prior", function () awful.spawn("amixer set Master 2+") end):add()
577 keybinding({ cmdmodkey }, "Next", function () awful.spawn("amixer set Master 2-") end):add()
578 keybinding({ cmdmodkey }, "Up", function () awful.spawn("amixer set PCM 2+") end):add()
579 keybinding({ cmdmodkey }, "Down", function () awful.spawn("amixer set PCM 2-") end):add()
580 keybinding({ cmdmodkey }, "Home", function () awful.spawn("amixer set Mic toggle") end):add()
581 keybinding({ cmdmodkey }, "End", function () awful.spawn("amixer set Master toggle") end):add()
582 keybinding({ cmdmodkey }, "Left", function () awful.spawn("xmms2 prev") end):add()
583 keybinding({ cmdmodkey }, "Right", function () awful.spawn("xmms2 next") end):add()
584 keybinding({ cmdmodkey }, "space", function () awful.spawn("xmms2 toggleplay") end):add()
585 keybinding({ cmdmodkey }, "backslash", function () awful.spawn("xmms2 current | head -1 | xmessage -nearmouse -timeout 5 -file -") end):add()
586 keybinding({ cmdmodkey, "Shift" }, "backslash", function () awful.spawn("xmms2 list | xmessage -nearmouse -timeout 5 -file -") end):add()
587
588 -- misc apps
589 keybinding({ cmdmodkey }, "n", function () awful.spawn("sensible-browser") end):add()
590 keybinding({ cmdmodkey }, "m", function () awful.spawn(terminal .. " -e mutt -f =store") end):add()
591 keybinding({ cmdmodkey }, "t", function () awful.spawn(terminal) end):add()
592 keybinding({ cmdmodkey }, "c", function () awful.spawn(terminal .. " -e python") end):add()
593 keybinding({ cmdmodkey }, "r", function () awful.spawn("gmrun") end):add()
594 keybinding({ cmdmodkey }, "j", function () awful.spawn("jpilot") end):add()
595 keybinding({ cmdmodkey }, "x", function () awful.spawn("/sbin/start-stop-daemon --start --background --exec /usr/bin/xscreensaver; xscreensaver-command -lock") end):add()
596 keybinding({ cmdmodkey, "Shift" }, "x", function () awful.spawn("xscreensaver-command -exit") end):add()
597
598 -- Highlight statusbars on the screen that has focus, 
599 -- set this to false if you only have one screen or 
600 -- you don't like it :P
601 if screen.count() > 1 then
602   statusbar_highlight_focus = true
603 else
604   statusbar_highlight_focus = false
605 end
606
607 hook_battery()