Advertisement
onejdc

AwesomeWM rc.lua

Aug 28th, 2023 (edited)
1,545
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 24.04 KB | Software | 0 0
  1. -- If LuaRocks is installed, make sure that packages installed through it are
  2. -- found (e.g. lgi). If LuaRocks is not installed, do nothing.
  3. pcall(require, "luarocks.loader")
  4.  
  5. -- Standard awesome library
  6. local gears = require("gears")
  7. local awful = require("awful")
  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. local hotkeys_popup = require("awful.hotkeys_popup")
  17. -- Enable hotkeys help widget for VIM and other apps
  18. -- when client with a matching name is opened:
  19. require("awful.hotkeys_popup.keys")
  20.  
  21. -- {{{ Error handling
  22. -- Check if awesome encountered an error during startup and fell back to
  23. -- another config (This code will only ever execute for the fallback config)
  24. if awesome.startup_errors then
  25.     naughty.notify({ preset = naughty.config.presets.critical,
  26.                      title = "Oops, there were errors during startup!",
  27.                      text = awesome.startup_errors })
  28. end
  29.  
  30. -- Handle runtime errors after startup
  31. do
  32.     local in_error = false
  33.     awesome.connect_signal("debug::error", function (err)
  34.         -- Make sure we don't go into an endless error loop
  35.         if in_error then return end
  36.         in_error = true
  37.  
  38.         naughty.notify({ preset = naughty.config.presets.critical,
  39.                          title = "Oops, an error happened!",
  40.                          text = tostring(err) })
  41.         in_error = false
  42.     end)
  43. end
  44. -- }}}
  45.  
  46. -- {{{ Variable definitions
  47. -- Themes define colours, icons, font and wallpapers.
  48. beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
  49.  
  50. -- This is used later as the default terminal and editor to run.
  51. terminal = "xterm"
  52. editor = os.getenv("EDITOR") or "nano"
  53. editor_cmd = terminal .. " -e " .. editor
  54.  
  55. -- Default modkey.
  56. -- Usually, Mod4 is the key with a logo between Control and Alt.
  57. -- If you do not like this or do not have such a key,
  58. -- I suggest you to remap Mod4 to another key using xmodmap or other tools.
  59. -- However, you can use another modifier like Mod1, but it may interact with others.
  60. modkey = "Mod4"
  61.  
  62. -- Table of layouts to cover with awful.layout.inc, order matters.
  63. awful.layout.layouts = {
  64.     awful.layout.suit.floating,
  65.     awful.layout.suit.tile,
  66.     awful.layout.suit.tile.left,
  67.     awful.layout.suit.tile.bottom,
  68.     awful.layout.suit.tile.top,
  69.     awful.layout.suit.fair,
  70.     awful.layout.suit.fair.horizontal,
  71.     awful.layout.suit.spiral,
  72.     awful.layout.suit.spiral.dwindle,
  73.     awful.layout.suit.max,
  74.     awful.layout.suit.max.fullscreen,
  75.     awful.layout.suit.magnifier,
  76.     awful.layout.suit.corner.nw,
  77.     -- awful.layout.suit.corner.ne,
  78.     -- awful.layout.suit.corner.sw,
  79.     -- awful.layout.suit.corner.se,
  80. }
  81. -- }}}
  82.  
  83. -- {{{ Menu
  84. -- Create a launcher widget and a main menu
  85. myawesomemenu = {
  86.    { "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end },
  87.    { "manual", terminal .. " -e man awesome" },
  88.    { "edit config", editor_cmd .. " " .. awesome.conffile },
  89.    { "restart", awesome.restart },
  90.    { "quit", function() awesome.quit() end },
  91. }
  92.  
  93. mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
  94.                                     { "open terminal", terminal }
  95.                                   }
  96.                         })
  97.  
  98. mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
  99.                                      menu = mymainmenu })
  100.  
  101. -- Menubar configuration
  102. menubar.utils.terminal = terminal -- Set the terminal for applications that require it
  103. -- }}}
  104.  
  105. -- Keyboard map indicator and switcher
  106. mykeyboardlayout = awful.widget.keyboardlayout()
  107.  
  108. -- {{{ Wibar
  109. -- Create a textclock widget
  110. mytextclock = wibox.widget.textclock()
  111.  
  112. -- Create a wibox for each screen and add it
  113. local taglist_buttons = gears.table.join(
  114.                     awful.button({ }, 1, function(t) t:view_only() end),
  115.                     awful.button({ modkey }, 1, function(t)
  116.                                               if client.focus then
  117.                                                   client.focus:move_to_tag(t)
  118.                                               end
  119.                                           end),
  120.                     awful.button({ }, 3, awful.tag.viewtoggle),
  121.                     awful.button({ modkey }, 3, function(t)
  122.                                               if client.focus then
  123.                                                   client.focus:toggle_tag(t)
  124.                                               end
  125.                                           end),
  126.                     awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
  127.                     awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
  128.                 )
  129.  
  130. local tasklist_buttons = gears.table.join(
  131.                      awful.button({ }, 1, function (c)
  132.                                               if c == client.focus then
  133.                                                   c.minimized = true
  134.                                               else
  135.                                                   c:emit_signal(
  136.                                                       "request::activate",
  137.                                                       "tasklist",
  138.                                                       {raise = true}
  139.                                                   )
  140.                                               end
  141.                                           end),
  142.                      awful.button({ }, 3, function()
  143.                                               awful.menu.client_list({ theme = { width = 250 } })
  144.                                           end),
  145.                      awful.button({ }, 4, function ()
  146.                                               awful.client.focus.byidx(1)
  147.                                           end),
  148.                      awful.button({ }, 5, function ()
  149.                                               awful.client.focus.byidx(-1)
  150.                                           end))
  151.  
  152. local function set_wallpaper(s)
  153.     -- Wallpaper
  154.     if beautiful.wallpaper then
  155.         local wallpaper = beautiful.wallpaper
  156.         -- If wallpaper is a function, call it with the screen
  157.         if type(wallpaper) == "function" then
  158.             wallpaper = wallpaper(s)
  159.         end
  160.         gears.wallpaper.maximized(wallpaper, s, true)
  161.     end
  162. end
  163.  
  164. -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
  165. screen.connect_signal("property::geometry", set_wallpaper)
  166.  
  167. awful.screen.connect_for_each_screen(function(s)
  168.     -- Wallpaper
  169.     set_wallpaper(s)
  170.  
  171.     -- Each screen has its own tag table.
  172.     awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])
  173.  
  174.     -- Create a promptbox for each screen
  175.     s.mypromptbox = awful.widget.prompt()
  176.     -- Create an imagebox widget which will contain an icon indicating which layout we're using.
  177.     -- We need one layoutbox per screen.
  178.     s.mylayoutbox = awful.widget.layoutbox(s)
  179.     s.mylayoutbox:buttons(gears.table.join(
  180.                            awful.button({ }, 1, function () awful.layout.inc( 1) end),
  181.                            awful.button({ }, 3, function () awful.layout.inc(-1) end),
  182.                            awful.button({ }, 4, function () awful.layout.inc( 1) end),
  183.                            awful.button({ }, 5, function () awful.layout.inc(-1) end)))
  184.     -- Create a taglist widget
  185.     s.mytaglist = awful.widget.taglist {
  186.         screen  = s,
  187.         filter  = awful.widget.taglist.filter.all,
  188.         buttons = taglist_buttons
  189.     }
  190.  
  191.     -- Create a tasklist widget
  192.     s.mytasklist = awful.widget.tasklist {
  193.         screen  = s,
  194.         filter  = awful.widget.tasklist.filter.currenttags,
  195.         buttons = tasklist_buttons
  196.     }
  197.  
  198.     -- Create the wibox
  199.     s.mywibox = awful.wibar({ position = "top", screen = s })
  200.  
  201.     -- Add widgets to the wibox
  202.     s.mywibox:setup {
  203.         layout = wibox.layout.align.horizontal,
  204.         { -- Left widgets
  205.             layout = wibox.layout.fixed.horizontal,
  206.             mylauncher,
  207.             s.mytaglist,
  208.             s.mypromptbox,
  209.         },
  210.         s.mytasklist, -- Middle widget
  211.         { -- Right widgets
  212.             layout = wibox.layout.fixed.horizontal,
  213.             mykeyboardlayout,
  214.             wibox.widget.systray(),
  215.             mytextclock,
  216.             s.mylayoutbox,
  217.         },
  218.     }
  219. end)
  220. -- }}}
  221.  
  222. -- {{{ Mouse bindings
  223. root.buttons(gears.table.join(
  224.     awful.button({ }, 3, function () mymainmenu:toggle() end),
  225.     awful.button({ }, 4, awful.tag.viewnext),
  226.     awful.button({ }, 5, awful.tag.viewprev)
  227. ))
  228. -- }}}
  229.  
  230. -- {{{ Key bindings
  231. globalkeys = gears.table.join(
  232.     awful.key({ modkey,           }, "s",      hotkeys_popup.show_help,
  233.               {description="show help", group="awesome"}),
  234.     awful.key({ modkey,           }, "Left",   awful.tag.viewprev,
  235.               {description = "view previous", group = "tag"}),
  236.     awful.key({ modkey,           }, "Right",  awful.tag.viewnext,
  237.               {description = "view next", group = "tag"}),
  238.     awful.key({ modkey,           }, "Escape", awful.tag.history.restore,
  239.               {description = "go back", group = "tag"}),
  240.  
  241.     awful.key({ modkey,           }, "j",
  242.         function ()
  243.             awful.client.focus.byidx( 1)
  244.         end,
  245.         {description = "focus next by index", group = "client"}
  246.     ),
  247.     awful.key({ modkey,           }, "k",
  248.         function ()
  249.             awful.client.focus.byidx(-1)
  250.         end,
  251.         {description = "focus previous by index", group = "client"}
  252.     ),
  253.     awful.key({ modkey,           }, "w", function () mymainmenu:show() end,
  254.               {description = "show main menu", group = "awesome"}),
  255.  
  256.     -- Layout manipulation
  257.     awful.key({ modkey, "Shift"   }, "j", function () awful.client.swap.byidx(  1)    end,
  258.               {description = "swap with next client by index", group = "client"}),
  259.     awful.key({ modkey, "Shift"   }, "k", function () awful.client.swap.byidx( -1)    end,
  260.               {description = "swap with previous client by index", group = "client"}),
  261.     awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
  262.               {description = "focus the next screen", group = "screen"}),
  263.     awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
  264.               {description = "focus the previous screen", group = "screen"}),
  265.     awful.key({ modkey,           }, "u", awful.client.urgent.jumpto,
  266.               {description = "jump to urgent client", group = "client"}),
  267.     awful.key({ modkey,           }, "Tab",
  268.         function ()
  269.             awful.client.focus.history.previous()
  270.             if client.focus then
  271.                 client.focus:raise()
  272.             end
  273.         end,
  274.         {description = "go back", group = "client"}),
  275.  
  276.     -- Standard program
  277.     awful.key({ modkey,           }, "Return", function () awful.spawn(terminal) end,
  278.               {description = "open a terminal", group = "launcher"}),
  279.     awful.key({ modkey, "Control" }, "r", awesome.restart,
  280.               {description = "reload awesome", group = "awesome"}),
  281.     awful.key({ modkey, "Shift"   }, "q", awesome.quit,
  282.               {description = "quit awesome", group = "awesome"}),
  283.  
  284.     awful.key({ modkey,           }, "l",     function () awful.tag.incmwfact( 0.05)          end,
  285.               {description = "increase master width factor", group = "layout"}),
  286.     awful.key({ modkey,           }, "h",     function () awful.tag.incmwfact(-0.05)          end,
  287.               {description = "decrease master width factor", group = "layout"}),
  288.     awful.key({ modkey, "Shift"   }, "h",     function () awful.tag.incnmaster( 1, nil, true) end,
  289.               {description = "increase the number of master clients", group = "layout"}),
  290.     awful.key({ modkey, "Shift"   }, "l",     function () awful.tag.incnmaster(-1, nil, true) end,
  291.               {description = "decrease the number of master clients", group = "layout"}),
  292.     awful.key({ modkey, "Control" }, "h",     function () awful.tag.incncol( 1, nil, true)    end,
  293.               {description = "increase the number of columns", group = "layout"}),
  294.     awful.key({ modkey, "Control" }, "l",     function () awful.tag.incncol(-1, nil, true)    end,
  295.               {description = "decrease the number of columns", group = "layout"}),
  296.     awful.key({ modkey,           }, "space", function () awful.layout.inc( 1)                end,
  297.               {description = "select next", group = "layout"}),
  298.     awful.key({ modkey, "Shift"   }, "space", function () awful.layout.inc(-1)                end,
  299.               {description = "select previous", group = "layout"}),
  300.  
  301.     awful.key({ modkey, "Control" }, "n",
  302.               function ()
  303.                   local c = awful.client.restore()
  304.                   -- Focus restored client
  305.                   if c then
  306.                     c:emit_signal(
  307.                         "request::activate", "key.unminimize", {raise = true}
  308.                     )
  309.                   end
  310.               end,
  311.               {description = "restore minimized", group = "client"}),
  312.  
  313.     -- Prompt
  314.     awful.key({ modkey },            "r",     function () awful.screen.focused().mypromptbox:run() end,
  315.               {description = "run prompt", group = "launcher"}),
  316.  
  317.     awful.key({ modkey }, "x",
  318.               function ()
  319.                   awful.prompt.run {
  320.                     prompt       = "Run Lua code: ",
  321.                     textbox      = awful.screen.focused().mypromptbox.widget,
  322.                     exe_callback = awful.util.eval,
  323.                     history_path = awful.util.get_cache_dir() .. "/history_eval"
  324.                   }
  325.               end,
  326.               {description = "lua execute prompt", group = "awesome"}),
  327.     -- Menubar
  328.     awful.key({ modkey }, "p", function() menubar.show() end,
  329.               {description = "show the menubar", group = "launcher"}),
  330.  
  331.  
  332.     -- Move Between Tags (workspaces):
  333.     awful.key({ modkey, "Shift" }, "Left", function ()
  334.         if client.focus then
  335.             local index = awful.screen.focused().selected_tag.index - 1
  336.             index = (index < 1 and #awful.screen.focused().tags or index)
  337.             local tag = client.focus.screen.tags[index]
  338.             if tag then
  339.                 client.focus:move_to_tag(tag)
  340.             end
  341.         end
  342.         awful.tag.viewprev()
  343.     end,
  344.         {description = "view previous and move app", group = "tag"}),
  345.  
  346.     awful.key({ modkey, "Shift" }, "Right", function ()
  347.         if client.focus then
  348.             local index = awful.screen.focused().selected_tag.index + 1
  349.             index = (index > #awful.screen.focused().tags and 1 or index)
  350.             local tag = client.focus.screen.tags[index]
  351.             if tag then
  352.                 client.focus:move_to_tag(tag)
  353.             end
  354.         eand
  355.     awful.tag.viewnext()
  356.     end,
  357.     {description = "view next and move app", group = "tag"})
  358. )
  359.  
  360. clientkeys = gears.table.join(
  361.     awful.key({ modkey,           }, "f",
  362.         function (c)
  363.             c.fullscreen = not c.fullscreen
  364.             c:raise()
  365.         end,
  366.         {description = "toggle fullscreen", group = "client"}),
  367.     awful.key({ modkey, "Shift"   }, "c",      function (c) c:kill()                         end,
  368.               {description = "close", group = "client"}),
  369.     awful.key({ modkey, "Control" }, "space",  awful.client.floating.toggle                     ,
  370.               {description = "toggle floating", group = "client"}),
  371.     awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
  372.               {description = "move to master", group = "client"}),
  373.     awful.key({ modkey,           }, "o",      function (c) c:move_to_screen()               end,
  374.               {description = "move to screen", group = "client"}),
  375.     awful.key({ modkey,           }, "t",      function (c) c.ontop = not c.ontop            end,
  376.               {description = "toggle keep on top", group = "client"}),
  377.     awful.key({ modkey,           }, "n",
  378.         function (c)
  379.             -- The client currently has the input focus, so it cannot be
  380.             -- minimized, since minimized clients can't have the focus.
  381.             c.minimized = true
  382.         end ,
  383.         {description = "minimize", group = "client"}),
  384.     awful.key({ modkey,           }, "m",
  385.         function (c)
  386.             c.maximized = not c.maximized
  387.             c:raise()
  388.         end ,
  389.         {description = "(un)maximize", group = "client"}),
  390.     awful.key({ modkey, "Control" }, "m",
  391.         function (c)
  392.             c.maximized_vertical = not c.maximized_vertical
  393.             c:raise()
  394.         end ,
  395.         {description = "(un)maximize vertically", group = "client"}),
  396.     awful.key({ modkey, "Shift"   }, "m",
  397.         function (c)
  398.             c.maximized_horizontal = not c.maximized_horizontal
  399.             c:raise()
  400.         end ,
  401.         {description = "(un)maximize horizontally", group = "client"})
  402. )
  403.  
  404. -- Bind all key numbers to tags.
  405. -- Be careful: we use keycodes to make it work on any keyboard layout.
  406. -- This should map on the top row of your keyboard, usually 1 to 9.
  407. for i = 1, 9 do
  408.     globalkeys = gears.table.join(globalkeys,
  409.         -- View tag only.
  410.         awful.key({ modkey }, "#" .. i + 9,
  411.                   function ()
  412.                         local screen = awful.screen.focused()
  413.                         local tag = screen.tags[i]
  414.                         if tag then
  415.                            tag:view_only()
  416.                         end
  417.                   end,
  418.                   {description = "view tag #"..i, group = "tag"}),
  419.         -- Toggle tag display.
  420.         awful.key({ modkey, "Control" }, "#" .. i + 9,
  421.                   function ()
  422.                       local screen = awful.screen.focused()
  423.                       local tag = screen.tags[i]
  424.                       if tag then
  425.                          awful.tag.viewtoggle(tag)
  426.                       end
  427.                   end,
  428.                   {description = "toggle tag #" .. i, group = "tag"}),
  429.         -- Move client to tag.
  430.         awful.key({ modkey, "Shift" }, "#" .. i + 9,
  431.                   function ()
  432.                       if client.focus then
  433.                           local tag = client.focus.screen.tags[i]
  434.                           if tag then
  435.                               client.focus:move_to_tag(tag)
  436.                           end
  437.                      end
  438.                   end,
  439.                   {description = "move focused client to tag #"..i, group = "tag"}),
  440.         -- Toggle tag on focused client.
  441.         awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
  442.                   function ()
  443.                       if client.focus then
  444.                           local tag = client.focus.screen.tags[i]
  445.                           if tag then
  446.                               client.focus:toggle_tag(tag)
  447.                           end
  448.                       end
  449.                   end,
  450.                   {description = "toggle focused client on tag #" .. i, group = "tag"})
  451.     )
  452. end
  453.  
  454. clientbuttons = gears.table.join(
  455.     awful.button({ }, 1, function (c)
  456.         c:emit_signal("request::activate", "mouse_click", {raise = true})
  457.     end),
  458.     awful.button({ modkey }, 1, function (c)
  459.         c:emit_signal("request::activate", "mouse_click", {raise = true})
  460.         awful.mouse.client.move(c)
  461.     end),
  462.     awful.button({ modkey }, 3, function (c)
  463.         c:emit_signal("request::activate", "mouse_click", {raise = true})
  464.         awful.mouse.client.resize(c)
  465.     end)
  466. )
  467.  
  468. -- Set keys
  469. root.keys(globalkeys)
  470. -- }}}
  471.  
  472. -- {{{ Rules
  473. -- Rules to apply to new clients (through the "manage" signal).
  474. awful.rules.rules = {
  475.     -- All clients will match this rule.
  476.     { rule = { },
  477.       properties = { border_width = beautiful.border_width,
  478.                      border_color = beautiful.border_normal,
  479.                      focus = awful.client.focus.filter,
  480.                      raise = true,
  481.                      keys = clientkeys,
  482.                      buttons = clientbuttons,
  483.                      screen = awful.screen.preferred,
  484.                      placement = awful.placement.no_overlap+awful.placement.no_offscreen
  485.      }
  486.     },
  487.  
  488.     -- Floating clients.
  489.     { rule_any = {
  490.         instance = {
  491.           "DTA",  -- Firefox addon DownThemAll.
  492.           "copyq",  -- Includes session name in class.
  493.           "pinentry",
  494.         },
  495.         class = {
  496.           "Arandr",
  497.           "Blueman-manager",
  498.           "Gpick",
  499.           "Kruler",
  500.           "MessageWin",  -- kalarm.
  501.           "Sxiv",
  502.           "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
  503.           "Wpa_gui",
  504.           "veromix",
  505.           "xtightvncviewer"},
  506.  
  507.         -- Note that the name property shown in xprop might be set slightly after creation of the client
  508.         -- and the name shown there might not match defined rules here.
  509.         name = {
  510.           "Event Tester",  -- xev.
  511.         },
  512.         role = {
  513.           "AlarmWindow",  -- Thunderbird's calendar.
  514.           "ConfigManager",  -- Thunderbird's about:config.
  515.           "pop-up",       -- e.g. Google Chrome's (detached) Developer Tools.
  516.         }
  517.       }, properties = { floating = true }},
  518.  
  519.     -- Add titlebars to normal clients and dialogs
  520.     { rule_any = {type = { "normal", "dialog" }
  521.       }, properties = { titlebars_enabled = true }
  522.     },
  523.  
  524.     -- Set Firefox to always map on the tag named "2" on screen 1.
  525.     -- { rule = { class = "Firefox" },
  526.     --   properties = { screen = 1, tag = "2" } },
  527. }
  528. -- }}}
  529.  
  530. -- {{{ Signals
  531. -- Signal function to execute when a new client appears.
  532. client.connect_signal("manage", function (c)
  533.     -- Set the windows at the slave,
  534.     -- i.e. put it at the end of others instead of setting it master.
  535.     -- if not awesome.startup then awful.client.setslave(c) end
  536.  
  537.     if awesome.startup
  538.       and not c.size_hints.user_position
  539.       and not c.size_hints.program_position then
  540.         -- Prevent clients from being unreachable after screen count changes.
  541.         awful.placement.no_offscreen(c)
  542.     end
  543. end)
  544.  
  545. -- Add a titlebar if titlebars_enabled is set to true in the rules.
  546. client.connect_signal("request::titlebars", function(c)
  547.     -- buttons for the titlebar
  548.     local buttons = gears.table.join(
  549.         awful.button({ }, 1, function()
  550.             c:emit_signal("request::activate", "titlebar", {raise = true})
  551.             awful.mouse.client.move(c)
  552.         end),
  553.         awful.button({ }, 3, function()
  554.             c:emit_signal("request::activate", "titlebar", {raise = true})
  555.             awful.mouse.client.resize(c)
  556.         end)
  557.     )
  558.  
  559.     awful.titlebar(c) : setup {
  560.         { -- Left
  561.             awful.titlebar.widget.iconwidget(c),
  562.             buttons = buttons,
  563.             layout  = wibox.layout.fixed.horizontal
  564.         },
  565.         { -- Middle
  566.             { -- Title
  567.                 align  = "center",
  568.                 widget = awful.titlebar.widget.titlewidget(c)
  569.             },
  570.             buttons = buttons,
  571.             layout  = wibox.layout.flex.horizontal
  572.         },
  573.         { -- Right
  574.             awful.titlebar.widget.floatingbutton (c),
  575.             awful.titlebar.widget.maximizedbutton(c),
  576.             awful.titlebar.widget.stickybutton   (c),
  577.             awful.titlebar.widget.ontopbutton    (c),
  578.             awful.titlebar.widget.closebutton    (c),
  579.             layout = wibox.layout.fixed.horizontal()
  580.         },
  581.         layout = wibox.layout.align.horizontal
  582.     }
  583. end)
  584.  
  585. -- Enable sloppy focus, so that focus follows mouse.
  586. client.connect_signal("mouse::enter", function(c)
  587.     c:emit_signal("request::activate", "mouse_enter", {raise = false})
  588. end)
  589.  
  590. client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
  591. client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
  592. -- }}}
  593.  
  594. beautiful.useless_gap = 7
  595. beautiful.gap_single_client = true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement