Advertisement
Guest User

Untitled

a guest
Aug 26th, 2017
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.69 KB | None | 0 0
  1. -- Standard awesome library
  2. local gears = require("gears")
  3. local awful = require("awful")
  4. awful.rules = require("awful.rules")
  5. require("awful.autofocus")
  6. -- Widget and layout library
  7. local wibox = require("wibox")
  8. local lain = require("lain")
  9. -- Theme handling library
  10. local beautiful = require("beautiful")
  11. -- Notification library
  12. local naughty = require("naughty")
  13. local menubar = require("menubar")
  14. -- Vicious
  15. vicious = require ("vicious")
  16. --Application Menu
  17. xdg_menu = require("archmenu")
  18.  
  19. -- {{{ Error handling
  20. -- Check if awesome encountered an error during startup and fell back to
  21. -- another config (This code will only ever execute for the fallback config)
  22. if awesome.startup_errors then
  23.     naughty.notify({ preset = naughty.config.presets.critical,                                    
  24.     end)             title = "Oops, there were errors during startup!",                            
  25. end
  26. -- }}}
  27.  
  28. -- {{{ Variable definitions
  29. -- Themes define colours, icons, font and wallpapers.
  30. beautiful.init("~/.config/awesome/themes/default/theme.lua")
  31. for s = 1, screen.count() do
  32.         gears.wallpaper.maximized(beautiful.wallpaper, s, true)
  33. end
  34.  
  35. -- This is used later as the default terminal and editor to run.
  36. terminal = "urxvtc -e tmux"
  37. editor = os.getenv("EDITOR") or "nano"
  38. editor_cmd = terminal .. " -e " .. editor
  39.  
  40. -- Default modkey.
  41. -- Usually, Mod4 is the key with a logo between Control and Alt.
  42. -- If you do not like this or do not have such a key,
  43. -- I suggest you to remap Mod4 to another key using xmodmap or other tools.
  44. -- However, you can use another modifier like Mod1, but it may interact with others.
  45. modkey = "Mod4"
  46.  
  47. tags = {
  48.   names  = { "1", "2", "3", "4"},
  49.   layout = { layouts[2], layouts[2], layouts[2], layouts[2]
  50. }}
  51.  
  52. for s = 1, screen.count() do
  53.     tags[s] = awful.tag(tags.names, s, tags.layout)
  54. end
  55. -- }}}
  56.  
  57. -- {{{ Menu
  58. -- Create a laucher widget and a main menu
  59. myawesomemenu = {
  60.    { "manual", terminal .. " -e man awesome" },
  61.    { "edit config", editor_cmd .. " " .. awesome.conffile },
  62.    { "restart", awesome.restart },
  63.    { "quit", awesome.quit }
  64. }
  65.  
  66. mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
  67.                                     { "Applications", xdgmenu },
  68.                                     { "terminal", terminal }
  69.                                   }
  70.                                           end),
  71.                      awful.button({ }, 3, function ()
  72.                                               if instance then
  73.                                                   instance:hide()
  74.                                                   instance = nil
  75.                                               else
  76.                                                   instance = awful.menu.clients({
  77.                                                       theme = { width = 250 }
  78.                                                   })
  79.                                               end
  80.                                           end),
  81.                      awful.button({ }, 4, function ()
  82.                                               awful.client.focus.byidx(1)
  83.                                               if client.focus then client.focus:raise() end
  84.                                           end),
  85.                      awful.button({ }, 5, function ()
  86.                                               awful.client.focus.byidx(-1)
  87.                                               if client.focus then client.focus:raise() end
  88.                                           end))
  89.  
  90. for s = 1, screen.count() do
  91.     -- Create a promptbox for each screen
  92.     mypromptbox[s] = awful.widget.prompt()
  93.     -- Create an imagebox widget which will contains an icon indicating
  94.     -- Layout manipulation
  95.     awful.key({ modkey, "Shift"   }, "j", function () awful.client.swap.byidx(  1)    end),
  96.     awful.key({ modkey, "Shift"   }, "k", function () awful.client.swap.byidx( -1)    end),
  97.     awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end),
  98.     awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end),
  99.     awful.key({ modkey,           }, "u", awful.client.urgent.jumpto),
  100.     awful.key({ modkey,           }, "Tab",
  101.         function ()
  102.             awful.client.focus.history.previous()
  103.             if client.focus then
  104.                 client.focus:raise()
  105.             end
  106.         end),
  107.  
  108.     -- Standard program
  109.     awful.key({ modkey,           }, "Return", function () awful.util.spawn(terminal) end),
  110.     awful.key({ modkey, "Control" }, "r", awesome.restart),
  111.     awful.key({ modkey, "Shift"   }, "q", awesome.quit),
  112.  
  113.     awful.key({ modkey,           }, "l",     function () awful.tag.incmwfact( 0.05)    end),
  114.     awful.key({ modkey,           }, "h",     function () awful.tag.incmwfact(-0.05)    end),
  115.     awful.key({ modkey, "Shift"   }, "h",     function () awful.tag.incnmaster( 1)      end),
  116.                         if tag then, "l",     function () awfu
  117.                            awful.tag.viewonly(tag)
  118.                         end
  119.                   end),
  120.         -- Toggle tag.
  121.         awful.key({ modkey, "Control" }, "#" .. i + 9,
  122.                   function ()
  123.                       local screen = mouse.screen
  124.                       local tag = awful.tag.gettags(screen)[i]
  125.                       if tag then
  126.                          awful.tag.viewtoggle(tag)
  127.                       end
  128.                   end),
  129.         -- Move client to tag.
  130.         awful.key({ modkey, "Shift" }, "#" .. i + 9,
  131.                   function ()
  132.                       if client.focus then
  133.                           local tag = awful.tag.gettags(client.focus.screen)[i]
  134.                           if tag then
  135.                               awful.client.movetotag(tag)
  136.                           end
  137.                      end
  138.                   end),
  139.         --
  140.         -- Widgets that are aligned to the left
  141.         local left_layout = wibox.layout.fixed.horizontal()
  142.         left_layout:add(awful.titlebar.widget.iconwidget(c))
  143.         left_layout:buttons(buttons)
  144.  
  145.         -- Widgets that are aligned to the right
  146.         local right_layout = wibox.layout.fixed.horizontal()
  147.         right_layout:add(awful.titlebar.widget.floatingbutton(c))
  148.         right_layout:add(awful.titlebar.widget.maximizedbutton(c))
  149.         right_layout:add(awful.titlebar.widget.stickybutton(c))
  150.         right_layout:add(awful.titlebar.widget.ontopbutton(c))
  151.         right_layout:add(awful.titlebar.widget.closebutton(c))
  152.  
  153.         -- The title goes in the middle
  154.         local middle_layout = wibox.layout.flex.horizontal()
  155.         local title = awful.titlebar.widget.titlewidget(c)
  156.         title:set_align("center")
  157.         middle_layout:add(title)
  158.         middle_layout:buttons(buttons)
  159.  
  160.         -- Now bring it all together
  161.         local layout = wibox.layout.align.horizontal()
  162.         layout:set_left(left_layout)
  163.         layout:set_right(right_layout)
  164.         layout:set_middle(middle_layout)
  165.  
  166.         awful.titlebar(c):set_widget(layout)
  167.     end
  168. end)
  169.  
  170. client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
  171. client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
  172. -- }}}
  173.  
  174. --Autostart apps
  175.  awful.util.spawn("cbatticon")
  176.  awful.util.spawn("netmon")
  177.  awful.util.spawn("blueman-applet")
  178.  awful.util.spawn("caffeine")
  179.  awful.util.spawn("pasystray")
  180.  awful.util.spawn_with_shell("urxvtd")
  181.  awful.util.spawn_with_shell("compton -Cb --inactive-opacity 0.75 --blur-background")
  182. -- awful.util.spawn_with_shell("qjackctl")
  183.  awful.util.spawn_with_shell("xscreensaver -no-splash")
  184.  awful.util.spawn_with_shell("redshift -l  35.198284:-111.651302")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement