Advertisement
Guest User

rc.lua

a guest
Sep 16th, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 20.45 KB | None | 0 0
  1. --   L O A D   L I B R A R Y   -------------------------------------------------
  2.  
  3. require("awful")
  4. require("awful.autofocus")
  5. require("awful.rules")
  6. require("beautiful")
  7. require("naughty")
  8. --calendar = require{"calendar"}
  9.  
  10. --require("vicious")
  11. --shifty = require("shifty")
  12. vicious = require("vicious")
  13. --require{"calendar"}
  14. cal = require("cal")
  15.  
  16. --   E R R O R S   -------------------------------------------------------------
  17. if awesome.startup_errors then
  18.     naughty.notify({ preset = naughty.config.presets.critical,
  19.         title = "Oops, there were errors during startup!",
  20.         text = awesome.startup_errors })
  21. end
  22. do
  23.     local in_error = false
  24.     awesome.add_signal("debug::error", function (err)
  25.         if in_error then return end
  26.         in_error = true
  27.         naughty.notify({ preset = naughty.config.presets.critical,
  28.             title = "Oops, an error happened!",
  29.             text = err })
  30.         in_error = false
  31.     end)
  32. end
  33.  
  34.  
  35. --   T H E M E   ---------------------------------------------------------------
  36. beautiful.init("/home/funeralismatic/.config/awesome/themes/funeralismatic/theme.lua")
  37.  
  38.  
  39. --   V A R I A B L E S   -------------------------------------------------------
  40. terminal = "terminator"
  41. editor = os.getenv("EDITOR") or "nano"
  42. editor_cmd = terminal .. " -e " .. editor
  43.  
  44.  
  45. --   D E F A U L T   M O D K E Y   ---------------------------------------------
  46. modkey = "Mod4"
  47.  
  48.  
  49. --   L A Y O U T   T A B L E   -------------------------------------------------
  50. layouts = {
  51.     awful.layout.suit.floating,
  52.     awful.layout.suit.tile.left,
  53.     awful.layout.suit.tile,
  54.     awful.layout.suit.tile.bottom,
  55.     awful.layout.suit.max
  56. --  awful.layout.suit.tile.top,
  57. --  awful.layout.suit.fair,
  58. --  awful.layout.suit.fair.horizontal,
  59. --  awful.layout.suit.spiral
  60. --  awful.layout.suit.spiral.dwindle
  61. --  awful.layout.suit.max.fullscreen,
  62. --  awful.layout.suit.magnifier
  63. }
  64.  
  65. --   T A G S   -----------------------------------------------------------------
  66. tags = {
  67.     names  = { "main", "internet", "terminal", "media", "design", "other"},
  68.     layout = { layouts[2], layouts[3], layouts[5], layouts[1], layouts[2], layouts[1]}
  69. }
  70.  
  71.  for s = 1, screen.count() do
  72.      tags[s] = awful.tag(tags.names, s, tags.layout)
  73.  end
  74.  
  75.  
  76. --   M E N U   -----------------------------------------------------------------
  77.  
  78. -- AWESOME MENU --
  79. myawesomemenu = {
  80.     { "manual", terminal .. " -e man awesome" },
  81.     { "edit config", editor_cmd .. " " .. awesome.conffile },
  82.     { "restart", awesome.restart },
  83.     { "quit", awesome.quit }
  84. }
  85.  
  86. -- INTERNET MENU --
  87. myinternetmenu = {
  88.     { "Chromium", "chromium" },
  89.     { "Firefox", "firefox" },
  90.     { "Thunderbird", "thunderbird" },
  91.     { "Deluge", "deluge" },
  92.     { "lICQ", "licq" },
  93.     { "Skype", "skype" },
  94.     { "Vacuum IM", "vacuum" }
  95. }
  96.  
  97. -- DESIGN MENU --
  98. mydesignmenu = {
  99.     { "Inkscape", "inkscape" },
  100.     { "Font Editor", "fontforge" },
  101.     { "MyPaint", "mypaint" },
  102.     { "gimp", "gimp" }
  103. }
  104.  
  105. -- MULTIMEDIA MENU --
  106. mymediamenu = {
  107.     { "Deadbeef", "deadbeef" },
  108.     { "Volume", "aumix" },
  109.     { "XfBurn", "xfburn" }
  110. }
  111.  
  112. -- SETTINGS MENU --
  113. mysettingsmenu = {
  114.     { "Awesome", myawesomemenu, beautiful.awesome_icon },
  115.     { "hTop", terminal .. " -e htop" },
  116.     { "GTK+ Theme", "lxappearance" },
  117.     { "Task Manager", "lxtask" },
  118.     { "Terminal", terminal },
  119.     { "ROOT Terminal", "ktsuss --user root terminator" },
  120.     { "Connections", "ktsuss --user root nm-connection-editor" },
  121.     { "Qt Configure", "qtconfig" },
  122.     { "Gparted", "ktsuss --user root gparted-pkexec" }
  123. }
  124.  
  125. -- OFFICE MENU --
  126. myofficemenu = {
  127.     { "Reader", "evince" },
  128.     { "Charmap", "mucharmap" },
  129.     { "Clipboard Manager", "parcellite" },
  130.     { "Calculator", "mate-calc" },
  131.     { "Osmo", "osmo" }
  132. }
  133.  
  134. -- MAIN MENU --
  135. mymainmenu = awful.menu({ items = {
  136.     { "Internet", myinternetmenu, beautiful.awesome_icon },
  137.     { "Design", mydesignmenu, beautiful.awesome_icon },
  138.     { "Multimedia", mymediamenu, beautiful.awesome_icon },
  139.     { "Settings", mysettingsmenu, beautiful.awesome_icon },
  140.     { "Office", myofficemenu, beautiful.awesome_icon },
  141.     { "Editra", "editra" },
  142.     { "Archive Manager", "engrampa" },
  143.     { "File Manager", "spacefm" },
  144.     { "RecordMyDesktop", "gtk-recordmydesktop" },
  145.     { "NEStopia", "nestopia" },
  146.     { "zDoom", "zdoom" }
  147. }})
  148.  
  149.  
  150. --   R E G I S T E R   W I D G E T S   -----------------------------------------
  151.  
  152. -- MENU LAUNCHER --
  153. mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), menu = mymainmenu })
  154.  
  155. -- INTERNET WIDGET --
  156. netwidget_down = widget({ type = "textbox" })
  157. vicious.register(netwidget_down, vicious.widgets.net, '<span color="#000000">${usb0 down_kb}</span>', 1)
  158. netwidget_up = widget({ type = "textbox" })
  159. vicious.register(netwidget_up, vicious.widgets.net, '<span color="#000000">${usb0 up_kb}</span>', 1)
  160.  
  161. --VOLUME WIDGET --
  162. volwidget = widget({ type = "textbox" })
  163. vicious.register(volwidget, vicious.widgets.volume, "$1%", 5, "Master")
  164. volwidget:buttons(awful.util.table.join(
  165.     awful.button({ }, 1, function () awful.util.spawn("aumix", false) end),
  166.     awful.button({ }, 2, function () awful.util.spawn("amixer sset Master toggle", false)   end),
  167.     awful.button({ }, 4, function () awful.util.spawn("aumix -v +5", false) end),
  168.     awful.button({ }, 5, function () awful.util.spawn("aumix -v -5", false) end)
  169. ))
  170.  
  171. -- IMAGES --
  172. netimg = widget({ type = "imagebox" })
  173. netimg.image = image("/home/funeralismatic/.config/awesome/icons/net_icon.png")
  174.  
  175. volimg = widget({ type = "imagebox" })
  176. volimg.image = image("/home/funeralismatic/.config/awesome/icons/volume.png")
  177.  
  178. kbdimg = widget({ type = "imagebox" })
  179. kbdimg.image = image("/home/funeralismatic/.config/awesome/icons/keyboard.png")
  180.  
  181. clkimg = widget({ type = "imagebox" })
  182. clkimg.image = image("/home/funeralismatic/.config/awesome/icons/clock.png")
  183.  
  184. arr = widget({ type = "imagebox" })
  185. arr.image = image("/home/funeralismatic/.config/awesome/icons/arr.png")
  186.  
  187. -- DEADBEEF ALL-IN-ONE WIDGET --
  188. dbpp = widget({ type = "imagebox" })
  189. dbpp.image = image("/home/funeralismatic/.config/awesome/icons/deadbeef.png")
  190. dbpp:buttons(awful.util.table.join(
  191.     awful.button({ }, 1, function () awful.util.spawn("deadbeef --play-pause", false) end),
  192.     awful.button({ }, 2, function () awful.util.spawn("deadbeef --stop", false)   end),
  193.     awful.button({ }, 8, function () awful.util.spawn("deadbeef --prev", false) end),
  194.     awful.button({ }, 9, function () awful.util.spawn("deadbeef --next", false) end),
  195.     awful.button({ }, 3, function () awful.util.spawn("amixer sset Master toggle", false)   end),
  196.     awful.button({ }, 4, function () awful.util.spawn("aumix -v +5", false) end),
  197.     awful.button({ }, 5, function () awful.util.spawn("aumix -v -5", false) end)
  198. ))
  199. dbpp:add_signal("mouse::enter", function() coverart_show() end)
  200. dbpp:add_signal("mouse::leave", function() coverart_hide() end)
  201.  
  202. -- DEADBEEF POPUP NOTIFICATION --
  203. local coverart_nf
  204. function coverart_show()
  205.     local artcache = '/home/funeralismatic/.cache/deadbeef/covers'
  206.     local artist_var = io.popen("deadbeef --nowplaying %a", "r")
  207.     local artist = artist_var:read()
  208.     local title_var = io.popen("deadbeef --nowplaying %t", "r")
  209.     local title = title_var:read()
  210.     local album_var = io.popen("deadbeef --nowplaying %b", "r")
  211.     local album = album_var:read()
  212.     local year_var = io.popen("deadbeef --nowplaying %y", "r")
  213.     local year = year_var:read()
  214.     local time_var = io.popen("deadbeef --nowplaying \"%e | %l\"", "r")
  215.     local time = time_var:read()
  216.     local img = string.format("%s/%s/%s.jpg", artcache, artist, album)
  217.     local ico = image(img)
  218.     local txt = string.format('%s\nby %s\nfrom %s\n%s', title, artist, album, time)
  219.     coverart_nf = naughty.notify({icon = ico, icon_size = 72, text = txt,
  220.     position = "top_right", timeout = 10 })
  221. end
  222. function coverart_hide()
  223.     if coverart_nf ~= nil then
  224.         naughty.destroy(coverart_nf)
  225.     end
  226. end
  227.  
  228. -- TIME-DATE WIDGET --
  229. datewidget = widget({ type = "textbox" })
  230. vicious.register(datewidget, vicious.widgets.date, "%H:%M:%S", 1)
  231. --cal.register(datewidget, "<b>%s</b>")
  232. today = awful.tooltip({objects = {datewidget,clkimg},})
  233. function get_today()
  234.     return os.date('<span background="#000" color="#fff"> %A, %d.%m.%Y </span>')
  235. end
  236. today:set_text(get_today())
  237.  
  238. -- DEFAULT CLOCK WIDGET --
  239. --mytextclock = awful.widget.textclock({ align = "right" })
  240.  
  241. -- SYSTEM TRAY WIDGET --
  242. mysystray = widget({ type = "systray" })
  243.  
  244. -- SEPARATORS --
  245. spacer  = widget({ type = "textbox"  })
  246. separator = widget({ type = "imagebox" })
  247. spacer.text = " "
  248. separator.image = image(beautiful.widget_sep)
  249.  
  250. -- KEYBOARD WIDGET --
  251. -- widget --
  252. kbdwidget = widget({type = "textbox", name = "kbdwidget"})
  253. kbdwidget.border_color = beautiful.fg_normal
  254. kbdwidget.text = "en"
  255. -- dbus --
  256. dbus.request_name("session", "ru.gentoo.kbdd")
  257. dbus.add_match("session", "interface='ru.gentoo.kbdd',member='layoutChanged'")
  258. dbus.add_signal("ru.gentoo.kbdd", function(...)
  259.     local data = {...}
  260.     local layout = data[2]
  261.     lts = {[0] = "en", [1] = "ru"}
  262.     kbdwidget.text = " "..lts[layout].." "
  263.     end
  264. )
  265.  
  266. -- CREATE WIDGETS --
  267. mywibox = {}
  268. mywiboxtray = {}
  269. mypromptbox = {}
  270. mylayoutbox = {}
  271.  
  272. -- TAGLIST --
  273. mytaglist = {}
  274. mytaglist.buttons = awful.util.table.join(
  275.     awful.button({ }, 1, awful.tag.viewonly),
  276.     awful.button({ modkey }, 1, awful.client.movetotag),
  277.     awful.button({ }, 3, awful.tag.viewtoggle),
  278.     awful.button({ modkey }, 3, awful.client.toggletag),
  279.     awful.button({ }, 5, awful.tag.viewnext),
  280.     awful.button({ }, 4, awful.tag.viewprev)
  281. )
  282.  
  283. -- TASKLIST --
  284. mytasklist = {}
  285. mytasklist.buttons = awful.util.table.join(
  286.     awful.button({ }, 1, function (c)
  287.         if c == client.focus then
  288.             c.minimized = true
  289.         else
  290.             if not c:isvisible() then
  291.                 awful.tag.viewonly(c:tags()[1])
  292.             end
  293.             client.focus = c
  294.             c:raise()
  295.         end
  296.     end),
  297.     awful.button({ }, 3, function ()
  298.         if instance then
  299.             instance:hide()
  300.             instance = nil
  301.         else
  302.             instance = awful.menu.clients({ width=250 })
  303.         end
  304.     end),
  305.     awful.button({ }, 4, function ()
  306.         awful.client.focus.byidx(1)
  307.         if client.focus then client.focus:raise() end
  308.     end),
  309.     awful.button({ }, 5, function ()
  310.         awful.client.focus.byidx(-1)
  311.         if client.focus then client.focus:raise() end
  312.     end))
  313. for s = 1, screen.count() do
  314.  
  315. -- PROMPTBOX WIGDET --
  316. mypromptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright })
  317.  
  318. -- LAYOUT WIDGET --
  319. mylayoutbox[s] = awful.widget.layoutbox(s)
  320. mylayoutbox[s]:buttons(awful.util.table.join(
  321.     awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
  322.     awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
  323.     awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
  324.     awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
  325.  
  326. -- TAGS --
  327. mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, mytaglist.buttons)
  328.  
  329. -- TASKLIST --
  330. mytasklist[s] = awful.widget.tasklist(function(c)
  331.     return awful.widget.tasklist.label.currenttags(c, s)
  332.     end,
  333.     mytasklist.buttons)
  334.  
  335. -- TASKLIST ICONS ONLY --
  336. --mytasklist[s] = awful.widget.tasklist(function(c)
  337. --  local task = { awful.widget.tasklist.label.currenttags(c, s) }
  338. --  return '', task[2], task[3], task[4]
  339. --end, mytasklist.buttons)
  340.  
  341. -- WIBOX --
  342. mywibox[s] = awful.wibox({ position = "top", screen = s, height="24" })
  343. mywibox[s].widgets = {{
  344.         mylauncher,
  345.         --separator,
  346.         mylayoutbox[s],
  347.         separator,
  348.         mytaglist[s],
  349. --      mypromptbox[s],
  350.         separator,
  351.         layout = awful.widget.layout.horizontal.leftright},
  352.     spacer,
  353.     datewidget,
  354.     clkimg,
  355.     separator,
  356.     kbdwidget,
  357.     kbdimg,
  358.     separator,
  359.     netwidget_up,
  360.     netimg,
  361.     netwidget_down,
  362.     separator,
  363.     volwidget,
  364.     volimg,
  365.     separator,
  366.     dbpp,
  367.     separator,
  368. --  s == 1 and mysystray or nil,
  369.     s == 1 or nil,
  370. --  separator,
  371.     mytasklist[s],
  372.     layout = awful.widget.layout.horizontal.rightleft
  373.     }
  374.  
  375. -- BOTTOM WIBOX WITH TRAY --
  376. mywiboxtray[s] = awful.wibox({ position = "bottom", screen = s, width="380", height="24", align="right"})
  377. mywiboxtray[s].visible = false
  378. mywiboxtray[s].widgets = {{
  379.         mypromptbox[s],
  380.         layout = awful.widget.layout.horizontal.leftright},
  381.     s == 1 and mysystray or nil,
  382. --  s == 1 or nil,
  383. --  mysystray[s],
  384.     arr,
  385.     layout = awful.widget.layout.horizontal.rightleft
  386. }
  387. end
  388.  
  389. -- MOUSE BINDINGS --
  390. root.buttons(awful.util.table.join(
  391.     awful.button({ }, 3, function () mymainmenu:toggle() end),
  392.     awful.button({ }, 4, awful.tag.viewnext),
  393.     awful.button({ }, 5, awful.tag.viewprev)
  394. ))
  395.  
  396.  
  397. -- K E Y   B I N D I N G S   ---------------------------------------------------
  398. globalkeys = awful.util.table.join(
  399.  
  400.     awful.key({}, "Menu", function() mymainmenu:toggle() end),
  401.     awful.key({modkey}, "b", function() mywiboxtray[mouse.screen].visible = not mywiboxtray[mouse.screen].visible end),
  402.  
  403. -- KEYBOARD LAYOUT SWITCH --
  404. --  awful.key({modkey,}, "space", function() kbdcfg.switch() end),
  405.  
  406. -- VOLUME CONTROL --
  407.     awful.key({}, "XF86AudioRaiseVolume", function() awful.util.spawn("aumix -v +5") end),
  408.     awful.key({}, "XF86AudioLowerVolume", function() awful.util.spawn("aumix -v -5") end),
  409.     awful.key({}, "XF86AudioMute", function() awful.util.spawn("amixer sset Master toggle") end),
  410.  
  411. -- SCREENSHOT --
  412.     awful.key({"Control", "Shift"}, "Print", function() awful.util.spawn("screengrab --region") end),
  413.     awful.key({"Control",}, "Print", function() awful.util.spawn("screengrab --active") end),
  414.     awful.key({}, "Print", function() awful.util.spawn("screengrab --fullscreen") end),
  415.  
  416. -- LOCK SCREEN --
  417.     awful.key({modkey,}, "l", function() awful.util.spawn("xautolock -locknow") end),
  418.  
  419. -- APPLICATIONS --
  420.     awful.key({"Control", "Shift"}, "Escape", function() awful.util.spawn("lxtask") end),
  421.  
  422. -- TAGS SWITCH --
  423.     awful.key({modkey,}, "Left", awful.tag.viewprev),
  424.     awful.key({modkey,}, "Right", awful.tag.viewnext),
  425.     awful.key({modkey,}, "Escape", awful.tag.history.restore),
  426.  
  427. -- CLIENT SWITCH --
  428.     awful.key({modkey, "Control"}, "Tab", function() awful.client.focus.history.previous() if client.focus then client.focus:raise() end end),
  429.     awful.key({modkey,}, "Tab", function() awful.client.focus.byidx(1) if client.focus then client.focus:raise() end end),
  430.     awful.key({modkey, "Shift"}, "Tab", function() awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end),
  431.  
  432.  
  433.     -- Layout manipulation
  434.     awful.key({modkey, "Control"}, ".", function () awful.client.swap.byidx(  1)    end),
  435.     awful.key({modkey, "Control"}, ",", function () awful.client.swap.byidx( -1)    end),
  436.     awful.key({modkey, "Shift"}, ".", function () awful.screen.focus_relative( 1) end),
  437.     awful.key({modkey, "shift"}, ",", function () awful.screen.focus_relative(-1) end),
  438.     awful.key({modkey,}, "u", awful.client.urgent.jumpto),
  439.  
  440.     -- Standard program
  441.     awful.key({ modkey,      }, "Return", function () awful.util.spawn(terminal) end),
  442.     awful.key({ modkey, "Control" }, "r", awesome.restart),
  443.     awful.key({ modkey, "Shift" }, "q", awesome.quit),
  444.  
  445.     awful.key({ modkey,      }, "equal",    function () awful.tag.incmwfact( 0.05)  end),
  446.     awful.key({ modkey,      }, "minus",    function () awful.tag.incmwfact(-0.05)  end),
  447.     awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1)    end),
  448.     awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1)    end),
  449.     awful.key({ modkey, "Control" }, "h",   function () awful.tag.incncol( 1)       end),
  450.     awful.key({ modkey, "Control" }, "l",   function () awful.tag.incncol(-1)       end),
  451.    
  452.      --awful.key({ modkey,       }, "space", function () awful.layout.inc(layouts,  1) end),
  453.      --awful.key({ modkey, "Shift"  }, "space", function () awful.layout.inc(layouts, -1) end),
  454.  
  455.     awful.key({ modkey, "Control" }, "n", awful.client.restore),
  456.  
  457.     -- Prompt
  458.     awful.key({ modkey }, "r", function() mypromptbox[mouse.screen]:run() end),
  459.  
  460.     awful.key({ modkey }, "x",
  461.             function ()
  462.                 awful.prompt.run({ prompt = "Run Lua code: " },
  463.                 mypromptbox[mouse.screen].widget,
  464.                 awful.util.eval, nil,
  465.                 awful.util.getdir("cache") .. "/history_eval")
  466.             end)
  467. )
  468.  
  469. clientkeys = awful.util.table.join(
  470.     awful.key({ modkey,}, "f",  awful.client.floating.toggle),
  471.    
  472. --  awful.key({ modkey,}, "f",  function (c) c.fullscreen = not c.fullscreen  end),
  473.     awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end),
  474.     awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
  475.     awful.key({ modkey,      }, "o",    awful.client.movetoscreen),
  476.     awful.key({ modkey, "Shift" }, "r", function (c) c:redraw()                  end),
  477.     awful.key({ modkey,      }, "t",    function (c) c.ontop = not c.ontop          end),
  478.     awful.key({modkey,}, "n", function (c)c.minimized = true end),
  479.    
  480.     awful.key({modkey,}, "m", function (c) c.maximized_horizontal = not c.maximized_horizontal c.maximized_vertical = not c.maximized_vertical end)
  481. )
  482.  
  483. -- Compute the maximum number of digit we need, limited to 9
  484. keynumber = 0
  485. for s = 1, screen.count() do
  486.     keynumber = math.min(9, math.max(#tags[s], keynumber));
  487. end
  488.  
  489. -- Bind all key numbers to tags.
  490. -- Be careful: we use keycodes to make it works on any keyboard layout.
  491. -- This should map on the top row of your keyboard, usually 1 to 9.
  492. for i = 1, keynumber do
  493.     globalkeys = awful.util.table.join(globalkeys,
  494.         awful.key({ modkey }, "#" .. i + 9,
  495.                 function ()
  496.                         local screen = mouse.screen
  497.                         if tags[screen][i] then
  498.                             awful.tag.viewonly(tags[screen][i])
  499.                         end
  500.                 end),
  501.         awful.key({ modkey, "Control" }, "#" .. i + 9,
  502.                 function ()
  503.                     local screen = mouse.screen
  504.                     if tags[screen][i] then
  505.                         awful.tag.viewtoggle(tags[screen][i])
  506.                     end
  507.                 end),
  508.         awful.key({ modkey, "Shift" }, "#" .. i + 9,
  509.                 function ()
  510.                     if client.focus and tags[client.focus.screen][i] then
  511.                         awful.client.movetotag(tags[client.focus.screen][i])
  512.                     end
  513.                 end),
  514.         awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
  515.                 function ()
  516.                     if client.focus and tags[client.focus.screen][i] then
  517.                         awful.client.toggletag(tags[client.focus.screen][i])
  518.                     end
  519.                 end))
  520. end
  521.  
  522. clientbuttons = awful.util.table.join(
  523.     awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
  524.     awful.button({ modkey }, 1, awful.mouse.client.move),
  525.     awful.button({ modkey }, 3, awful.mouse.client.resize))
  526.    
  527.  
  528. -- Set keys
  529. root.keys(globalkeys)
  530. -- }}}
  531.  
  532. -- {{{ Rules
  533. awful.rules.rules = {
  534.     -- All clients will match this rule.
  535.     { rule = { },
  536.     properties = { border_width = beautiful.border_width,
  537.                     border_color = beautiful.border_normal,
  538.                     focus = true,
  539.                     keys = clientkeys,
  540.                     buttons = clientbuttons } },
  541. --  { rule = { class = "MPlayer" },
  542. --  properties = { floating = true } },
  543.     { rule = { class = "pinentry" },
  544.     properties = { floating = true } },
  545.     -- Set Firefox to always map on tags number 2 of screen 1.
  546.     -- { rule = { class = "Firefox" },
  547.     --  properties = { tag = tags[1][2] } },
  548.     { rule = { class = "Gimp" },
  549.      properties = { tag = tags[1][5] } },
  550.     { rule = { class = "Terminator" },
  551.      properties = { tag = tags[1][3] } },
  552.     { rule = { class = "Chromium" },
  553.      properties = { tag = tags[1][2] } },
  554.     { rule = { class = "Deadbeef" },
  555.      properties = { tag = tags[1][4] } },
  556.     { rule = { class = "Vacuum" },
  557.      properties = { tag = tags[1][2] } },
  558.     { rule = { class = "Firefox" },
  559.      properties = { tag = tags[1][2] } },
  560.     { rule = { class = "Thunderbird" },
  561.      properties = { tag = tags[1][2] } },
  562.     { rule = { class = "Licq" },
  563.      properties = { tag = tags[1][2] } },
  564.     { rule = { class = "mplayer2" },
  565.      properties = { tag = tags[1][4] } },
  566.     { rule = { class = "Aumix" },
  567.     properties = { floating = true } },
  568.     { rule = { class = "Xev" },
  569.     properties = { floating = true } },
  570.     { rule = { class = "Lxtask" },
  571.     properties = { floating = true } },
  572.     { rule = { class = "Terminator" },
  573.     properties = { floating = false } },
  574. }
  575. -- }}}
  576.  
  577. -- {{{ Signals
  578. -- Signal function to execute when a new client appears.
  579. client.add_signal("manage", function (c, startup)
  580.     -- Add a titlebar
  581.     -- awful.titlebar.add(c, { modkey = modkey })
  582.  
  583.  
  584.     -- Enable sloppy focus
  585.     c:add_signal("mouse::click", function(c)
  586.         if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
  587.             and awful.client.focus.filter(c) then
  588.             client.focus = c
  589.         end
  590.     end)
  591.  
  592.     if not startup then
  593.         -- Set the windows at the slave,
  594.         -- i.e. put it at the end of others instead of setting it master.
  595.         -- awful.client.setslave(c)
  596.  
  597.         -- Put windows in a smart way, only if they does not set an initial position.
  598.         if not c.size_hints.user_position and not c.size_hints.program_position then
  599.             awful.placement.no_overlap(c)
  600.             awful.placement.no_offscreen(c)
  601. --          awful.placement.under_mouse(c)
  602.         end
  603.     end
  604. end)
  605. client.add_signal("focus", function(c) c.border_color = beautiful.border_focus end)
  606. client.add_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
  607. -- }}}
  608.  
  609. -- A U T O S T A R T --
  610. -- awful.util.spawn_with_shell("")
  611.  
  612.  
  613.  
  614. -- echo "dbpp.visible=true" | awesome-client
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement