lpfManiak

~/.config/awesome/rc.lua

Mar 21st, 2014
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 23.27 KB | None | 0 0
  1. require("daze")
  2. vicious = require("vicious")
  3. beautiful = require("beautiful")
  4. -- Standard awesome library
  5. local gears = require("gears")
  6. local awful = require("awful")
  7. awful.rules = require("awful.rules")
  8. require("awful.autofocus")
  9. -- Widget and layout library
  10. local wibox = require("wibox")
  11. -- Theme handling library
  12. local beautiful = require("beautiful")
  13. -- Notification library
  14. local naughty = require("naughty")
  15. local menubar = require("menubar")
  16.  
  17. -- {{{ Error handling
  18. -- Check if awesome encountered an error during startup and fell back to
  19. -- another config (This code will only ever execute for the fallback config)
  20. if awesome.startup_errors then
  21.     naughty.notify({ preset = naughty.config.presets.critical,
  22.                      title = "Oops, there were errors during startup!",
  23.                      text = awesome.startup_errors })
  24. end
  25.  
  26. -- Handle runtime errors after startup
  27. do
  28.     local in_error = false
  29.     awesome.connect_signal("debug::error", function (err)
  30.         -- Make sure we don't go into an endless error loop
  31.         if in_error then return end
  32.         in_error = true
  33.  
  34.         naughty.notify({ preset = naughty.config.presets.critical,
  35.                          title = "Oops, an error happened!",
  36.                          text = err })
  37.         in_error = false
  38.     end)
  39. end
  40. -- }}}
  41.  
  42. -- {{{ Variable definitions
  43. -- Themes define colours, icons, and wallpapers
  44. beautiful.init("/usr/share/awesome/themes/lpf/theme.lua")
  45.  
  46. -- This is used later as the default terminal and editor to run.
  47. terminal = "urxvt"
  48. editor = os.getenv("EDITOR") or "nano"
  49. editor_cmd = terminal .. " -e " .. editor
  50.  
  51. -- Default modkey.
  52. -- Usually, Mod4 is the key with a logo between Control and Alt.
  53. -- If you do not like this or do not have such a key,
  54. -- I suggest you to remap Mod4 to another key using xmodmap or other tools.
  55. -- However, you can use another modifier like Mod1, but it may interact with others.
  56. modkey = "Mod4"
  57.  
  58. -- Table of layouts to cover with awful.layout.inc, order matters.
  59. local layouts =
  60. {
  61.     awful.layout.suit.tile,
  62.     awful.layout.suit.floating,
  63.     awful.layout.suit.tile.left,
  64.     awful.layout.suit.tile.bottom,
  65.     awful.layout.suit.tile.top,
  66.     awful.layout.suit.fair,
  67.     awful.layout.suit.fair.horizontal,
  68. --    awful.layout.suit.spiral,
  69. --    awful.layout.suit.spiral.dwindle,
  70. --    awful.layout.suit.max,
  71. --    awful.layout.suit.max.fullscreen,
  72. --    awful.layout.suit.magnifier
  73. }
  74. -- }}}
  75.  
  76. -- {{{ Wallpaper
  77. if beautiful.wallpaper then
  78.     for s = 1, screen.count() do
  79.         gears.wallpaper.maximized(beautiful.wallpaper, s, true)
  80.     end
  81. end
  82. -- }}}
  83.  
  84.  -- {{{ Remember layout
  85.  -- }}}
  86.  
  87.  -- {{{ Tags main im gimp etc
  88.  -- Define a tag table which will hold all screen tags.
  89.  tags = {
  90.    names  = { "⮛", "⮙", "⮚" },
  91.    layout = { layouts[2], layouts[2], layouts[2]
  92.  }}
  93.  for s = 1, screen.count() do
  94.      -- Each screen has its own tag table.
  95.      tags[s] = awful.tag(tags.names, s, tags.layout)
  96.  end
  97.  -- }}}
  98.  
  99. --set the layout
  100. --awful.layout.set(daze.layout.tile, tags[1][5])
  101. --set master window width in percentage
  102. --awful.tag.setmwfact(0.7, tags[1][5])
  103. --set number of column windows
  104. --awful.tag.setncol(1, tags[1][5])
  105.  
  106. -- {{{ Menu
  107. -- Create a laucher widget and a main menu
  108. myawesomemenu = {
  109.    { "manual", terminal .. " -e man awesome" },
  110.    { "edit config", editor_cmd .. " " .. awesome.conffile },
  111.    { "restart", awesome.restart },
  112.    { "quit", awesome.quit }
  113. }
  114.  
  115. mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu},
  116.                                     { "open terminal", terminal }
  117. }
  118.                         })
  119.  
  120. mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
  121.                                      menu = mymainmenu })
  122.  
  123. -- Menubar configuration
  124. menubar.utils.terminal = terminal -- Set the terminal for applications that require it
  125. -- }}}
  126.  
  127. -- {{{ Wibox
  128. --  Network usage widget
  129. -- Initialize widget, use widget({ type = "textbox" }) for awesome < 3.5
  130. netwidget = wibox.widget.textbox()
  131. -- Register widget
  132. vicious.register(netwidget, vicious.widgets.net, '<span color="#CC9393">${eth0 down_kb}</span> <span color="#7F9F7F">${eth0 up_kb}</span>', 3)
  133.  
  134. -- Initialize widget
  135. memwidget = wibox.widget.textbox()
  136. -- Register widget
  137. vicious.register(memwidget, vicious.widgets.mem, "⮡ $1% ", 13)
  138.  
  139. -- Initialize widget
  140. clockicon = wibox.widget.textbox()
  141. clockicon:set_text("⮖ ")
  142. verticalbar = wibox.widget.textbox()
  143. verticalbar:set_text(" ")
  144. void = wibox.widget.textbox()
  145. void:set_text(" ")
  146. -- Register widget
  147. -- vicious.register(clockicon, "⮖", 13)
  148.  
  149. -- Initialize widget
  150. cpuwidget = wibox.widget.textbox()
  151. -- Register widget
  152. vicious.register(cpuwidget, vicious.widgets.cpu, " ⮦ $1%  ")
  153.  
  154. -- Create a textclock widget
  155. mytextclock = awful.widget.textclock()
  156.  
  157.  
  158.  
  159. -- Create a wibox for each screen and add it
  160.  
  161. mywibox = {}
  162. mypromptbox = {}
  163. mylayoutbox = {}
  164. mytaglist = {}
  165. mytaglist.buttons = awful.util.table.join(
  166.                     awful.button({ }, 1, awful.tag.viewonly),
  167.                     awful.button({ modkey }, 1, awful.client.movetotag),
  168.                     awful.button({ }, 3, awful.tag.viewtoggle),
  169.                     awful.button({ modkey }, 3, awful.client.toggletag),
  170.                     awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end),
  171.                     awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end)
  172.                     )
  173. mytasklist = {}
  174. mytasklist.buttons = awful.util.table.join(
  175.                      awful.button({ }, 1, function (c)
  176.                                               if c == client.focus then
  177.                                                   c.minimized = true
  178.                                               else
  179.                                                   -- Without this, the following
  180.                                                   -- :isvisible() makes no sense
  181.                                                   c.minimized = false
  182.                                                   if not c:isvisible() then
  183.                                                       awful.tag.viewonly(c:tags()[1])
  184.                                                   end
  185.                                                   -- This will also un-minimize
  186.                                                   -- the client, if needed
  187.                                                   client.focus = c
  188.                                                   c:raise()
  189.                                               end
  190.                                           end),
  191.                      awful.button({ }, 3, function ()
  192.                                               if instance then
  193.                                                   instance:hide()
  194.                                                   instance = nil
  195.                                               else
  196.                                                   instance = awful.menu.clients({ width=250 })
  197.                                               end
  198.                                           end),
  199.                      awful.button({ }, 4, function ()
  200.                                               awful.client.focus.byidx(1)
  201.                                               if client.focus then client.focus:raise() end
  202.                                           end),
  203.                      awful.button({ }, 5, function ()
  204.                                               awful.client.focus.byidx(-1)
  205.                                               if client.focus then client.focus:raise() end
  206.                                           end))
  207.  
  208. for s = 1, screen.count() do
  209.     -- Create a promptbox for each screen
  210.     mypromptbox[s] = awful.widget.prompt()
  211.     -- Create an imagebox widget which will contains an icon indicating which layout we're using.
  212.     -- We need one layoutbox per screen.
  213.     mylayoutbox[s] = awful.widget.layoutbox(s)
  214.     mylayoutbox[s]:buttons(awful.util.table.join(
  215.                            awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
  216.                            awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
  217.                            awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
  218.                            awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
  219.     -- Create a taglist widget
  220.     mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons)
  221.  
  222.     -- Create a tasklist widget
  223.     mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
  224.  
  225.     -- Create the wibox
  226.     mywibox[s] = awful.wibox({ position = "top", screen = s, height= "16" })
  227.  
  228.     -- Widgets that are aligned to the left
  229.     local left_layout = wibox.layout.fixed.horizontal()
  230.     left_layout:add(void)
  231.     -- left_layout:add(mylauncher)
  232.     left_layout:add(mytaglist[s])
  233.     left_layout:add(verticalbar)
  234.     left_layout:add(mypromptbox[s])
  235.  
  236.     -- Widgets that are aligned to the right
  237.     local right_layout = wibox.layout.fixed.horizontal()
  238.     if s == 1 then right_layout:add(wibox.widget.systray()) end
  239.     right_layout:add(cpuwidget)
  240.     right_layout:add(memwidget)
  241.     right_layout:add(mytextclock)
  242.     right_layout:add(clockicon)
  243.     -- right_layout:add(mylayoutbox[s])
  244.     right_layout:add(void)
  245.     -- Now bring it all together (with the tasklist in the middle)
  246.     local layout = wibox.layout.align.horizontal()
  247.     layout:set_left(left_layout)
  248.     layout:set_middle(mytasklist[s])
  249.     layout:set_right(right_layout)
  250.  
  251.     mywibox[s]:set_widget(layout)
  252. end
  253. -- }}}
  254.  
  255. -- {{{ Mouse bindings
  256. root.buttons(awful.util.table.join(
  257.     awful.button({ }, 3, function () mymainmenu:toggle() end),
  258.     awful.button({ }, 4, awful.tag.viewnext),
  259.     awful.button({ }, 5, awful.tag.viewprev)
  260. ))
  261. -- }}}
  262.  
  263. -- {{{ Key bindings
  264. globalkeys = awful.util.table.join(
  265.     awful.key({ modkey, "Shift"   }, "Left",   awful.tag.viewprev       ),
  266.     awful.key({ modkey, "Shift"   }, "Right",  awful.tag.viewnext       ),
  267.     awful.key({ modkey,           }, "Escape", awful.tag.history.restore),
  268.     --awful.key({ modkey,           }, "i", function () run_or_raise("urxvt -name irssi -geometry 90x40 -e irssi", { instance = "irssi" }) end),
  269.     --awful.key({ modkey,           }, "n", function () run_or_raise("urxvt -name ncmpcpp -geometry 90x15 -e ncmpcpp", { instance = "ncmpcpp" }) end),
  270.    awful.key({ modkey }, "Next",  function () awful.client.moveresize( 0,  0, -40, -40) end),
  271.    awful.key({ modkey }, "Prior", function () awful.client.moveresize( 0, 0,  40,  40) end),
  272.    awful.key({ modkey }, "Down",  function () awful.client.moveresize(  0,  20,   0,   0) end),
  273.    awful.key({ modkey }, "Up",    function () awful.client.moveresize(  0, -20,   0,   0) end),
  274.    awful.key({ modkey }, "Left",  function () awful.client.moveresize(-20,   0,   0,   0) end),
  275.    awful.key({ modkey }, "Right", function () awful.client.moveresize( 20,   0,   0,   0) end),
  276.  
  277.    awful.key({ modkey, "Control" }, "Next",  function () awful.client.moveresize( 0,  0, -1, -1) end),
  278.    awful.key({ modkey, "Control" }, "Prior", function () awful.client.moveresize( 0, 0,  1,  1) end),
  279.    awful.key({ modkey, "Control" }, "Down",  function () awful.client.moveresize(  0,  1,   0,   0) end),
  280.    awful.key({ modkey, "Control" }, "Up",    function () awful.client.moveresize(  0, -1,   0,   0) end),
  281.    awful.key({ modkey, "Control" }, "Left",  function () awful.client.moveresize(-1,   0,   0,   0) end),
  282.    awful.key({ modkey, "Control" }, "Right", function () awful.client.moveresize( 1,   0,   0,   0) end),
  283.  
  284.     awful.key({ modkey,           }, "j",
  285.         function ()
  286.             awful.client.focus.byidx( 1)
  287.             if client.focus then client.focus:raise() end
  288.         end),
  289.     awful.key({ modkey,           }, "k",
  290.         function ()
  291.             awful.client.focus.byidx(-1)
  292.             if client.focus then client.focus:raise() end
  293.         end),
  294.     awful.key({ modkey,           }, "w", function () mymainmenu:show() end),
  295.  
  296.     -- Layout manipulation
  297.     awful.key({ modkey, "Shift"   }, "j", function () awful.client.swap.byidx(  1)    end),
  298.     awful.key({ modkey, "Shift"   }, "k", function () awful.client.swap.byidx( -1)    end),
  299.     awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end),
  300.     awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end),
  301.     awful.key({ modkey,           }, "u", awful.client.urgent.jumpto),
  302.     awful.key({ modkey,           }, "Tab",
  303.         function ()
  304.             awful.client.focus.history.previous()
  305.             if client.focus then
  306.                 client.focus:raise()
  307.             end
  308.         end),
  309.  
  310.     -- Standard program
  311.     awful.key({ modkey,           }, "Return", function () awful.util.spawn(terminal) end),
  312.     awful.key({ modkey, "Control" }, "r", awesome.restart),
  313.     awful.key({ modkey, "Shift"   }, "q", awesome.quit),
  314.  
  315.     awful.key({ modkey,           }, "l",     function () awful.tag.incmwfact( 0.05)    end),
  316.     awful.key({ modkey,           }, "h",     function () awful.tag.incmwfact(-0.05)    end),
  317.     awful.key({ modkey, "Shift"   }, "h",     function () awful.tag.incnmaster( 1)      end),
  318.     awful.key({ modkey, "Shift"   }, "l",     function () awful.tag.incnmaster(-1)      end),
  319.     awful.key({ modkey, "Control" }, "h",     function () awful.tag.incncol( 1)         end),
  320.     awful.key({ modkey, "Control" }, "l",     function () awful.tag.incncol(-1)         end),
  321.     awful.key({ modkey,           }, "space", function () awful.layout.inc(layouts,  1) end),
  322.     awful.key({ modkey, "Shift"   }, "space", function () awful.layout.inc(layouts, -1) end),
  323.  
  324.     awful.key({ modkey, "Control" }, "n", awful.client.restore),
  325.  
  326.     -- Prompt
  327.     awful.key({ modkey },            "r",     function () mypromptbox[mouse.screen]:run() end),
  328.  
  329.     awful.key({ modkey }, "x",
  330.               function ()
  331.                   awful.prompt.run({ prompt = "Run Lua code: " },
  332.                   mypromptbox[mouse.screen].widget,
  333.                   awful.util.eval, nil,
  334.                   awful.util.getdir("cache") .. "/history_eval")
  335.               end),
  336.     -- Menubar
  337.     awful.key({ modkey }, "p", function() menubar.show() end)
  338. )
  339.  
  340. clientkeys = awful.util.table.join(
  341.     awful.key({ modkey,           }, "f",      function (c) c.fullscreen = not c.fullscreen  end),
  342.     awful.key({ modkey, "Shift"   }, "c",      function (c) c:kill()                         end),
  343.     awful.key({ modkey, "Control" }, "space",  awful.client.floating.toggle                     ),
  344.     awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
  345.     awful.key({ modkey,           }, "o",      awful.client.movetoscreen                        ),
  346.     awful.key({ modkey,           }, "t",      function (c) c.ontop = not c.ontop            end),
  347.     awful.key({ modkey,           }, "n",
  348.         function (c)
  349.             -- The client currently has the input focus, so it cannot be
  350.             -- minimized, since minimized clients can't have the focus.
  351.             c.minimized = true
  352.         end),
  353.     awful.key({ modkey,           }, "m",
  354.         function (c)
  355.             c.maximized_horizontal = not c.maximized_horizontal
  356.             c.maximized_vertical   = not c.maximized_vertical
  357.         end)
  358. )
  359.  
  360. -- Bind all key numbers to tags.
  361. -- Be careful: we use keycodes to make it works on any keyboard layout.
  362. -- This should map on the top row of your keyboard, usually 1 to 9.
  363. for i = 1, 9 do
  364.     globalkeys = awful.util.table.join(globalkeys,
  365.         awful.key({ modkey }, "#" .. i + 9,
  366.                   function ()
  367.                         local screen = mouse.screen
  368.                         local tag = awful.tag.gettags(screen)[i]
  369.                         if tag then
  370.                            awful.tag.viewonly(tag)
  371.                         end
  372.                   end),
  373.         awful.key({ modkey, "Control" }, "#" .. i + 9,
  374.                   function ()
  375.                       local screen = mouse.screen
  376.                       local tag = awful.tag.gettags(screen)[i]
  377.                       if tag then
  378.                          awful.tag.viewtoggle(tag)
  379.                       end
  380.                   end),
  381.         awful.key({ modkey, "Shift" }, "#" .. i + 9,
  382.                   function ()
  383.                       local tag = awful.tag.gettags(client.focus.screen)[i]
  384.                       if client.focus and tag then
  385.                           awful.client.movetotag(tag)
  386.                      end
  387.                   end),
  388.         awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
  389.                   function ()
  390.                       local tag = awful.tag.gettags(client.focus.screen)[i]
  391.                       if client.focus and tag then
  392.                           awful.client.toggletag(tag)
  393.                       end
  394.                   end))
  395. end
  396.  
  397. clientbuttons = awful.util.table.join(
  398.     awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
  399.     awful.button({ modkey }, 1, awful.mouse.client.move),
  400.     awful.button({ modkey }, 3, awful.mouse.client.resize))
  401.  
  402. -- load the 'run or raise' function
  403. local ror = require("aweror")
  404.  
  405. -- generate and add the 'run or raise' key bindings to the globalkeys table
  406. globalkeys = awful.util.table.join(globalkeys, ror.genkeys(modkey))
  407.  
  408. root.keys(globalkeys)
  409.  
  410. -- Set keys
  411. root.keys(globalkeys)
  412. -- }}}
  413.  
  414. -- {{{ Rules
  415. awful.rules.rules = {
  416.     -- All clients willg match this rule.
  417.     { rule = { },
  418.       properties = { border_width = beautiful.border_width,
  419.                      border_color = beautiful.border_normal,
  420.                      focus = awful.client.focus.filter,
  421.                      keys = clientkeys,
  422.                      buttons = clientbuttons } },
  423.   --{ rule = { class = "mplayer2" },
  424.       --properties = { tag = tags[1][2], floating = true, switchtotag = true, x = 121, y = 42, width = 1036} },
  425.     { rule = { class = "mplayer2" },
  426.       properties = { tag = tags[1][2], floating = true, switchtotag = true },
  427.       callback = function(c) c:geometry({x=121, y=42, width=1036}) end },
  428.     { rule = { class = "pinentry" },
  429.       properties = { floating = true } },
  430.     { rule_any = { name = {"Options for Menu Editor", "Firefox Preferences", "Page Info", "Tab Mix Plus Options", "Library"} },
  431.       properties = { floating = true },
  432.       callback = awful.placement.centered },
  433.     { rule = { class = "gimp" },
  434.       properties = { tag = tags[1][3], floating = true, switchtotag = true } },
  435.   { rule = { instance = "irssi" },
  436.       properties = { floating = true, switchtotag = true, x = 1250, y = 220, callback = function(c) c:tags({tags[1][1], tags[1][2]}) end} },
  437.   { rule = { instance = "ncmpcpp" },
  438.       properties = { floating = true, switchtotag = true, x = 1250, y = 636, callback = function(c) c:tags({tags[1][1], tags[1][2]}) end} },
  439.   { rule = { instance = "term" },
  440.       properties = { floating = true, switchtotag = true, x = 1250, y = 790, callback = function(c) c:tags({tags[1][1], tags[1][2]}) end} },
  441.   { rule = { instance = "ranger" },
  442.       properties = { floating = true, switchtotag = true, x = 1250, y = 42, callback = function(c) c:tags({tags[1][1], tags[1][2]}) end} },
  443.   { rule = { class = "Firefox" },
  444.       properties = { tag = tags[1][1], floating = true, switchtotag = true, x = 121, y = 42, height = 1004, width = 1036} },
  445.   { rule = { class = "Chromium" },
  446.       properties = { tag = tags[1][1], floating = true, switchtotag = true, x = 121, y = 42, height = 1004, width = 1036} },
  447.   { rule = { class = "libreoffice-writer" },
  448.       properties = { tag = tags[1][1], floating = true, switchtotag = true, x = 121, y = 42, height = 1004, width = 1036} },
  449.   { rule = { class = "MComix" },
  450.       properties = { tag = tags[1][1], floating = true, switchtotag = true, x = 121, y = 42, height = 1004, width = 1036} },
  451.   { rule = { class = "Pynorama" },
  452.       properties = { tag = tags[1][1], floating = true, switchtotag = true, x = 121, y = 42, height = 1004, width = 1036} },
  453.  
  454.     -- Set Firefox to always map on tags number 2 of screen 1.
  455.     -- { rule = { class = "Firefox" },
  456.     --   properties = { tag = tags[1][2] } },
  457. }
  458. -- }}}
  459.  
  460. -- {{{ Signals
  461. -- Signal function to execute when a new client appears.
  462. client.connect_signal("manage", function (c, startup)
  463.     -- Enable sloppy focus
  464.     c:connect_signal("mouse::enter", function(c)
  465.         if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
  466.             and awful.client.focus.filter(c) then
  467.             client.focus = c
  468.         end
  469.     end)
  470.  
  471.     if not startup then
  472.         -- Set the windows at the slave,
  473.         -- i.e. put it at the end of others instead of setting it master.
  474.         -- awful.client.setslave(c)
  475.  
  476.         -- Put windows in a smart way, only if they does not set an initial position.
  477.         if not c.size_hints.user_position and not c.size_hints.program_position then
  478.             awful.placement.no_overlap(c)
  479.             awful.placement.no_offscreen(c)
  480.         end
  481.     end
  482.  
  483.     local titlebars_enabled = false
  484.     if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then
  485.         -- buttons for the titlebar
  486.         local buttons = awful.util.table.join(
  487.                 awful.button({ }, 1, function()
  488.                     client.focus = c
  489.                     c:raise()
  490.                     awful.mouse.client.move(c)
  491.                 end),
  492.                 awful.button({ }, 3, function()
  493.                     client.focus = c
  494.                     c:raise()
  495.                     awful.mouse.client.resize(c)
  496.                 end)
  497.                 )
  498.  
  499.         -- Widgets that are aligned to the left
  500.         local left_layout = wibox.layout.fixed.horizontal()
  501.         left_layout:add(awful.titlebar.widget.iconwidget(c))
  502.         left_layout:buttons(buttons)
  503.  
  504.         -- Widgets that are aligned to the right
  505.         local right_layout = wibox.layout.fixed.horizontal()
  506.         right_layout:add(awful.titlebar.widget.floatingbutton(c))
  507.         right_layout:add(awful.titlebar.widget.maximizedbutton(c))
  508.         right_layout:add(awful.titlebar.widget.stickybutton(c))
  509.         right_layout:add(awful.titlebar.widget.ontopbutton(c))
  510.         right_layout:add(awful.titlebar.widget.closebutton(c))
  511.  
  512.         -- The title goes in the middle
  513.         local middle_layout = wibox.layout.flex.horizontal()
  514.         local title = awful.titlebar.widget.titlewidget(c)
  515.         title:set_align("center")
  516.         middle_layout:add(title)
  517.         middle_layout:buttons(buttons)
  518.  
  519.         -- Now bring it all together
  520.         local layout = wibox.layout.align.horizontal()
  521.         layout:set_left(left_layout)
  522.         layout:set_right(right_layout)
  523.         layout:set_middle(middle_layout)   
  524.  
  525.         awful.titlebar(c):set_widget(layout)
  526.     end
  527. end)
  528.  
  529. client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
  530. client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
  531.  
  532. --run_or_raise("urxvt -name irssi -geometry 90x32 -e irssi",  { instance = "irssi" })
  533. --run_or_raise("urxvt -name ncmpcpp -geometry 90x10 -e ncmpcpp", { instance = "ncmpcpp" })
  534. --run_or_raise("urxvt -name ranger -geometry 90x12 -e ranger", { instance = "ranger" })
  535. --run_or_raise("urxvt -name term3 -geometry 90x21", { instance = "term3" })
  536. --run_or_raise("firefox",  { instance = "Firefox" })
  537.  
  538.  
  539.  
  540. -- }}}
Advertisement
Add Comment
Please, Sign In to add comment