nerdymekal

Awesome rc.lua

Apr 19th, 2024
18
0
16 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 25.35 KB | Source Code | 0 0
  1. ---------------------------------------------------------------------------
  2. --- The default rc.lua file.
  3. --
  4. -- A copy of this file is usually installed in `/etc/xdg/awesome/`.
  5. --
  6. -- See [The declarative layout system](../documentation/05-awesomerc.md.html)
  7. -- for a version with additional comments.
  8. --
  9. --
  10.    -- awesome_mode: api-level=4:screen=on
  11.    -- If LuaRocks is installed, make sure that packages installed through it are
  12.    -- found (e.g. lgi). If LuaRocks is not installed, do nothing.
  13.    pcall(require, "luarocks.loader")
  14.    
  15.    -- Standard awesome library
  16.    local gears = require("gears")
  17.    local awful = require("awful")
  18.    require("awful.autofocus")
  19.    -- Widget and layout library
  20.    local wibox = require("wibox")
  21.    -- Theme handling library
  22.    local beautiful = require("beautiful")
  23.    -- Notification library
  24.    local naughty = require("naughty")
  25.    -- Declarative object management
  26.    local ruled = require("ruled")
  27.    local menubar = require("menubar")
  28.    local hotkeys_popup = require("awful.hotkeys_popup")
  29.    -- Enable hotkeys help widget for VIM and other apps
  30.    -- when client with a matching name is opened:
  31.    require("awful.hotkeys_popup.keys")
  32.    
  33.    -- {{{ Error handling
  34.    -- Check if awesome encountered an error during startup and fell back to
  35.    -- another config (This code will only ever execute for the fallback config)
  36.    naughty.connect_signal("request::display_error", function(message, startup)
  37.        naughty.notification {
  38.            urgency = "critical",
  39.            title   = "Oops, an error happened"..(startup and " during startup!" or "!"),
  40.            message = message
  41.        }
  42.    end)
  43.    -- }}}
  44.    
  45.    -- {{{ Variable definitions
  46.    -- Themes define colours, icons, font and wallpapers.
  47.    beautiful.init(gears.filesystem.get_themes_dir() .. "xresources/theme.lua")
  48.    
  49.    -- This is used later as the default terminal and editor to run.
  50.    terminal = "alacritty"
  51.    editor = os.getenv("EDITOR") or "nano"
  52.    editor_cmd = terminal .. " -e " .. editor
  53.    
  54.    -- Default modkey.
  55.    -- Usually, Mod4 is the key with a logo between Control and Alt.
  56.    -- If you do not like this or do not have such a key,
  57.    -- I suggest you to remap Mod4 to another key using xmodmap or other tools.
  58.    -- However, you can use another modifier like Mod1, but it may interact with others.
  59.    modkey = "Mod4"
  60.    -- }}}
  61.    
  62.    -- {{{ Menu
  63.    -- Create a launcher widget and a main menu
  64.    myawesomemenu = {
  65.       { "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end },
  66.       { "manual", terminal .. " -e man awesome" },
  67.       { "edit config", editor_cmd .. " " .. awesome.conffile },
  68.       { "restart", awesome.restart },
  69.       { "quit", function() awesome.quit() end },
  70.    }
  71.    
  72.    mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
  73.                                        { "open terminal", terminal }
  74.                                      }
  75.                            })
  76.    
  77.    mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
  78.                                         menu = mymainmenu })
  79.    
  80.    -- Menubar configuration
  81.    menubar.utils.terminal = terminal -- Set the terminal for applications that require it
  82.    -- }}}
  83.    
  84.    -- {{{ Tag layout
  85.    -- Table of layouts to cover with awful.layout.inc, order matters.
  86.    tag.connect_signal("request::default_layouts", function()
  87.        awful.layout.append_default_layouts({
  88.            awful.layout.suit.floating,
  89.            awful.layout.suit.tile,
  90.            awful.layout.suit.tile.left,
  91.            awful.layout.suit.tile.bottom,
  92.            awful.layout.suit.tile.top,
  93.            awful.layout.suit.fair,
  94.            awful.layout.suit.fair.horizontal,
  95.            awful.layout.suit.spiral,
  96.            awful.layout.suit.spiral.dwindle,
  97.            awful.layout.suit.max,
  98.            awful.layout.suit.max.fullscreen,
  99.            awful.layout.suit.magnifier,
  100.            awful.layout.suit.corner.nw,
  101.        })
  102.    end)
  103.    -- }}}
  104.    
  105.    -- {{{ Wallpaper
  106.    screen.connect_signal("request::wallpaper", function(s)
  107.        awful.wallpaper {
  108.            screen = s,
  109.            widget = {
  110.                {
  111.                    image     = beautiful.wallpaper,
  112.                    upscale   = true,
  113.                    downscale = true,
  114.                    widget    = wibox.widget.imagebox,
  115.                },
  116.                valign = "center",
  117.                halign = "center",
  118.                tiled  = false,
  119.                widget = wibox.container.tile,
  120.            }
  121.        }
  122.    end)
  123.    -- }}}
  124.    
  125.    -- {{{ Wibar
  126.    
  127.    -- Keyboard map indicator and switcher
  128.    mykeyboardlayout = awful.widget.keyboardlayout()
  129.    
  130.    -- Create a textclock widget
  131.    mytextclock = wibox.widget.textclock()
  132.    
  133.    screen.connect_signal("request::desktop_decoration", function(s)
  134.         -- Each screen has its own tag table.
  135.         local names = { "", "", "3", "4", "5", "6", "", "", "" }
  136.         local l = awful.layout.suit  -- Just to save some typing: use an alias.
  137.         local layouts = { l.tile, l.tile, l.tile, l.tile, l.tile, l.tile, l.tile, l.max, l.max }
  138.         awful.tag(names, s, layouts)
  139.  
  140.  
  141. -- static const char *tags[] = { "", "", "", "", "5", "󰤽", "", "", "9" };
  142.    
  143.        -- Create a promptbox for each screen
  144.        s.mypromptbox = awful.widget.prompt()
  145.    
  146.        -- Create an imagebox widget which will contain an icon indicating which layout we're using.
  147.        -- We need one layoutbox per screen.
  148.        s.mylayoutbox = awful.widget.layoutbox {
  149.            screen  = s,
  150.            buttons = {
  151.                awful.button({ }, 1, function () awful.layout.inc( 1) end),
  152.                awful.button({ }, 3, function () awful.layout.inc(-1) end),
  153.                awful.button({ }, 4, function () awful.layout.inc(-1) end),
  154.                awful.button({ }, 5, function () awful.layout.inc( 1) end),
  155.            }
  156.        }
  157.    
  158.        -- Create a taglist widget
  159.        s.mytaglist = awful.widget.taglist {
  160.            screen  = s,
  161.            filter  = awful.widget.taglist.filter.all,
  162.            buttons = {
  163.                awful.button({ }, 1, function(t) t:view_only() end),
  164.                awful.button({ modkey }, 1, function(t)
  165.                                                if client.focus then
  166.                                                    client.focus:move_to_tag(t)
  167.                                                end
  168.                                            end),
  169.                awful.button({ }, 3, awful.tag.viewtoggle),
  170.                awful.button({ modkey }, 3, function(t)
  171.                                                if client.focus then
  172.                                                    client.focus:toggle_tag(t)
  173.                                                end
  174.                                            end),
  175.                awful.button({ }, 4, function(t) awful.tag.viewprev(t.screen) end),
  176.                awful.button({ }, 5, function(t) awful.tag.viewnext(t.screen) end),
  177.            }
  178.        }
  179.    
  180.        -- Create a tasklist widget
  181.        s.mytasklist = awful.widget.tasklist {
  182.            screen  = s,
  183.            filter  = awful.widget.tasklist.filter.currenttags,
  184.            buttons = {
  185.                awful.button({ }, 1, function (c)
  186.                    c:activate { context = "tasklist", action = "toggle_minimization" }
  187.                end),
  188.                awful.button({ }, 3, function() awful.menu.client_list { theme = { width = 250 } } end),
  189.                awful.button({ }, 4, function() awful.client.focus.byidx(-1) end),
  190.                awful.button({ }, 5, function() awful.client.focus.byidx( 1) end),
  191.            }
  192.        }
  193.    
  194.        -- Create the wibox
  195.        s.mywibox = awful.wibar {
  196.            position = "top",
  197.            screen   = s,
  198.            widget   = {
  199.                layout = wibox.layout.align.horizontal,
  200.                { -- Left widgets
  201.                    layout = wibox.layout.fixed.horizontal,
  202.                    -- mylauncher,
  203.                    s.mytaglist,
  204.                    s.mypromptbox,
  205.                },
  206.                s.mytasklist, -- Middle widget
  207.                { -- Right widgets
  208.                    layout = wibox.layout.fixed.horizontal,
  209.                    awful.widget.watch('bash -c "./Apps/BashScripts/Blocks/cpu.sh"', 3),
  210.                    wibox.widget.textbox('    '),
  211.                    awful.widget.watch('bash -c "./Apps/BashScripts/Blocks/ram.sh"', 3),
  212.                    wibox.widget.textbox('    '),
  213.                    awful.widget.watch('bash -c "./Apps/BashScripts/Blocks/hdd.sh"', 600),
  214.                    wibox.widget.textbox('    '),
  215.                    awful.widget.watch('bash -c "./Apps/BashScripts/Blocks/date.sh"', 60),
  216.                    s.mylayoutbox,
  217.                },
  218.            }
  219.        }
  220.        -- s.mywibox.height = 30  -- [beta]
  221.    end)
  222.    
  223.    -- }}}
  224.    
  225.    -- {{{ Mouse bindings
  226.    awful.mouse.append_global_mousebindings({
  227.        awful.button({ }, 3, function () mymainmenu:toggle() end),
  228.        awful.button({ }, 4, awful.tag.viewprev),
  229.        awful.button({ }, 5, awful.tag.viewnext),
  230.    })
  231.    -- }}}
  232.    
  233.    -- {{{ Key bindings
  234.    
  235.    -- General Awesome keys
  236.    awful.keyboard.append_global_keybindings({
  237.        awful.key({ modkey,           }, "s",      hotkeys_popup.show_help,
  238.                  {description="show help", group="awesome"}),
  239.        awful.key({ modkey,           }, "w", function () mymainmenu:show() end,
  240.                  {description = "show main menu", group = "awesome"}),
  241.        awful.key({ modkey, "Control" }, "r", awesome.restart,
  242.                  {description = "reload awesome", group = "awesome"}),
  243.        awful.key({ modkey, "Shift"   }, "q", awesome.quit,
  244.                  {description = "quit awesome", group = "awesome"}),
  245.        awful.key({ modkey }, "x",
  246.                  function ()
  247.                      awful.prompt.run {
  248.                        prompt       = "Run Lua code: ",
  249.                        textbox      = awful.screen.focused().mypromptbox.widget,
  250.                        exe_callback = awful.util.eval,
  251.                        history_path = awful.util.get_cache_dir() .. "/history_eval"
  252.                      }
  253.                  end,
  254.                  {description = "lua execute prompt", group = "awesome"}),
  255.        awful.key({ modkey,           }, "Return", function () awful.spawn(terminal) end,
  256.                  {description = "open a terminal", group = "launcher"}),
  257.        awful.key({ modkey },            "r",     function () awful.screen.focused().mypromptbox:run() end,
  258.                  {description = "run prompt", group = "launcher"}),
  259.        -- awful.key({ modkey }, "p", function() menubar.show() end,
  260.        --           {description = "show the menubar", group = "launcher"}),
  261.  
  262.         -- custom keybinding (open dmenu)
  263.        awful.key({ modkey }, "p", function() awful.util.spawn("dmenu_run") end,
  264.                  {description = "show dmenu", group = "launcher"}),
  265.        awful.key({ modkey }, "Escape",
  266.                  function() awful.util.spawn("./Apps/BashScripts/System/main_assitant.sh") end,
  267.                  {description = "show dmenu", group = "launcher"}),
  268.  
  269.    })
  270.    
  271.    -- Tags related keybindings
  272.    awful.keyboard.append_global_keybindings({
  273.        awful.key({ modkey,           }, "Left",   awful.tag.viewprev,
  274.                  {description = "view previous", group = "tag"}),
  275.        awful.key({ modkey,           }, "Right",  awful.tag.viewnext,
  276.                  {description = "view next", group = "tag"}),
  277.        awful.key({ modkey,           }, "Tab", awful.tag.history.restore,
  278.                  {description = "go back", group = "tag"}),
  279.    })
  280.    
  281.    -- Focus related keybindings
  282.    awful.keyboard.append_global_keybindings({
  283.        awful.key({ modkey,           }, "j",
  284.            function ()
  285.                awful.client.focus.byidx( 1)
  286.            end,
  287.            {description = "focus next by index", group = "client"}
  288.        ),
  289.        awful.key({ modkey,           }, "k",
  290.            function ()
  291.                awful.client.focus.byidx(-1)
  292.            end,
  293.            {description = "focus previous by index", group = "client"}
  294.        ),
  295.        awful.key({ modkey,           }, "Tab",
  296.            function ()
  297.                awful.client.focus.history.previous()
  298.                if client.focus then
  299.                    client.focus:raise()
  300.                end
  301.            end,
  302.            {description = "go back", group = "client"}),
  303.        awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
  304.                  {description = "focus the next screen", group = "screen"}),
  305.        awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
  306.                  {description = "focus the previous screen", group = "screen"}),
  307.        awful.key({ modkey, "Control" }, "n",
  308.                  function ()
  309.                      local c = awful.client.restore()
  310.                      -- Focus restored client
  311.                      if c then
  312.                        c:activate { raise = true, context = "key.unminimize" }
  313.                      end
  314.                  end,
  315.                  {description = "restore minimized", group = "client"}),
  316.    })
  317.    
  318.    -- Layout related keybindings
  319.    awful.keyboard.append_global_keybindings({
  320.        awful.key({ modkey, "Shift"   }, "j", function () awful.client.swap.byidx(  1)    end,
  321.                  {description = "swap with next client by index", group = "client"}),
  322.        awful.key({ modkey, "Shift"   }, "k", function () awful.client.swap.byidx( -1)    end,
  323.                  {description = "swap with previous client by index", group = "client"}),
  324.        awful.key({ modkey,           }, "u", awful.client.urgent.jumpto,
  325.                  {description = "jump to urgent client", group = "client"}),
  326.        awful.key({ modkey,           }, "l",     function () awful.tag.incmwfact( 0.05)          end,
  327.                  {description = "increase master width factor", group = "layout"}),
  328.        awful.key({ modkey,           }, "h",     function () awful.tag.incmwfact(-0.05)          end,
  329.                  {description = "decrease master width factor", group = "layout"}),
  330.        awful.key({ modkey, "Shift"   }, "h",     function () awful.tag.incnmaster( 1, nil, true) end,
  331.                  {description = "increase the number of master clients", group = "layout"}),
  332.        awful.key({ modkey, "Shift"   }, "l",     function () awful.tag.incnmaster(-1, nil, true) end,
  333.                  {description = "decrease the number of master clients", group = "layout"}),
  334.        awful.key({ modkey, "Control" }, "h",     function () awful.tag.incncol( 1, nil, true)    end,
  335.                  {description = "increase the number of columns", group = "layout"}),
  336.        awful.key({ modkey, "Control" }, "l",     function () awful.tag.incncol(-1, nil, true)    end,
  337.                  {description = "decrease the number of columns", group = "layout"}),
  338.        awful.key({ modkey,           }, "space", function () awful.layout.inc( 1)                end,
  339.                  {description = "select next", group = "layout"}),
  340.        awful.key({ modkey, "Shift"   }, "space", function () awful.layout.inc(-1)                end,
  341.                  {description = "select previous", group = "layout"}),
  342.    })
  343.    
  344.    
  345.    awful.keyboard.append_global_keybindings({
  346.        awful.key {
  347.            modifiers   = { modkey },
  348.            keygroup    = "numrow",
  349.            description = "only view tag",
  350.            group       = "tag",
  351.            on_press    = function (index)
  352.                local screen = awful.screen.focused()
  353.                local tag = screen.tags[index]
  354.                if tag then
  355.                    tag:view_only()
  356.                end
  357.            end,
  358.        },
  359.        awful.key {
  360.            modifiers   = { modkey, "Control" },
  361.            keygroup    = "numrow",
  362.            description = "toggle tag",
  363.            group       = "tag",
  364.            on_press    = function (index)
  365.                local screen = awful.screen.focused()
  366.                local tag = screen.tags[index]
  367.                if tag then
  368.                    awful.tag.viewtoggle(tag)
  369.                end
  370.            end,
  371.        },
  372.        awful.key {
  373.            modifiers = { modkey, "Shift" },
  374.            keygroup    = "numrow",
  375.            description = "move focused client to tag",
  376.            group       = "tag",
  377.            on_press    = function (index)
  378.                if client.focus then
  379.                    local tag = client.focus.screen.tags[index]
  380.                    if tag then
  381.                        client.focus:move_to_tag(tag)
  382.                    end
  383.                end
  384.            end,
  385.        },
  386.        awful.key {
  387.            modifiers   = { modkey, "Control", "Shift" },
  388.            keygroup    = "numrow",
  389.            description = "toggle focused client on tag",
  390.            group       = "tag",
  391.            on_press    = function (index)
  392.                if client.focus then
  393.                    local tag = client.focus.screen.tags[index]
  394.                    if tag then
  395.                        client.focus:toggle_tag(tag)
  396.                    end
  397.                end
  398.            end,
  399.        },
  400.        awful.key {
  401.            modifiers   = { modkey },
  402.            keygroup    = "numpad",
  403.            description = "select layout directly",
  404.            group       = "layout",
  405.            on_press    = function (index)
  406.                local t = awful.screen.focused().selected_tag
  407.                if t then
  408.                    t.layout = t.layouts[index] or t.layout
  409.                end
  410.            end,
  411.        }
  412.    })
  413.    
  414.    client.connect_signal("request::default_mousebindings", function()
  415.        awful.mouse.append_client_mousebindings({
  416.            awful.button({ }, 1, function (c)
  417.                c:activate { context = "mouse_click" }
  418.            end),
  419.            awful.button({ modkey }, 1, function (c)
  420.                c:activate { context = "mouse_click", action = "mouse_move"  }
  421.            end),
  422.            awful.button({ modkey }, 3, function (c)
  423.                c:activate { context = "mouse_click", action = "mouse_resize"}
  424.            end),
  425.        })
  426.    end)
  427.    
  428.    client.connect_signal("request::default_keybindings", function()
  429.        awful.keyboard.append_client_keybindings({
  430.            awful.key({ modkey,           }, "f",
  431.                function (c)
  432.                    c.fullscreen = not c.fullscreen
  433.                    c:raise()
  434.                end,
  435.                {description = "toggle fullscreen", group = "client"}),
  436.            awful.key({ modkey, "Shift"   }, "c",      function (c) c:kill()                         end,
  437.                    {description = "close", group = "client"}),
  438.            awful.key({ modkey, "Control" }, "space",  awful.client.floating.toggle                     ,
  439.                    {description = "toggle floating", group = "client"}),
  440.            awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
  441.                    {description = "move to master", group = "client"}),
  442.            awful.key({ modkey,           }, "o",      function (c) c:move_to_screen()               end,
  443.                    {description = "move to screen", group = "client"}),
  444.            awful.key({ modkey,           }, "t",      function (c) c.ontop = not c.ontop            end,
  445.                    {description = "toggle keep on top", group = "client"}),
  446.            awful.key({ modkey,           }, "n",
  447.                function (c)
  448.                    -- The client currently has the input focus, so it cannot be
  449.                    -- minimized, since minimized clients can't have the focus.
  450.                    c.minimized = true
  451.                end ,
  452.                {description = "minimize", group = "client"}),
  453.            awful.key({ modkey,           }, "m",
  454.                function (c)
  455.                    c.maximized = not c.maximized
  456.                    c:raise()
  457.                end ,
  458.                {description = "(un)maximize", group = "client"}),
  459.            awful.key({ modkey, "Control" }, "m",
  460.                function (c)
  461.                    c.maximized_vertical = not c.maximized_vertical
  462.                    c:raise()
  463.                end ,
  464.                {description = "(un)maximize vertically", group = "client"}),
  465.            awful.key({ modkey, "Shift"   }, "m",
  466.                function (c)
  467.                    c.maximized_horizontal = not c.maximized_horizontal
  468.                    c:raise()
  469.                end ,
  470.                {description = "(un)maximize horizontally", group = "client"}),
  471.        })
  472.    end)
  473.    
  474.    -- }}}
  475.  
  476.    -- {{{ Rules
  477.    -- Rules to apply to new clients.
  478.    ruled.client.connect_signal("request::rules", function()
  479.        -- All clients will match this rule.
  480.        ruled.client.append_rule {
  481.            id         = "global",
  482.            rule       = { },
  483.            properties = {
  484.                focus     = awful.client.focus.filter,
  485.                raise     = true,
  486.                screen    = awful.screen.preferred,
  487.                placement = awful.placement.no_overlap+awful.placement.no_offscreen
  488.            }
  489.        }
  490.  
  491.        -- Floating clients.
  492.        ruled.client.append_rule {
  493.            id       = "floating",
  494.            rule_any = {
  495.                instance = { "copyq", "pinentry" },
  496.                class    = {
  497.                    "Arandr", "Blueman-manager", "Gpick", "Kruler", "Sxiv",
  498.                    "Wpa_gui", "veromix", "xtightvncviewer"
  499.                },
  500.                -- Note that the name property shown in xprop might be set slightly after creation of the client
  501.                -- and the name shown there might not match defined rules here.
  502.                name    = {
  503.                    "Event Tester",  -- xev.
  504.                },
  505.                role    = {
  506.                    "AlarmWindow",    -- Thunderbird's calendar.
  507.                    "ConfigManager",  -- Thunderbird's about:config.
  508.                    "pop-up",         -- e.g. Google Chrome's (detached) Developer Tools.
  509.                }
  510.            },
  511.            properties = { floating = true }
  512.        }
  513.    
  514.        -- Add titlebars to normal clients and dialogs
  515.        ruled.client.append_rule {
  516.            id         = "titlebars",
  517.            rule_any   = { type = { "normal", "dialog" } },
  518.            properties = { titlebars_enabled = true      }
  519.        }
  520.  
  521.         -- local names = { "", "", "3", "4", "5", "6", "", "", "" }
  522.        -- Set all GUIS related programs to always open in Tag  (7)
  523.        ruled.client.append_rule {
  524.            rule       = { class = "KeePassXC" },
  525.            properties = { screen = 1, tag = "" }
  526.        }
  527.        ruled.client.append_rule {
  528.            rule       = { class = "qBittorrent" },
  529.            properties = { screen = 1, tag = "" }
  530.        }
  531.        ruled.client.append_rule {
  532.            rule       = { class = "LibreOffice" },
  533.            properties = { screen = 1, tag = "" }
  534.        }
  535.        ruled.client.append_rule {
  536.            rule       = { class = "Firefox" },
  537.            properties = { screen = 1, tag = "" }
  538.        }
  539.        ruled.client.append_rule {
  540.            rule       = { class = "Tor Browser" },
  541.            properties = { screen = 1, tag = "" }
  542.        }
  543.    end)
  544.    -- }}}
  545.    
  546.    -- {{{ Titlebars
  547.    -- Add a titlebar if titlebars_enabled is set to true in the rules.
  548.    client.connect_signal("request::titlebars", function(c)
  549.        -- buttons for the titlebar
  550.        local buttons = {
  551.            awful.button({ }, 1, function()
  552.                c:activate { context = "titlebar", action = "mouse_move"  }
  553.            end),
  554.            awful.button({ }, 3, function()
  555.                c:activate { context = "titlebar", action = "mouse_resize"}
  556.            end),
  557.        }
  558.    
  559.        awful.titlebar(c).widget = {
  560.            { -- Left
  561.                awful.titlebar.widget.iconwidget(c),
  562.                buttons = buttons,
  563.                layout  = wibox.layout.fixed.horizontal
  564.            },
  565.            { -- Middle
  566.                { -- Title
  567.                    halign = "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.    
  586.    -- {{{ Notifications
  587.    
  588.    ruled.notification.connect_signal('request::rules', function()
  589.        -- All notifications will match this rule.
  590.        ruled.notification.append_rule {
  591.            rule       = { },
  592.            properties = {
  593.                screen           = awful.screen.preferred,
  594.                implicit_timeout = 5,
  595.            }
  596.        }
  597.    end)
  598.    
  599.    naughty.connect_signal("request::display", function(n)
  600.        naughty.layout.box { notification = n }
  601.    end)
  602.    
  603.    -- }}}
  604.    
  605.    -- Enable sloppy focus, so that focus follows mouse.
  606.    client.connect_signal("mouse::enter", function(c)
  607.        c:activate { context = "mouse_enter", raise = false }
  608.    end)
  609. -- @script rc.lua
  610. -- @usebeautiful beautiful.awesome_icon
  611. -- @usebeautiful beautiful.wallpaper
  612.  
Add Comment
Please, Sign In to add comment