Advertisement
Guest User

Untitled

a guest
Feb 10th, 2024
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 28.50 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 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. --widgets
  22. local batteryarc_widget = require("awesome-wm-widgets.batteryarc-widget.batteryarc")
  23. local brightness_widget = require("awesome-wm-widgets.brightness-widget.brightness")
  24. local volume_widget = require('awesome-wm-widgets.volume-widget.volume')
  25. local cmus_widget = require('awesome-wm-widgets.cmus-widget.cmus')
  26.  
  27. -- {{{ Error handling
  28. -- Check if awesome encountered an error during startup and fell back to
  29. -- another config (This code will only ever execute for the fallback config)
  30. if awesome.startup_errors then
  31.     naughty.notify({ preset = naughty.config.presets.critical,
  32.                      title = "Oops, there were errors during startup!",
  33.                      text = awesome.startup_errors })
  34. end
  35.  
  36. -- Handle runtime errors after startup
  37. do
  38.     local in_error = false
  39.     awesome.connect_signal("debug::error", function (err)
  40.         -- Make sure we don't go into an endless error loop
  41.         if in_error then return end
  42.         in_error = true
  43.  
  44.         naughty.notify({ preset = naughty.config.presets.critical,
  45.                          title = "Oops, an error happened!",
  46.                          text = tostring(err) })
  47.         in_error = false
  48.     end)
  49. end
  50. -- }}}
  51.  
  52. -- {{{ Variable definitions
  53. -- Themes define colours, icons, font and wallpapers.
  54. --beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
  55. local theme_path = string.format("%s/.config/awesome/themes/%s/theme.lua", os.getenv("HOME"), "default")
  56. beautiful.init(theme_path)
  57.  
  58. beautiful.useless_gap = 10
  59. -- This is used later as the default terminal and editor to run.
  60. terminal = "kitty"
  61. editor = os.getenv("EDITOR") or "emacs"
  62. editor_cmd = terminal .. " -e " .. editor
  63.  
  64. -- Default modkey.
  65. -- Usually, Mod4 is the key with a logo between Control and Alt.
  66. -- If you do not like this or do not have such a key,
  67. -- I suggest you to remap Mod4 to another key using xmodmap or other tools.
  68. -- However, you can use another modifier like Mod1, but it may interact with others.
  69. modkey = "Mod4"
  70.  
  71. -- Table of layouts to cover with awful.layout.inc, order matters.
  72. awful.layout.layouts = {
  73.     awful.layout.suit.floating,
  74.     awful.layout.suit.tile,
  75.     awful.layout.suit.tile.left,
  76.     awful.layout.suit.tile.bottom,
  77.     awful.layout.suit.tile.top,
  78.     awful.layout.suit.fair,
  79.     awful.layout.suit.fair.horizontal,
  80.     awful.layout.suit.spiral,
  81.     awful.layout.suit.spiral.dwindle,
  82.     awful.layout.suit.max,
  83.     awful.layout.suit.max.fullscreen,
  84.     awful.layout.suit.magnifier,
  85.     awful.layout.suit.corner.nw,
  86.     awful.layout.suit.corner.ne,
  87.     awful.layout.suit.corner.sw,
  88.     awful.layout.suit.corner.se,
  89. }
  90. -- }}}
  91.  
  92. -- {{{ Menu
  93. -- Create a launcher widget and a main menu
  94. myawesomemenu = {
  95.    { "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end },
  96.    { "manual", terminal .. " -e man awesome" },
  97.    { "edit config", editor_cmd .. " " .. awesome.conffile },
  98.    { "restart", awesome.restart },
  99.    { "quit", function() awesome.quit() end },
  100. }
  101.  
  102. mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
  103.                                     { "open terminal", terminal },
  104.                     { "web browser", "firefox" },
  105.                     { "im", "pidgin" },
  106.                     { "email", "thunderbird" }
  107.                                   }
  108.                         })
  109.  
  110. mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
  111.                                      menu = mymainmenu })
  112.  
  113. -- Menubar configuration
  114. menubar.utils.terminal = terminal -- Set the terminal for applications that require it
  115. -- }}}
  116.  
  117. -- Keyboard map indicator and switcher
  118. mykeyboardlayout = awful.widget.keyboardlayout()
  119.  
  120. -- {{{ Wibar
  121. -- Create a textclock widget
  122. mytextclock = wibox.widget.textclock()
  123.  
  124. -- Create a wibox for each screen and add it
  125. local taglist_buttons = gears.table.join(
  126.                     awful.button({ }, 1, function(t) t:view_only() end),
  127.                     awful.button({ modkey }, 1, function(t)
  128.                                               if client.focus then
  129.                                                   client.focus:move_to_tag(t)
  130.                                               end
  131.                                           end),
  132.                     awful.button({ }, 3, awful.tag.viewtoggle),
  133.                     awful.button({ modkey }, 3, function(t)
  134.                                               if client.focus then
  135.                                                   client.focus:toggle_tag(t)
  136.                                               end
  137.                                           end),
  138.                     awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
  139.                     awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
  140.                 )
  141.  
  142. local tasklist_buttons = gears.table.join(
  143.                      awful.button({ }, 1, function (c)
  144.                                               if c == client.focus then
  145.                                                   c.minimized = true
  146.                                               else
  147.                                                   c:emit_signal(
  148.                                                       "request::activate",
  149.                                                       "tasklist",
  150.                                                       {raise = true}
  151.                                                   )
  152.                                               end
  153.                                           end),
  154.                      awful.button({ }, 3, function()
  155.                                               awful.menu.client_list({ theme = { width = 250 } })
  156.                                           end),
  157.                      awful.button({ }, 4, function ()
  158.                                               awful.client.focus.byidx(1)
  159.                                           end),
  160.                      awful.button({ }, 5, function ()
  161.                                               awful.client.focus.byidx(-1)
  162.                                           end))
  163.  
  164.  
  165.  
  166. local function set_wallpaper(s)
  167.     -- Wallpaper
  168.     if beautiful.wallpaper then
  169.         local wallpaper = beautiful.wallpaper
  170.         -- If wallpaper is a function, call it with the screen
  171.         if type(wallpaper) == "function" then
  172.             wallpaper = wallpaper(s)
  173.         end
  174.         gears.wallpaper.maximized(wallpaper, s, true)
  175.     end
  176. end
  177.  
  178. -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
  179. screen.connect_signal("property::geometry", set_wallpaper)
  180. beautiful.wallpaper = "/home/zero/.config/awesome/themes/default/backgroundnew.jpg"
  181. awful.screen.connect_for_each_screen(function(s)
  182.     -- Wallpaper
  183.     set_wallpaper(s)
  184.  
  185.     -- Each screen has its own tag table.
  186.  --   awful.tag({ "1", "2", "www", "msg", "gme", "work", "7", "8", "9" }, s, awful.layout.layouts[6])
  187.  
  188.  
  189. awful.tag.add("1", {
  190.     icon               = "/home/zero/.config/awesome/calendar.svg",
  191.     layout             = awful.layout.suit.corner.sw,
  192.     selected           = true,
  193. })
  194.  
  195. awful.tag.add("2", {
  196.     icon = "/home/zero/.config/awesome/coffee.svg",
  197.     layout = awful.layout.suit.fair,
  198. })
  199.  
  200. awful.tag.add("www", {
  201.     layout = awful.layout.suit.fair,
  202.     icon = "/home/zero/.config/awesome/globe.svg"
  203.  
  204. })
  205.  
  206. awful.tag.add("msg", {
  207.     layout = awful.layout.suit.fair,
  208.     icon = "/home/zero/.config/awesome/mail.svg",
  209.     icon_ony = true
  210. })
  211.  
  212. awful.tag.add("gme", {
  213.     layout = awful.layout.suit.fair,
  214.     icon = "/home/zero/.config/awesome/star.svg"
  215. })
  216.  
  217. awful.tag.add("work", {
  218.     layout = awful.layout.suit.fair,
  219.     icon = "/home/zero/.config/awesome/code.svg"
  220. })
  221.  
  222. awful.tag.add("7", {
  223.     layout = awful.layout.suit.fair,
  224.     icon = "/home/zero/.config/awesome/clipboard.svg"
  225. })
  226.  
  227. awful.tag.add("8", {
  228.     layout = awful.layout.suit.fair,
  229.     icon = "/home/zero/.config/awesome/activity.svg"
  230. })
  231.  
  232. awful.tag.add("9", {
  233.     layout = awful.layout.suit.fair,
  234.     icon="/home/zero/.config/awesome/disc.svg"
  235. })
  236.  
  237.  
  238.  
  239.  
  240.     -- Create a promptbox for ach screen
  241.     s.mypromptbox = awful.widget.prompt()
  242.     -- Create an imagebox widget which will contain an icon indicating which layout we're using.
  243.     -- We need one layoutbox per screen.
  244.     s.mylayoutbox = awful.widget.layoutbox(s)
  245.     s.mylayoutbox:buttons(gears.table.join(
  246.                            awful.button({ }, 1, function () awful.layout.inc( 1) end),
  247.                            awful.button({ }, 3, function () awful.layout.inc(-1) end),
  248.                            awful.button({ }, 4, function () awful.layout.inc( 1) end),
  249.                            awful.button({ }, 5, function () awful.layout.inc(-1) end)))
  250.     -- Create a taglist widget
  251.  s.mytaglist = awful.widget.taglist {
  252.         screen  = s,
  253.         filter  = awful.widget.taglist.filter.all,
  254.         buttons = taglist_buttons
  255.     }
  256.  
  257.     -- Create a tasklist widget
  258.     s.mytasklist = awful.widget.tasklist {
  259.         screen  = s,
  260.         filter  = awful.widget.tasklist.filter.currenttags,
  261.         buttons = tasklist_buttons,
  262.     widget = wibox.widget.textbox
  263.     }
  264.  
  265.     -- Create the wibox
  266.     s.mywibox = awful.wibar({ position = "top", screen = s })
  267.  
  268.     -- Add widgets to the wibox
  269.     s.mywibox:setup {
  270.         layout = wibox.layout.align.horizontal,
  271.         { -- Left widgets
  272.             layout = wibox.layout.fixed.horizontal,
  273.             mylauncher,
  274.             s.mytaglist,
  275.             s.mypromptbox,
  276.         },
  277.         s.mytasklist, -- Middle widget
  278.         { -- Right widgets
  279.             layout = wibox.layout.fixed.horizontal,
  280.             mykeyboardlayout,
  281.             wibox.widget.systray(),
  282.             mytextclock,
  283.             s.mylayoutbox,
  284.         batteryarc_widget({
  285.                         show_current_level = true,
  286.                             arc_thickness = 1,
  287.                                 }),
  288.         cmus_widget(),
  289.         volume_widget{
  290.                         widget_type = 'arc',
  291.                         card = 0,
  292.                 device = "default"
  293.                         },
  294.          brightness_widget{
  295.                 program="brightnessctl",
  296.                 type="arc"
  297.                     },
  298.         },
  299.     }
  300. end)
  301. -- }}}
  302.  
  303. -- {{{ Mouse bindings
  304. root.buttons(gears.table.join(
  305.     awful.button({ }, 3, function () mymainmenu:toggle() end),
  306.     awful.button({ }, 4, awful.tag.viewnext),
  307.     awful.button({ }, 5, awful.tag.viewprev)
  308. ))
  309. -- }}}
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325. -- {{{ Key bindings
  326.  
  327. globalkeys = gears.table.join(
  328.     awful.key({ modkey,           }, "s",      hotkeys_popup.show_help,
  329.               {description="show help", group="awesome"}),
  330.     awful.key({ modkey,           }, "Left",   awful.tag.viewprev,
  331.               {description = "view previous", group = "tag"}),
  332.     awful.key({ modkey,           }, "Right",  awful.tag.viewnext,
  333.               {description = "view next", group = "tag"}),
  334.     awful.key({ modkey,           }, "Escape", awful.tag.history.restore,
  335.               {description = "go back", group = "tag"}),
  336.  
  337.     awful.key({ modkey,           }, "j",
  338.         function ()
  339.             awful.client.focus.byidx( 1)
  340.         end,
  341.         {description = "focus next by index", group = "client"}
  342.     ),
  343.     awful.key({ modkey,           }, "k",
  344.         function ()
  345.             awful.client.focus.byidx(-1)
  346.         end,
  347.         {description = "focus previous by index", group = "client"}
  348.     ),
  349.     awful.key({ modkey,           }, "w", function () mymainmenu:show() end,
  350.               {description = "show main menu", group = "awesome"}),
  351.  
  352.     -- Layout manipulation
  353.     awful.key({ modkey, "Shift"   }, "j", function () awful.client.swap.byidx(  1)    end,
  354.               {description = "swap with next client by index", group = "client"}),
  355.     awful.key({ modkey, "Shift"   }, "k", function () awful.client.swap.byidx( -1)    end,
  356.               {description = "swap with previous client by index", group = "client"}),
  357.     awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
  358.               {description = "focus the next screen", group = "screen"}),
  359.     awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
  360.               {description = "focus the previous screen", group = "screen"}),
  361.     awful.key({ modkey,           }, "u", awful.client.urgent.jumpto,
  362.               {description = "jump to urgent client", group = "client"}),
  363.     awful.key({ modkey,           }, "Tab",
  364.         function ()
  365.             awful.client.focus.history.previous()
  366.             if client.focus then
  367.                 client.focus:raise()
  368.             end
  369.         end,
  370.         {description = "go back", group = "client"}),
  371.  
  372.     -- Standard program
  373.     awful.key({ modkey,           }, "Return", function () awful.spawn(terminal) end,
  374.               {description = "open a terminal", group = "launcher"}),
  375.     awful.key({ modkey, "Control" }, "r", awesome.restart,
  376.               {description = "reload awesome", group = "awesome"}),
  377.     awful.key({ modkey, "Shift"   }, "q", awesome.quit,
  378.               {description = "quit awesome", group = "awesome"}),
  379.  
  380.     awful.key({ modkey,           }, "l",     function () awful.tag.incmwfact( 0.05)          end,
  381.               {description = "increase master width factor", group = "layout"}),
  382.     awful.key({ modkey,           }, "h",     function () awful.tag.incmwfact(-0.05)          end,
  383.               {description = "decrease master width factor", group = "layout"}),
  384.     awful.key({ modkey, "Shift"   }, "h",     function () awful.tag.incnmaster( 1, nil, true) end,
  385.               {description = "increase the number of master clients", group = "layout"}),
  386.     awful.key({ modkey, "Shift"   }, "l",     function () awful.tag.incnmaster(-1, nil, true) end,
  387.               {description = "decrease the number of master clients", group = "layout"}),
  388.     awful.key({ modkey, "Control" }, "h",     function () awful.tag.incncol( 1, nil, true)    end,
  389.               {description = "increase the number of columns", group = "layout"}),
  390.     awful.key({ modkey, "Control" }, "l",     function () awful.tag.incncol(-1, nil, true)    end,
  391.               {description = "decrease the number of columns", group = "layout"}),
  392.     awful.key({ modkey,           }, "space", function () awful.layout.inc( 1)                end,
  393.               {description = "select next", group = "layout"}),
  394.     awful.key({ modkey, "Shift"   }, "space", function () awful.layout.inc(-1)                end,
  395.               {description = "select previous", group = "layout"}),
  396.  
  397.     awful.key({ modkey, "Control" }, "n",
  398.               function ()
  399.                   local c = awful.client.restore()
  400.                   -- Focus restored client
  401.                   if c then
  402.                     c:emit_signal(
  403.                         "request::activate", "key.unminimize", {raise = true}
  404.                     )
  405.                   end
  406.               end,
  407.               {description = "restore minimized", group = "client"}),
  408.  
  409.     -- Prompt
  410.     awful.key({ modkey },            "r",     function () awful.screen.focused().mypromptbox:run() end,
  411.               {description = "run prompt", group = "launcher"}),
  412.     awful.key({ modkey }, "o", function()
  413.             awful.spawn.with_shell("sh ~/.config/rofi/launchers/type-6/launcher.sh")
  414.           end,
  415.               { description = "run rofi apps", group = "launcher" }),
  416. awful.key({ modkey         }, ";", function () brightness_widget:inc() end, {description = "increase brightness", group = "custom"}),
  417. awful.key({ modkey, "Shift"}, ";", function () brightness_widget:dec() end, {description = "decrease brightness", group = "custom"}),
  418.     awful.key({ modkey }, "x",
  419.               function ()
  420.                   awful.prompt.run {
  421.                     prompt       = "Run Lua code: ",
  422.                     textbox      = awful.screen.focused().mypromptbox.widget,
  423.                     exe_callback = awful.util.eval,
  424.                     history_path = awful.util.get_cache_dir() .. "/history_eval"
  425.                   }
  426.               end,
  427.               {description = "lua execute prompt", group = "awesome"}),
  428.     -- Menubar
  429.     awful.key({ modkey }, "p", function() menubar.show() end,
  430.               {description = "show the menubar", group = "launcher"})
  431. )
  432.  
  433. clientkeys = gears.table.join(
  434.     awful.key({ modkey,           }, "f",
  435.         function (c)
  436.             c.fullscreen = not c.fullscreen
  437.             c:raise()
  438.         end,
  439.         {description = "toggle fullscreen", group = "client"}),
  440.     awful.key({ modkey, "Shift"   }, "c",      function (c) c:kill()                         end,
  441.               {description = "close", group = "client"}),
  442.     awful.key({ modkey, "Control" }, "space",  awful.client.floating.toggle                     ,
  443.               {description = "toggle floating", group = "client"}),
  444.     awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
  445.               {description = "move to master", group = "client"}),
  446.     awful.key({ modkey,           }, "o",      function (c) c:move_to_screen()               end,
  447.               {description = "move to screen", group = "client"}),
  448.     awful.key({ modkey,           }, "t",      function (c) c.ontop = not c.ontop            end,
  449.               {description = "toggle keep on top", group = "client"}),
  450.     awful.key({ modkey,           }, "n",
  451.         function (c)
  452.             -- The client currently has the input focus, so it cannot be
  453.             -- minimized, since minimized clients can't have the focus.
  454.             c.minimized = true
  455.         end ,
  456.         {description = "minimize", group = "client"}),
  457.     awful.key({ modkey,           }, "m",
  458.         function (c)
  459.             c.maximized = not c.maximized
  460.             c:raise()
  461.         end ,
  462.         {description = "(un)maximize", group = "client"}),
  463.     awful.key({ modkey, "Control" }, "m",
  464.         function (c)
  465.             c.maximized_vertical = not c.maximized_vertical
  466.             c:raise()
  467.         end ,
  468.         {description = "(un)maximize vertically", group = "client"}),
  469.     awful.key({ modkey, "Shift"   }, "m",
  470.         function (c)
  471.             c.maximized_horizontal = not c.maximized_horizontal
  472.             c:raise()
  473.         end ,
  474.         {description = "(un)maximize horizontally", group = "client"}),
  475.         awful.key({ modkey }, "Alt_L", function () mykeyboardlayout.next_layout(); end),
  476.     awful.key({ modkey }, "Shift_L", function () mykeyboardlayout.next_layout(); end)
  477. )
  478.  
  479. -- Bind all key numbers to tags.
  480. -- Be careful: we use keycodes to make it work on any keyboard layout.
  481. -- This should map on the top row of your keyboard, usually 1 to 9.
  482. for i = 1, 9 do
  483.     globalkeys = gears.table.join(globalkeys,
  484.         -- View tag only.
  485.         awful.key({ modkey }, "#" .. i + 9,
  486.                   function ()
  487.                         local screen = awful.screen.focused()
  488.                         local tag = screen.tags[i]
  489.                         if tag then
  490.                            tag:view_only()
  491.                         end
  492.                   end,
  493.                   {description = "view tag #"..i, group = "tag"}),
  494.         -- Toggle tag display.
  495.         awful.key({ modkey, "Control" }, "#" .. i + 9,
  496.                   function ()
  497.                       local screen = awful.screen.focused()
  498.                       local tag = screen.tags[i]
  499.                       if tag then
  500.                          awful.tag.viewtoggle(tag)
  501.                       end
  502.                   end,
  503.                   {description = "toggle tag #" .. i, group = "tag"}),
  504.         -- Move client to tag.
  505.         awful.key({ modkey, "Shift" }, "#" .. i + 9,
  506.                   function ()
  507.                       if client.focus then
  508.                           local tag = client.focus.screen.tags[i]
  509.                           if tag then
  510.                               client.focus:move_to_tag(tag)
  511.                           end
  512.                      end
  513.                   end,
  514.                   {description = "move focused client to tag #"..i, group = "tag"}),
  515.         -- Toggle tag on focused client.
  516.         awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
  517.                   function ()
  518.                       if client.focus then
  519.                           local tag = client.focus.screen.tags[i]
  520.                           if tag then
  521.                               client.focus:toggle_tag(tag)
  522.                           end
  523.                       end
  524.                   end,
  525.                   {description = "toggle focused client on tag #" .. i, group = "tag"}),
  526.         --cmus
  527. awful.key({modkey}, "XF86AudioPlay", function () cmus_widget:play_pause() end, {description = "toggle track",   group = "cmus"}),
  528. awful.key(
  529.     {modkey},
  530.     "l",
  531.     function()
  532.     for s in screen do
  533.             awful.util.spawn("kitty cmatrix", {floating = true, screen = s, fullscreen = true})
  534.     end
  535.         awful.spawn.with_shell("alock -bg none && pkill cmatrix")
  536.     end,
  537.     {description = "matrixlock", group = "super"}
  538. ),
  539.     --screenshots
  540.     awful.key({  }, "XF86AudioRaiseVolume", function() volume_widget:inc(5) end),
  541. awful.key({  }, "XF86AudioLowerVolume", function() volume_widget:dec(5) end),
  542. awful.key({  }, "XF86AudioMute", function() volume_widget:toggle() end),
  543.  
  544.  awful.key({modkey}, "Print", function () awful.util.spawn("scrot -e 'mv $f ~/screenshots/ 2>/dev/null'", false) end)
  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.           "xtightvncviewer"},
  600.  
  601.         -- Note that the name property shown in xprop might be set slightly after creation of the client
  602.         -- and the name shown there might not match defined rules here.
  603.         name = {
  604.           "Event Tester",  -- xev.
  605.         },
  606.         role = {
  607.           "AlarmWindow",  -- Thunderbird's calendar.
  608.           "ConfigManager",  -- Thunderbird's about:config.
  609.           "pop-up",       -- e.g. Google Chrome's (detached) Developer Tools.
  610.         }
  611.       }, properties = { floating = true }},
  612.    
  613.  
  614.     -- Add titlebars to normal clients and dialogs
  615.     { rule_any = {type = { "normal", "dialog" }
  616.       }, properties = { titlebars_enabled = true }
  617.     },
  618.     {rule = {name = "GLava"
  619.           }, properties = { titlebars_enabled = false }
  620.       },
  621.  
  622.      --  Set Firefox to always map on the tag named "2" on screen 1.
  623. --     { rule = { class = "steam"},
  624. --       properties = { screen = 1, tag = "gme" } },
  625. --     { rule = { name = "steam"},
  626. --       properties = { screen = 1, tag = "gme" } },
  627. --     { rule = { name = "Friends List"},
  628. --       properties = { screen = 1, tag = "gme" } },
  629.      { rule = { class = "pidgin"},
  630.        properties = { screen = 1, tag = "msg" } },
  631.      { rule = { name = "pidgin"},
  632.        properties = { screen = 1, tag = "msg" } },
  633.      { rule = { name = "Buddy List"},
  634.        properties = { screen = 1, tag = "msg" } },
  635.      { rule = { name = "Accounts"},
  636.        properties = { screen = 1, tag = "msg" } },
  637. --     { rule = { class = "thunderbird"},
  638. --       properties = { screen = 1, tag = "msg" } },
  639.  
  640.  
  641. }
  642. -- }}}
  643. --Autorun
  644.  
  645. awful.spawn("killall glava")
  646.  
  647. --awful.spawn.with_shell("~/.config/awesome/autorun.sh")
  648.  
  649.  
  650.  
  651.  
  652. --awful.spawn.with_shell("xcompmgr")
  653. --awful.spawn.with_shell("devilspie -a")
  654. --awful.spawn.with_shell("kmix",{
  655. --      hidden  =true})
  656. awful.spawn.with_shell("picom -b",{
  657.     })
  658. --awful.spawn.once("firefox", {
  659. --  tag ="www"})
  660. --awful.spawn.once("thunderbird", {
  661. --  tag ="www"})
  662. --awful.spawn.once("steam", {
  663. --  tag ="gme"})
  664. awful.spawn.once("nm-applet", {})
  665. --awful.spawn.once("kitty cmatrix -a -C magenta", {
  666. --  tag     = "2"})
  667. --awful.spawn("kitty cowsay $(fortune)", {
  668. --  tag     = "2"})
  669. --awful.spawn.once("discord", {
  670. --  tag ="msg"})
  671.  
  672. awful.spawn.once("pidgin", {
  673.     tag     = "msg"})
  674. --awful.spawn("kitty lynx", {
  675. --  tag     = "www" })
  676. --awful.spawn("kitty discordo", {
  677. --  tag     = "msg"})
  678. --awful.spawn("kitty", {
  679. --  tag = "1"})
  680.  
  681. awful.spawn.once("glava", {
  682.     tag ="1",
  683.     request_no_titlebar ="true",
  684.     placement="awful.placement.top_left"})
  685. --awful.spawn.once("kitty irssi", {
  686. --  tag ="msg"})
  687. --awful.spawn.with_shell()
  688. --awful.spawn.with_shell()
  689. --awful.spawn.with_shell("feh --bg-fill ~/.config/awesome/themes/default/backgroundnew.jpg")
  690. awful.spawn.once("kitty cmus", {
  691.     tag ="1",
  692.     placement   = "awful.placement.bottom_right"
  693.     })
  694.  
  695. -- {{{ Signals
  696. -- Signal function to execute when a new client appears.
  697. client.connect_signal("manage", function (c)
  698.     -- Set the windows at the slave,
  699.     -- i.e. put it at the end of others instead of setting it master.
  700.     -- if not awesome.startup then awful.client.setslave(c) end
  701.  
  702.     if awesome.startup
  703.       and not c.size_hints.user_position
  704.       and not c.size_hints.program_position then
  705.         -- Prevent clients from being unreachable after screen count changes.
  706.         awful.placement.no_offscreen(c)
  707.     end
  708. end)
  709.  
  710. -- Add a titlebar if titlebars_enabled is set to true in the rules.
  711. client.connect_signal("request::titlebars", function(c)
  712.     -- buttons for the titlebar
  713.     local buttons = gears.table.join(
  714.         awful.button({ }, 1, function()
  715.             c:emit_signal("request::activate", "titlebar", {raise = true})
  716.             awful.mouse.client.move(c)
  717.         end),
  718.         awful.button({ }, 3, function()
  719.             c:emit_signal("request::activate", "titlebar", {raise = true})
  720.             awful.mouse.client.resize(c)
  721.         end)
  722.     )
  723.  
  724.     awful.titlebar(c) : setup {
  725.         { -- Left
  726.             awful.titlebar.widget.iconwidget(c),
  727.             buttons = buttons,
  728.             layout  = wibox.layout.fixed.horizontal
  729.         },
  730.         { -- Middle
  731.             { -- Title
  732.                 align  = "center",
  733.                 widget = awful.titlebar.widget.titlewidget(c)
  734.             },
  735.             buttons = buttons,
  736.             layout  = wibox.layout.flex.horizontal
  737.         },
  738.         { -- Right
  739.             awful.titlebar.widget.floatingbutton (c),
  740.             awful.titlebar.widget.maximizedbutton(c),
  741.             awful.titlebar.widget.stickybutton   (c),
  742.             awful.titlebar.widget.ontopbutton    (c),
  743.             awful.titlebar.widget.closebutton    (c),
  744.             layout = wibox.layout.fixed.horizontal()
  745.         },
  746.         layout = wibox.layout.align.horizontal
  747.     }
  748. end)
  749.  
  750. -- Enable sloppy focus, so that focus follows mouse.
  751. client.connect_signal("mouse::enter", function(c)
  752.     c:emit_signal("request::activate", "mouse_enter", {raise = false})
  753. end)
  754.  
  755. client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
  756. client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
  757. -- }}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement