Guest User

Untitled

a guest
Nov 14th, 2021
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 24.81 KB | None | 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 menubar = require("menubar")
  15. local hotkeys_popup = require("awful.hotkeys_popup")
  16. -- Enable hotkeys help widget for VIM and other apps
  17. -- when client with a matching name is opened:
  18. require("awful.hotkeys_popup.keys")
  19.  
  20. -- {{{ Variable definitions
  21. beautiful.init("/home/triss/.config/awesome/theme.lua")
  22.  
  23. terminal = "kitty"
  24. editor = "nvim"
  25. web = "firefox"
  26. editor_cmd = terminal .. " -e " .. editor
  27.  
  28. modkey = "Mod4"
  29.  
  30. -- Table of layouts to cover with awful.layout.inc, order matters.
  31. awful.layout.layouts = {
  32.     awful.layout.suit.tile.left,
  33.     awful.layout.suit.tile,
  34.     awful.layout.suit.spiral,
  35. }
  36. -- }}}
  37.  
  38. -- {{{ Menu
  39. -- Create a launcher widget and a main menu
  40. myawesomemenu = {
  41.    { "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end },
  42.    { "manual", terminal .. " -e man awesome" },
  43.    { "edit config", editor_cmd .. " " .. awesome.conffile },
  44.    { "restart", awesome.restart },
  45.    { "quit", function() awesome.quit() end },
  46. }
  47.  
  48. mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
  49.                                     { "open terminal", terminal }
  50.                                   }
  51.                         })
  52.  
  53. mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
  54.                                      menu = mymainmenu })
  55.  
  56. -- Menubar configuration
  57. menubar.utils.terminal = terminal -- Set the terminal for applications that require it
  58. -- }}}
  59.  
  60. -- Keyboard map indicator and switcher
  61. mykeyboardlayout = awful.widget.keyboardlayout()
  62.  
  63. -- {{{ Wibar
  64. -- Create a textclock widget
  65. mytextclock = wibox.widget.textclock()
  66.  
  67. -- Create a wibox for each screen and add it
  68. local taglist_buttons = gears.table.join(
  69.                     awful.button({ }, 1, function(t) t:view_only() end),
  70.                     awful.button({ modkey }, 1, function(t)
  71.                                               if client.focus then
  72.                                                   client.focus:move_to_tag(t)
  73.                                               end
  74.                                           end),
  75.                     awful.button({ }, 3, awful.tag.viewtoggle),
  76.                     awful.button({ modkey }, 3, function(t)
  77.                                               if client.focus then
  78.                                                   client.focus:toggle_tag(t)
  79.                                               end
  80.                                           end),
  81.                     awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
  82.                     awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
  83.                 )
  84.  
  85. local tasklist_buttons = gears.table.join(
  86.                      awful.button({ }, 1, function (c)
  87.                                               if c == client.focus then
  88.                                                   c.minimized = true
  89.                                               else
  90.                                                   c:emit_signal(
  91.                                                       "request::activate",
  92.                                                       "tasklist",
  93.                                                       {raise = true}
  94.                                                   )
  95.                                               end
  96.                                           end),
  97.                      awful.button({ }, 3, function()
  98.                                               awful.menu.client_list({ theme = { width = 250 } })
  99.                                           end),
  100.                      awful.button({ }, 4, function ()
  101.                                               awful.client.focus.byidx(1)
  102.                                           end),
  103.                      awful.button({ }, 5, function ()
  104.                                               awful.client.focus.byidx(-1)
  105.                                           end))
  106.  
  107. local function set_wallpaper(s)
  108.     -- Wallpaper
  109.     if beautiful.wallpaper then
  110.         local wallpaper = beautiful.wallpaper
  111.         -- If wallpaper is a function, call it with the screen
  112.         if type(wallpaper) == "function" then
  113.             wallpaper = wallpaper(s)
  114.         end
  115.         gears.wallpaper.maximized(wallpaper, s, true)
  116.     end
  117. end
  118.  
  119. -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
  120. screen.connect_signal("property::geometry", set_wallpaper)
  121.  
  122. awful.screen.connect_for_each_screen(function(s)
  123.     -- Wallpaper
  124.     set_wallpaper(s)
  125.  
  126.     -- Each screen has its own tag table.
  127.     awful.tag({ " ", " ", " ", " ", " " }, s, awful.layout.layouts[1])
  128.  
  129.     -- Create a promptbox for each screen
  130.     s.mypromptbox = awful.widget.prompt()
  131.  
  132. local pill1 = function(cr,w,h)
  133.     gears.shape.rounded_rect(cr,w,h,16)
  134. end
  135.  
  136. local pill2 = function(cr,w,h)
  137.     gears.shape.rounded_rect(cr,w,h,16)
  138. end
  139.  
  140.     -- Taglist
  141.     s.mytaglist = awful.widget.taglist {
  142.         screen  = s,
  143.         filter  = awful.widget.taglist.filter.all,
  144.         style   = {
  145.             shape = pill2,
  146.             shape_border_width = 1,
  147.             shape_border_color = beautiful.border_soft,
  148.             left = -12,
  149.             right = 100,
  150.         },
  151.         layout = {
  152.             spacing = 4,
  153.             layout  = wibox.layout.fixed.horizontal,
  154.         },
  155.         widget_template = {
  156.         {
  157.             {
  158.                 {
  159.                     id     = 'text_role',
  160.                     widget = wibox.widget.textbox,
  161.                 },
  162.                 layout = wibox.layout.fixed.horizontal,
  163.             },
  164.             left  = 12,
  165.             right = 9,
  166.             widget = wibox.container.margin
  167.         },
  168.         id     = 'background_role',
  169.         widget = wibox.container.background,
  170.         -- Add support for hover colors and an index label
  171.     },
  172.         buttons = taglist_buttons,
  173.  }
  174.  
  175.     -- Create a tasklist widget
  176.     s.mytasklist = awful.widget.tasklist {
  177.         screen  = s,
  178.         filter  = awful.widget.tasklist.filter.currenttags,
  179.         buttons = tasklist_buttons,
  180.         style   = {
  181.             shape_border_width  = 3,
  182.             shape_border_color  = beautiful.border_soft,
  183.             shape               = pill1,
  184.             font                = "Fira Sans 11.5",
  185.         },
  186.         layout  = {
  187.             layout       = wibox.layout.flex.horizontal,
  188.             spacing      = 10,
  189.         },
  190.         widget_template = {
  191.             widget = wibox.container.background,
  192.             id     = 'background_role',
  193.             {
  194.                 widget = wibox.container.margin,
  195.                 left   = 10,
  196.                 right  = 20,
  197.                 {
  198.                     layout = wibox.layout.fixed.horizontal,
  199.                    {
  200.                         widget  = wibox.container.margin,
  201.                         margins = 4,
  202.                        {
  203.                             id     = 'icon_role',
  204.                             widget = wibox.widget.imagebox,
  205.                        },
  206.            
  207.                    },
  208.                    {
  209.                         widget = wibox.widget.textbox,
  210.                         id     = 'text_role',
  211.                    },
  212.            }
  213.         }
  214.     }
  215. }
  216.  
  217.    tasklist_enc = wibox.widget {
  218.         widget = wibox.container.background,
  219.         shape = pill1,
  220.         shape_border_width = 2,
  221.         shape_border_color = beautiful.border_soft,
  222.         bg = beautiful.tasklist_bg_normal,
  223.         {
  224.             widget = wibox.container.margin,
  225.             top    = 1,
  226.             bottom = 1,
  227.             {
  228.                layout = wibox.layout.flex.horizontal,
  229.                s.mytaglist
  230.             },
  231.         },
  232.    }
  233.  
  234.   clock_enc = wibox.widget {
  235.       widget = wibox.container.background,
  236.       shape  = pill1,
  237.       shape_border_width = 2,
  238.       shape_border_color = beautiful.border_soft,
  239.       bg    = beautiful.tasklist_bg_normal,
  240.       {
  241.           widget = wibox.container.margin,
  242.           left   = 8,
  243.           right  = 8,
  244.           {
  245.                 layout = wibox.layout.flex.horizontal,
  246.                 mytextclock
  247.           }
  248.       }
  249.   }
  250.  
  251. tray_enc = wibox.widget {
  252.     widget = awful.widget.only_on_screen,
  253.     screen = primary,
  254.     {
  255.       widget = wibox.container.background,
  256.       shape  = pill1,
  257.       shape_border_width = 2,
  258.       shape_border_color = beautiful.border_soft,
  259.       bg    = beautiful.tasklist_bg_normal,
  260.       screen = 1,
  261.       {
  262.           widget = wibox.container.margin,
  263.           top    = 6,
  264.           bottom = 6,
  265.           left   = 8,
  266.           right  = 8,
  267.           {
  268.                 layout = wibox.layout.flex.horizontal,
  269.                 wibox.widget.systray()
  270.           }
  271.       }
  272.   }
  273.   }
  274.  
  275.   s_l = wibox.widget {
  276.     widget = wibox.container.margin,
  277.     left   = 16,
  278.     right  = 16,
  279.     {
  280.         widget       = wibox.widget.separator,
  281.         shape        = gears.shape.rounded_bar,
  282.         forced_width = 4,
  283.         color        = beautiful.bg_soft,
  284.         border_color = beautiful.border_softer,
  285.         border_width = 1,
  286.     }
  287. }
  288.  
  289.   s_ep = wibox.widget {
  290.       widget = awful.widget.only_on_screen,
  291.       screen = primary,
  292.       {
  293.     widget = wibox.container.margin,
  294.     left   = 6,
  295.     right  = 6,
  296.     }
  297. }
  298.  
  299. local wibox_shape = function(cr,w,h)
  300.     gears.shape.partially_rounded_rect(cr,w,h,false,false,true,true,24)
  301. end
  302.  
  303.     -- Create the wibox
  304.     s.mywibox = awful.wibar{
  305.         position        = "top",
  306.         screen          = s,
  307.         border_width    = 2,
  308.         border_color    = beautiful.border_normal,
  309.         height          = 54,
  310.         --width           = "97%",
  311.         --shape           = wibox_shape,
  312.     }
  313.  
  314.  
  315.     -- Add widgets to the wibox
  316.     s.mywibox:setup {
  317.         widget = wibox.container.margin,
  318.         left   = 12,
  319.         right  = 12,
  320.         top    = 2,
  321.         bottom = 2,
  322.         {
  323.             layout = wibox.layout.align.horizontal,
  324.             { -- Left widgets
  325.                  layout = wibox.layout.fixed.horizontal,
  326.                  tasklist_enc,
  327.                  s.mypromptbox,
  328.                  s_l,
  329.          },
  330.                  s.mytasklist, -- Middle widget
  331.          { -- Right widgets
  332.                  layout = wibox.layout.fixed.horizontal,
  333.                  s_l,
  334.                  tray_enc,
  335.                  s_ep,
  336.                  clock_enc,
  337.          },
  338.         },
  339.     }
  340. end)
  341. -- }}}
  342.  
  343. -- {{{ Mouse bindings
  344. -- }}}
  345.  
  346. -- {{{ Key bindings
  347. globalkeys = gears.table.join(
  348.     awful.key({ modkey,           }, "Left",   awful.tag.viewprev,
  349.               {description = "view previous", group = "tag"}),
  350.     awful.key({ modkey,           }, "Right",  awful.tag.viewnext,
  351.               {description = "view next", group = "tag"}),
  352.     awful.key({ modkey,           }, "Escape", awful.tag.history.restore,
  353.               {description = "go back", group = "tag"}),
  354.  
  355.     awful.key({ modkey,           }, "j",
  356.         function ()
  357.             awful.client.focus.byidx( 1)
  358.         end,
  359.         {description = "focus next by index", group = "client"}
  360.     ),
  361.     awful.key({ modkey,           }, "k",
  362.         function ()
  363.             awful.client.focus.byidx(-1)
  364.         end,
  365.         {description = "focus previous by index", group = "client"}
  366.     ),
  367.         -- Layout manipulation
  368.     awful.key({ modkey, "Shift"   }, "j", function () awful.client.swap.byidx(  1)    end,
  369.               {description = "swap with next client by index", group = "client"}),
  370.     awful.key({ modkey, "Shift"   }, "k", function () awful.client.swap.byidx( -1)    end,
  371.               {description = "swap with previous client by index", group = "client"}),
  372.     awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
  373.               {description = "focus the next screen", group = "screen"}),
  374.     awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
  375.               {description = "focus the previous screen", group = "screen"}),
  376.     awful.key({ modkey,           }, "u", awful.client.urgent.jumpto),
  377.     awful.key({ modkey,           }, "Tab",
  378.         function ()
  379.             awful.client.focus.history.previous()
  380.             if client.focus then
  381.                 client.focus:raise()
  382.             end
  383.         end ),
  384.  
  385.     -- Standard program
  386.     awful.key({ modkey,           }, "Return", function () awful.spawn(terminal) end),
  387.     awful.key({ modkey,           }, "w",      function () awful.spawn(web) end),
  388.     awful.key({ modkey,           }, "e",      function () awful.spawn("kitty --class='files' lfrun") end),
  389.     awful.key({ modkey,           }, "m",      function () awful.spawn("kitty --class='music' ncmpcpp") end),
  390.  
  391.     -- Maim
  392.     awful.key({ "Control" }, "Print", function () awful.spawn.with_shell("Skrypty/maim/Slop.sh") end),
  393.     awful.key({ modkey }, "Print", function () awful.spawn.with_shell("Skrypty/maim/Curw.sh") end),
  394.    
  395.     -- Xoris
  396.     awful.key({ modkey },  "c", function () awful.spawn.with_shell("Skrypty/xoris.sh") end),
  397.  
  398.     -- Volume
  399.     --awful.key({}, "XF86AudioLowerVolume", function () awful.spawn.with_shell("Skrypty/audio/lower.sh") end),
  400.     --awful.key({}, "XF86AudioRaiseVolume", function () awful.spawn.with_shell("Skrypty/audio/raise.sh") end),
  401.     awful.key({}, "XF86AudioMute", function () awful.spawn.with_shell("Skrypty/audio/mute.sh") end),
  402.    
  403.     awful.key({ "Shift" }, "XF86AudioLowerVolume", function () awful.spawn.with_shell("mpc volume -2") end),
  404.     awful.key({ "Shift" }, "XF86AudioRaiseVolume", function () awful.spawn.with_shell("mpc volume +2") end),
  405.    
  406.  
  407.     -- Media Keys
  408.    awful.key({}, "XF86AudioPlay", function()
  409.      awful.spawn.with_shell("mpc toggle") end),
  410.    awful.key({}, "XF86AudioNext", function()
  411.      awful.spawn.with_shell("mpc next") end),
  412.    awful.key({}, "XF86AudioPrev", function()
  413.      awful.spawn.with_shell("mpc prev") end),
  414.  
  415.     awful.key({ modkey, "Control" }, "r", awesome.restart),
  416.     awful.key({ modkey,           }, "l",     function () awful.tag.incmwfact( 0.05)          end,
  417.               {description = "increase master width factor", group = "layout"}),
  418.     awful.key({ modkey,           }, "h",     function () awful.tag.incmwfact(-0.05)          end,
  419.               {description = "decrease master width factor", group = "layout"}),
  420.     awful.key({ modkey, "Shift"   }, "h",     function () awful.tag.incnmaster( 1, nil, true) end,
  421.               {description = "increase the number of master clients", group = "layout"}),
  422.     awful.key({ modkey, "Shift"   }, "l",     function () awful.tag.incnmaster(-1, nil, true) end,
  423.               {description = "decrease the number of master clients", group = "layout"}),
  424.     awful.key({ modkey, "Control" }, "h",     function () awful.tag.incncol( 1, nil, true)    end,
  425.               {description = "increase the number of columns", group = "layout"}),
  426.     awful.key({ modkey, "Control" }, "l",     function () awful.tag.incncol(-1, nil, true)    end,
  427.               {description = "decrease the number of columns", group = "layout"}),
  428.     awful.key({ modkey,           }, "space", function () awful.layout.inc( 1)                end,
  429.               {description = "select next", group = "layout"}),
  430.     awful.key({ modkey, "Shift"   }, "space", function () awful.layout.inc(-1)                end,
  431.               {description = "select previous", group = "layout"}),
  432.  
  433.     awful.key({ modkey, "Control" }, "n",
  434.               function ()
  435.                   local c = awful.client.restore()
  436.                   -- Focus restored client
  437.                   if c then
  438.                     c:emit_signal(
  439.                         "request::activate", "key.unminimize", {raise = true}
  440.                     )
  441.                   end
  442.               end,
  443.               {description = "restore minimized", group = "client"}),
  444.  
  445.     -- Prompt
  446.     awful.key({ modkey },            "r",     function () awful.screen.focused().mypromptbox:run() end,
  447.               {description = "run prompt", group = "launcher"}),
  448.  
  449.         -- Menubar
  450.     awful.key({ modkey }, "p", function() menubar.show() end,
  451.               {description = "show the menubar", group = "launcher"})
  452. )
  453.  
  454. clientkeys = gears.table.join(
  455.     awful.key({ modkey,           }, "f",
  456.         function (c)
  457.             c.fullscreen = not c.fullscreen
  458.             c:raise()
  459.         end,
  460.         {description = "toggle fullscreen", group = "client"}),
  461.     awful.key({ modkey, }, "x",      function (c) c:kill() end),
  462.  
  463.     awful.key({ modkey, "Control" }, "space",  awful.client.floating.toggle                     ,
  464.               {description = "toggle floating", group = "client"}),
  465.     awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
  466.               {description = "move to master", group = "client"}),
  467.     awful.key({ modkey,           }, "o",      function (c) c:move_to_screen()               end,
  468.               {description = "move to screen", group = "client"}),
  469.     awful.key({ modkey,           }, "t",      function (c) c.ontop = not c.ontop            end,
  470.               {description = "toggle keep on top", group = "client"}),
  471.     awful.key({ modkey,           }, "n",
  472.         function (c)
  473.             -- The client currently has the input focus, so it cannot be
  474.             -- minimized, since minimized clients can't have the focus.
  475.             c.minimized = true
  476.         end ,
  477.         {description = "minimize", group = "client"}),
  478.     awful.key({ modkey,           }, "b",
  479.         function (c)
  480.             c.maximized = not c.maximized
  481.             c:raise()
  482.         end ,
  483.         {description = "(un)maximize", group = "client"}),
  484.     awful.key({ modkey, "Control" }, "b",
  485.         function (c)
  486.             c.maximized_vertical = not c.maximized_vertical
  487.             c:raise()
  488.         end ,
  489.         {description = "(un)maximize vertically", group = "client"}),
  490.     awful.key({ modkey, "Shift"   }, "b",
  491.         function (c)
  492.             c.maximized_horizontal = not c.maximized_horizontal
  493.             c:raise()
  494.         end ,
  495.         {description = "(un)maximize horizontally", group = "client"})
  496. )
  497.  
  498. -- Bind all key numbers to tags.
  499. -- Be careful: we use keycodes to make it work on any keyboard layout.
  500. -- This should map on the top row of your keyboard, usually 1 to 9.
  501. for i = 1, 9 do
  502.     globalkeys = gears.table.join(globalkeys,
  503.         -- View tag only.
  504.         awful.key({ modkey }, "#" .. i + 9,
  505.                   function ()
  506.                         local screen = awful.screen.focused()
  507.                         local tag = screen.tags[i]
  508.                         if tag then
  509.                            tag:view_only()
  510.                         end
  511.                   end,
  512.                   {description = "view tag #"..i, group = "tag"}),
  513.         -- Toggle tag display.
  514.         awful.key({ modkey, "Control" }, "#" .. i + 9,
  515.                   function ()
  516.                       local screen = awful.screen.focused()
  517.                       local tag = screen.tags[i]
  518.                       if tag then
  519.                          awful.tag.viewtoggle(tag)
  520.                       end
  521.                   end,
  522.                   {description = "toggle tag #" .. i, group = "tag"}),
  523.         -- Move client to tag.
  524.         awful.key({ modkey, "Shift" }, "#" .. i + 9,
  525.                   function ()
  526.                       if client.focus then
  527.                           local tag = client.focus.screen.tags[i]
  528.                           if tag then
  529.                               client.focus:move_to_tag(tag)
  530.                           end
  531.                      end
  532.                   end,
  533.                   {description = "move focused client to tag #"..i, group = "tag"}),
  534.         -- Toggle tag on focused client.
  535.         awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
  536.                   function ()
  537.                       if client.focus then
  538.                           local tag = client.focus.screen.tags[i]
  539.                           if tag then
  540.                               client.focus:toggle_tag(tag)
  541.                           end
  542.                       end
  543.                   end,
  544.                   {description = "toggle focused client on tag #" .. i, group = "tag"})
  545.     )
  546. end
  547.  
  548. clientbuttons = gears.table.join(
  549.     awful.button({ }, 1, function (c)
  550.         c:emit_signal("request::activate", "mouse_click", {raise = true})
  551.     end),
  552.     awful.button({ modkey }, 1, function (c)
  553.         c:emit_signal("request::activate", "mouse_click", {raise = true})
  554.         awful.mouse.client.move(c)
  555.     end),
  556.     awful.button({ modkey }, 3, function (c)
  557.         c:emit_signal("request::activate", "mouse_click", {raise = true})
  558.         awful.mouse.client.resize(c)
  559.     end)
  560. )
  561.  
  562. -- Set keys
  563. root.keys(globalkeys)
  564. -- }}}
  565.  
  566. -- {{{ Rules
  567. -- Rules to apply to new clients (through the "manage" signal).
  568. awful.rules.rules = {
  569.     -- All clients will match this rule.
  570.     { rule = { },
  571.       properties = { border_width = beautiful.border_width,
  572.                      border_color = beautiful.border_normal,
  573.                      focus = awful.client.focus.filter,
  574.                      raise = true,
  575.                      keys = clientkeys,
  576.                      buttons = clientbuttons,
  577.                      screen = awful.screen.preferred,
  578.                      placement = awful.placement.no_overlap+awful.placement.no_offscreen
  579.      }
  580.     },
  581.  
  582.     -- Floating clients.
  583.     { rule_any = {
  584.         instance = {
  585.           "DTA",  -- Firefox addon DownThemAll.
  586.           "copyq",  -- Includes session name in class.
  587.           "pinentry",
  588.         },
  589.         class = {
  590.           "Arandr",
  591.           "Blueman-manager",
  592.           "Gpick",
  593.           "Kruler",
  594.           "MessageWin",  -- kalarm.
  595.           "Sxiv",
  596.           "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
  597.           "Wpa_gui",
  598.           "veromix",
  599.           "tuimoji",
  600.           "mixer",
  601.           "Nirogen",
  602.           "xtightvncviewer"},
  603.  
  604.         -- Note that the name property shown in xprop might be set slightly after creation of the client
  605.         -- and the name shown there might not match defined rules here.
  606.         name = {
  607.           "Event Tester",  -- xev.
  608.         },
  609.         role = {
  610.           "AlarmWindow",  -- Thunderbird's calendar.
  611.           "ConfigManager",  -- Thunderbird's about:config.
  612.           "pop-up",       -- e.g. Google Chrome's (detached) Developer Tools.
  613.         }
  614.       }, properties = { floating = true }},
  615.  
  616.       { rule = { class = "Firefox" }, properties = { tag = " " } },
  617.       { rule = { class = "discord" }, properties = { screen = 2, tag = " " } },
  618.       { rule = { class = "kitty" },   properties = { tag = " " } },
  619.       { rule = { class = "files" },   properties = { tag = " " } },
  620.       { rule = { class = "music" },   properties = { tag = " " } },
  621.  
  622.     -- Set Firefox to always map on the tag named "2" on screen 1.
  623.     -- { rule = { class = "Firefox" },
  624.     --   properties = { screen = 1, tag = "2" } },
  625. }
  626. -- }}}
  627.  
  628. -- Rounded windows
  629. local client_shape = function(cr,w,h)
  630.     gears.shape.rounded_rect(cr,w,h,48)
  631. end
  632.  
  633.  
  634. -- {{{ Signals
  635. -- Signal function to execute when a new client appears.
  636. client.connect_signal("manage", function (c)
  637.     -- Set the windows at the slave,
  638.     -- i.e. put it at the end of others instead of setting it master.
  639.     -- if not awesome.startup then awful.client.setslave(c) end
  640.  
  641. c.shape = client_shape
  642.  
  643.     if awesome.startup
  644.       and not c.size_hints.user_position
  645.       and not c.size_hints.program_position then
  646.         -- Prevent clients from being unreachable after screen count changes.
  647.         awful.placement.no_offscreen(c)
  648.     end
  649. end)
  650.  
  651.  
  652. -- Enable sloppy focus, so that focus follows mouse.
  653. client.connect_signal("mouse::enter", function(c)
  654.     c:emit_signal("request::activate", "mouse_enter", {raise = false})
  655. end)
  656.  
  657. function fs_adj(c)
  658.     if c.fullscreen or c.maximized then
  659.         c.shape = gears.shape.rectangle
  660.         c.border_width = 0
  661.     else
  662.         c.shape = client_shape
  663.         c.border_width = beautiful.border_width
  664.     end
  665. end
  666.  
  667.  
  668. client.connect_signal("property::fullscreen", fs_adj)
  669. client.connect_signal("property::maximized", fs_adj)
  670.  
  671. --client.connect_signal("focus", fs_adj)
  672. --client.connect_signal("unfocus", fs_adj)
  673.  
  674. client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
  675. client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
  676. -- }}}
  677.  
  678. awful.spawn.with_shell(".config/awesome/autorun.sh")
Advertisement
Add Comment
Please, Sign In to add comment