Guest User

rc.lua

a guest
Jun 21st, 2015
604
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Standard awesome libraryq
  2. local gears = require("gears")
  3. local awful = require("awful")
  4. awful.rules = require("awful.rules")
  5. require("eminent")
  6. require("awful.autofocus")
  7. local wibox = require("wibox")
  8. local beautiful = require("beautiful")
  9. local naughty = require("naughty")
  10. local menubar = require("menubar")
  11. local vicious = require("vicious")
  12. --local lain = require("lain")
  13. --local vain = require("vain")
  14. local minitray = require("minitray")
  15. --local redflat = require("redflat")
  16.  
  17.  
  18. -- {{{ Error handling
  19. -- Check if awesome encountered an error during startup and fell back to
  20. -- another config (This code will only ever execute for the fallback config)
  21. if awesome.startup_errors then
  22.     naughty.notify({ preset = naughty.config.presets.critical,
  23.                      title = "Oops, there were errors during startup!",
  24.                      text = awesome.startup_errors })
  25. end
  26.  
  27. -- Handle runtime errors after startup
  28. do
  29.     local in_error = false
  30.     awesome.connect_signal("debug::error", function (err)
  31.         -- Make sure we don't go into an endless error loop
  32.         if in_error then return end
  33.         in_error = true
  34.  
  35.         naughty.notify({ preset = naughty.config.presets.critical,
  36.                          title = "Oops, an error happened!",
  37.                          text = err })
  38.         in_error = false
  39.     end)
  40. end
  41. -- }}}
  42.  
  43. -- {{{ Variable definitions
  44. beautiful.init("~/.config/awesome/themes/powerarrow-darker/theme.lua")
  45.  
  46. rofi = "/home/user/.config/awesome/rofi.sh"
  47. terminal = "terminator  --geometry=855x480"
  48. editor = os.getenv("EDITOR") or "subl3"
  49. editor_cmd = terminal .. " -e " .. editor
  50. fm = 'pcmanfm'
  51. browser = "bash -c \"GTK2_RC_FILES=/home/user/.themes/gtkrc-light firefox\" "
  52. quit = "bash -c \"GTK2_RC_FILES=/home/user/.themes/gtkrc-light obshutdown\" "
  53.  
  54. modkey = "Mod4"
  55.  
  56. -- Table of layouts to cover with awful.layout.inc, order matters.
  57. local layouts =
  58. {
  59.     awful.layout.suit.floating,
  60.     awful.layout.suit.tile,
  61.     --lain.layout.uselesspiral,
  62.     --redflat.layout.map,
  63.     awful.layout.suit.tile.left,
  64.     --awful.layout.suit.tile.bottom,
  65.     --awful.layout.suit.tile.top,
  66.     awful.layout.suit.fair,
  67.     --vain.layout.uselessfair,
  68.     --awful.layout.suit.fair.horizontal,
  69.     --awful.layout.suit.spiral,
  70.     --awful.layout.suit.spiral.dwindle,
  71.     --awful.layout.suit.max,
  72.     --awful.layout.suit.max.fullscreen,
  73.     --awful.layout.suit.magnifier
  74. }
  75. -- }}}
  76.  
  77. -- {{{ Wallpaper
  78. if beautiful.wallpaper then
  79.     for s = 1, screen.count() do
  80.         gears.wallpaper.maximized(beautiful.wallpaper, s, true)
  81.     end
  82. end
  83. -- }}}
  84.  
  85. -- {{{ Tags
  86.  
  87. tags = {
  88.    names  = { "  火  ", "  水  ", "  土  ", "  天  "},
  89.    
  90.    layout = { layouts[1], layouts[2], layouts[3], layouts[4], }
  91. }
  92.  
  93. for s = 1, screen.count() do
  94.    tags[s] = awful.tag(tags.names, s, tags.layout)
  95. end
  96. -- }}}
  97.  
  98. -- {{{ Menu
  99. -- Create a laucher widget and a main menu
  100.  
  101. mymainmenu = awful.menu({ items = {
  102.                                     {"terminal", terminal },
  103.                                     {"web browser",browser},
  104.                                     {"file manager",fm},
  105.                                     {"editor", editor },
  106.                                     { "quit",quit},
  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. minitray.toggle ()
  118. minitray.toggle({ x = 1815,y = 1012, height = 30 })
  119. -- {{{ Wibox
  120. -- Create a textclock widget
  121. n_mytextclock = awful.widget.textclock( "<span font='Terminus Re33 Bold 15'>%H:%M:%S </span>", 1)
  122. mytextclock = wibox.layout.constraint(n_mytextclock, "exact", 100)
  123. n_mytextclock:set_align("center")
  124.  
  125. --Systray
  126.  
  127. tray = awful.widget.button ({image = "/home/user/.config/awesome/themes/powerarrow-darker/icons/warning.svg"
  128. })
  129. tray:buttons(awful.util.table.join (awful.button ({ }, 1, function() minitray.toggle() end ))
  130. )
  131.  
  132.  
  133. -- Keyboard layout widget
  134. kbdwidget = wibox.widget.textbox()
  135. kbdcolb = "<span font='Terminus Re33 Bold 15'> "
  136. kbdcole = "</span>"
  137. kbdwidget.border_width = 0
  138. kbdwidget.border_color = beautiful.fg_normal
  139. kbdwidget:set_markup(kbdcolb.." EN "..kbdcole)
  140. dbus.request_name("session", "ru.gentoo.kbdd")
  141. dbus.add_match("session", "interface='ru.gentoo.kbdd',member='layoutChanged'")
  142. dbus.connect_signal("ru.gentoo.kbdd", function(...)
  143. local data = {...}
  144. local layout = data[2]
  145. lts = {[0] = " EN", [1] = " RU"}
  146. kbdwidget:set_markup (kbdcolb..""..lts[layout].." "..kbdcole)
  147. end
  148. )
  149.  
  150.  
  151. --arrl_ld = wibox.widget.imagebox()
  152. --arrl_ld:set_image(beautiful.arrl_ld)
  153. arrl = wibox.widget.imagebox()
  154. arrl:set_image(beautiful.arrl)
  155. arrl_r = wibox.widget.imagebox()
  156. arrl_r:set_image(beautiful.arrl_r)
  157. space = wibox.widget.textbox()
  158. space:set_text(" ")
  159. separator = wibox.widget.textbox()
  160. separator:set_text ("")
  161. separator_l = wibox.widget.textbox()
  162. separator_l:set_text ("")
  163.  
  164. -- Дописать переключатель тегов
  165.  
  166. --arr_launcher = awful.widget.button ({image = beautiful.arrl_r})
  167. --arr_launcher:buttons(awful.util.table.join (awful.button ({ }, 1, function awful.tag.viewnext end))
  168.  
  169.  
  170. -- Memory
  171. memwidget = wibox.widget.textbox()
  172. vicious.register(memwidget, vicious.widgets.mem, "<span font='Terminess Powerline Bold 15'>$2MB/$3MB</span>", 1)
  173. fixedmemwidget = wibox.layout.constraint(memwidget, "exact", 147)
  174. memwidget:set_align("center")
  175. memicon = wibox.widget.imagebox(beautiful.widget_mem)
  176.  
  177. -- Create a wibox for each screen and add it
  178. mywibox = {}
  179. mypromptbox = {}
  180. mylayoutbox = {}
  181. mytaglist = {}
  182. mytaglist.buttons = awful.util.table.join(
  183.                     awful.button({ }, 1, awful.tag.viewonly)
  184.                     --awful.button({ modkey }, 1, awful.client.movetotag),
  185.                     --awful.button({ }, 3, awful.tag.viewtoggle),
  186.                     --awful.button({ modkey }, 3, awful.client.toggletag),
  187.                     --awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end),
  188.                     --awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end)
  189.                     )
  190. mytasklist = {}
  191. mytasklist.buttons = awful.util.table.join(
  192.                      awful.button({ }, 1, function (c)
  193.                                               if c == client.focus then
  194.                                                   c.minimized = true
  195.                                               else
  196.                                                   -- Without this, the following
  197.                                                   -- :isvisible() makes no sense
  198.                                                   c.minimized = false
  199.                                                   if not c:isvisible() then
  200.                                                       awful.tag.viewonly(c:tags()[1])
  201.                                                   end
  202.                                                   -- This will also un-minimize
  203.                                                   -- the client, if needed
  204.                                                   client.focus = c
  205.                                                   c:raise()
  206.                                               end
  207.                                           end),
  208.                      awful.button({ }, 3, function (c)
  209.                                               c:kill()
  210.                                               end)
  211.                      )
  212.  
  213. for s = 1, screen.count() do
  214.     -- Create a promptbox for each screen
  215.     mypromptbox[s] = awful.widget.prompt()
  216.     -- Create an imagebox widget which will contains an icon indicating which layout we're using.
  217.     -- We need one layoutbox per screen.
  218.     mylayoutbox[s] = awful.widget.layoutbox(s)
  219.     mylayoutbox[s]:buttons(awful.util.table.join(
  220.                            awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
  221.                            awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
  222.                            awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
  223.                            awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
  224.     -- Create a taglist widget
  225.     mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons)
  226.  
  227.     -- Create a tasklist widget
  228.     mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
  229.  
  230.     -- Create the wibox
  231.     mywibox[s] = awful.wibox({border_width = 2.5, border_color = beautiful.border_normal, position = "bottom", height = 27, screen = s })
  232.  
  233.     -- Widgets that are aligned to the left
  234.     local left_layout = wibox.layout.fixed.horizontal()
  235.     left_layout:add(mylauncher)
  236.     left_layout:add(space)
  237.     left_layout:add(arrl_r)
  238.     left_layout:add(space)
  239.     left_layout:add(mytaglist[s])
  240.     left_layout:add(arrl_r)
  241.     left_layout:add(separator_l)
  242.     left_layout:add(space)
  243.     left_layout:add(mypromptbox[s])
  244.  
  245.     -- Widgets that are aligned to the right
  246.     local right_layout = wibox.layout.fixed.horizontal()
  247.     --if s == 1 then right_layout:add(wibox.widget.systray()) end
  248.     right_layout:add(separator)
  249.     right_layout:add(arrl)
  250.     --right_layout:add(separator)
  251.     right_layout:add(kbdwidget)
  252.     right_layout:add(space)
  253.     right_layout:add(arrl)
  254.     --right_layout:add(separator)
  255.     right_layout:add(memicon)
  256.     right_layout:add(fixedmemwidget)
  257.     right_layout:add(arrl)
  258.     --right_layout:add(separator)
  259.     right_layout:add(space)
  260.     --right_layout:add(fixedcpuwidget)
  261.     right_layout:add(mytextclock)
  262.     --right_layout:add(separator)
  263.     right_layout:add(arrl)
  264.     right_layout:add(space)
  265.     right_layout:add(tray)
  266.     right_layout:add(space)
  267.     --right_layout:add(separator)
  268.     right_layout:add(arrl)
  269.     right_layout:add(space)
  270.     right_layout:add(mylayoutbox[s])
  271.     right_layout:add(space)
  272.  
  273.     -- Now bring it all together (with the tasklist in the middle)
  274.     local layout = wibox.layout.align.horizontal()
  275.     layout:set_left(left_layout)
  276.     layout:set_middle(mytasklist[s])
  277.     layout:set_right(right_layout)
  278.  
  279.     mywibox[s]:set_widget(layout)
  280. end
  281. -- }}}
  282.  
  283. -- {{{ Mouse bindings
  284. root.buttons(awful.util.table.join(
  285.     awful.button({ }, 1, function () mymainmenu:hide() end),
  286.     awful.button({ }, 3, function () mymainmenu:toggle() end)
  287.     --awful.button({ }, 4, awful.tag.viewnext),
  288.     --awful.button({ }, 5, awful.tag.viewprev)
  289. ))
  290. -- }}}
  291.  
  292. -- {{{ Key bindings
  293. globalkeys = awful.util.table.join(
  294.  
  295.     --awful.key({ modkey,           }, "Left",   awful.tag.viewprev       ),
  296.     --awful.key({ modkey,           }, "Right",  awful.tag.viewnext       ),
  297.     awful.key({ modkey,           }, "Escape", awful.tag.history.restore),
  298.  
  299.    awful.key({ modkey  }, "Tab", function()
  300.              local tag = awful.tag.selected()
  301.              for i=1, #tag:clients() do
  302.                 tag:clients()[i].minimized=false end
  303.              awful.client.focus.byidx(1) if client.focus then client.focus:raise() end end),
  304.  
  305.     awful.key({ modkey,           }, "j",
  306.         function ()
  307.             awful.client.focus.byidx( 1)
  308.             if client.focus then client.focus:raise() end
  309.         end),
  310.     awful.key({ modkey,           }, "k",
  311.         function ()
  312.             awful.client.focus.byidx(-1)
  313.             if client.focus then client.focus:raise() end
  314.         end),
  315.     awful.key({ modkey,           }, "w", function () mymainmenu:toggle() end),
  316.  
  317.     -- Layout manipulation
  318.     awful.key({ modkey, "Shift"   }, "j", function () awful.client.swap.byidx(  1)    end),
  319.     awful.key({ modkey, "Shift"   }, "k", function () awful.client.swap.byidx( -1)    end),
  320.     awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end),
  321.     awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end),
  322.     awful.key({ modkey,           }, "u", awful.client.urgent.jumpto),
  323.     awful.key({ modkey, "Shift" }, "Tab",
  324.         function ()
  325.             awful.client.focus.history.previous()
  326.             if client.focus then
  327.                 client.focus:raise()
  328.             end
  329.         end),
  330.  
  331.  
  332.     -- Standard program
  333.     awful.key({ modkey,           }, "t", function () awful.util.spawn(terminal) end),
  334.     awful.key({ modkey,           }, "e", function () awful.util.spawn(editor)   end),
  335.     awful.key({ modkey,           }, "i", function () awful.util.spawn(browser) end),
  336.     awful.key({ modkey            }, "f", function () awful.util.spawn(fm) end),
  337.     awful.key({                   }, "Print", function () awful.util.spawn("scrot '%Y-%m-%d_%H:%M:%S.png' -e 'mv $f ~/Изображения/scr/ 2>/dev/null'") end),
  338.     awful.key({ modkey, "Control" }, "r", awesome.restart),
  339.     --awful.key({ modkey, "Shift"   }, "q", awesome.quit),
  340.     awful.key({ modkey,           }, "l",        function () awful.tag.incmwfact( 0.05)    end),
  341.     awful.key({ modkey,           }, "h",        function () awful.tag.incmwfact(-0.05)    end),
  342.     awful.key({ modkey, "Shift"   }, "h",        function () awful.tag.incnmaster( 1)      end),
  343.     awful.key({ modkey, "Control" }, "h",        function () awful.tag.incncol( 1)         end),
  344.     awful.key({ modkey, "Shift"   }, "l",        function () awful.tag.incnmaster(-1)      end),
  345.     awful.key({ modkey, "Control" }, "l",        function () awful.tag.incncol(-1)         end),
  346.     awful.key({ modkey,           }, "space", function () awful.layout.inc(layouts,  1) end),
  347.     awful.key({ modkey, "Shift"   }, "space", function () awful.layout.inc(layouts, -1) end),
  348.  
  349.     awful.key({ modkey, "Control" }, "n", awful.client.restore),
  350.     -- Prompt
  351.     --awful.key({ modkey },            "r",     function () mypromptbox[mouse.screen]:run() end),
  352.     awful.key({ modkey            }, "r",      function () awful.util.spawn(rofi)           end),
  353.     -- Menubar
  354.  
  355.     awful.key({ modkey }, "p", function() menubar.show() end)
  356. )
  357.  
  358. clientkeys = awful.util.table.join(
  359.     awful.key({ modkey }, "Next",  function ()  awful.client.moveresize( 20,  20, -40, -40) end),
  360.     awful.key({ modkey }, "Prior", function () awful.client.moveresize(-20, -20,  40,  40) end),
  361.     awful.key({ modkey }, "Down",  function () awful.client.moveresize(  0,  20,   0,   0) end),
  362.     awful.key({ modkey }, "Up",    function () awful.client.moveresize(  0, -20,   0,   0) end),
  363.     awful.key({ modkey }, "Left",  function () awful.client.moveresize(-20,   0,   0,   0) end),
  364.     awful.key({ modkey }, "Right", function () awful.client.moveresize( 20,   0,   0,   0) end),
  365.     awful.key({ modkey, "Shift"  }, "f",      function (c) c.fullscreen = not c.fullscreen  end),
  366.     awful.key({ modkey, "Shift"   }, "c",      function (c) c:kill()                         end),
  367.     awful.key({ modkey, "Control" }, "space",  awful.client.floating.toggle                     ),
  368.     awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
  369.     awful.key({ modkey,           }, "o",      awful.client.movetoscreen                        ),
  370.     --awful.key({ modkey,           }, "t",      function (c) c.ontop = not c.ontop            end),
  371.     awful.key({ modkey,           }, "n",
  372.         function (c)
  373.             -- The client currently has the input focus, so it cannot be
  374.             -- minimized, since minimized clients can't have the focus.
  375.             c.minimized = true
  376.         end),
  377.     awful.key({ modkey,           }, "m",
  378.         function (c)
  379.             c.maximized_horizontal = not c.maximized_horizontal
  380.             c.maximized_vertical   = not c.maximized_vertical
  381.         end)
  382. )
  383.  
  384. -- Bind all key numbers to tags.
  385. -- Be careful: we use keycodes to make it works on any keyboard layout.
  386. -- This should map on the top row of your keyboard, usually 1 to 9.
  387. for i = 1, 9 do
  388.     globalkeys = awful.util.table.join(globalkeys,
  389.         -- View tag only.
  390.         awful.key({ modkey }, "#" .. i + 9,
  391.                   function ()
  392.                         local screen = mouse.screen
  393.                         local tag = awful.tag.gettags(screen)[i]
  394.                         if tag then
  395.                            awful.tag.viewonly(tag)
  396.                         end
  397.                   end),
  398.         -- Toggle tag.
  399.         awful.key({ modkey, "Control" }, "#" .. i + 9,
  400.                   function ()
  401.                       local screen = mouse.screen
  402.                       local tag = awful.tag.gettags(screen)[i]
  403.                       if tag then
  404.                          awful.tag.viewtoggle(tag)
  405.                       end
  406.                   end),
  407.         -- Move client to tag.
  408.         awful.key({ modkey, "Shift" }, "#" .. i + 9,
  409.                   function ()
  410.                       if client.focus then
  411.                           local tag = awful.tag.gettags(client.focus.screen)[i]
  412.                           if tag then
  413.                               awful.client.movetotag(tag)
  414.                           end
  415.                      end
  416.                   end),
  417.         -- Toggle tag.
  418.         awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
  419.                   function ()
  420.                       if client.focus then
  421.                           local tag = awful.tag.gettags(client.focus.screen)[i]
  422.                           if tag then
  423.                               awful.client.toggletag(tag)
  424.                           end
  425.                       end
  426.                   end))
  427. end
  428.  
  429. clientbuttons = awful.util.table.join(
  430.     awful.button({ }, 1, function () mymainmenu:hide() end),
  431.     awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
  432.     awful.button({ modkey }, 1, awful.mouse.client.move),
  433.     awful.button({ }, 3, function () mymainmenu:hide() end),
  434.     awful.button({ modkey }, 3, awful.mouse.client.resize)),
  435.    
  436.  
  437. -- Set keys
  438. root.keys(globalkeys)
  439. -- }}}
  440.  
  441. -- {{{ Rules
  442. -- Rules to apply to new clients (through the "manage" signal).
  443. awful.rules.rules = {
  444.     -- All clients will match this rule.
  445.     { rule = { },
  446.       properties = { border_width = beautiful.border_width,
  447.                      border_color = beautiful.border_normal,
  448.                      focus = awful.client.focus.filter,
  449.                      raise = true,
  450.                      keys = clientkeys,
  451.                      buttons = clientbuttons } },
  452.     { rule = { class = "MPlayer" },
  453.       properties = { floating = true } },
  454.     { rule = { class = "Galculator" },
  455.       properties = { floating = true } },
  456.     { rule = {class = "Obshutdown"},
  457.      properties = {fullscreen = true,}},
  458.     { rule = { class = "pinentry" },
  459.       properties = { floating = true } },
  460.     { rule = { instance = "plugin-container" },
  461.       properties = { floating = true } },
  462.     { rule = { class = "Pcmanfm" },
  463.     properties = {
  464.         width = 1125,
  465.         height = 600
  466.     } },
  467.     { rule = { class = "Pcmanfm" , type = "dialog" },
  468.     properties = {
  469.         width = 300,
  470.         height = 20
  471.     } },
  472.  
  473. }
  474. -- }}}
  475.  
  476. -- {{{ Signals
  477. -- Signal function to execute when a new client appears.
  478. client.connect_signal("manage", function (c, startup)
  479.     -- Enable sloppy focus
  480. --    c:connect_signal("mouse::enter", function(c)
  481. --       if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
  482. --            and awful.client.focus.filter(c) then
  483. --            client.focus = c
  484. --        end
  485. --    end)
  486.  
  487.     --if not startup then
  488.         -- Set the windows at the slave,
  489.         -- i.e. put it at the end of others instead of setting it master.
  490.         -- awful.client.setslave(c)
  491.         if not c.maximized then awful.placement.centered(c) end
  492.      --       awful.placement.no_offscreen(c)
  493.      --   end
  494.    -- end
  495.  
  496.     local titlebars_enabled = false
  497.     if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then
  498.         -- buttons for the titlebar
  499.         local buttons = awful.util.table.join(
  500.                 awful.button({ }, 1, function()
  501.                     client.focus = c
  502.                     c:raise()
  503.                     awful.mouse.client.move(c)
  504.                 end),
  505.                 awful.button({ }, 3, function()
  506.                     client.focus = c
  507.                     c:raise()
  508.                     awful.mouse.client.resize(c)
  509.                 end)
  510.                 )
  511.         -- Widgets that are aligned to the left
  512.         local left_layout = wibox.layout.fixed.horizontal()
  513.         left_layout:add(awful.titlebar.widget.iconwidget(c))
  514.         left_layout:buttons(buttons)
  515.  
  516.         -- Widgets that are aligned to the right
  517.         local right_layout = wibox.layout.fixed.horizontal()
  518.         right_layout:add(awful.titlebar.widget.floatingbutton(c))
  519.         right_layout:add(awful.titlebar.widget.maximizedbutton(c))
  520.         right_layout:add(awful.titlebar.widget.stickybutton(c))
  521.         right_layout:add(awful.titlebar.widget.ontopbutton(c))
  522.         right_layout:add(awful.titlebar.widget.closebutton(c))
  523.  
  524.         -- The title goes in the middle
  525.         local middle_layout = wibox.layout.flex.horizontal()
  526.         local title = awful.titlebar.widget.titlewidget(c)
  527.         title:set_align("center")
  528.         middle_layout:add(title)
  529.         middle_layout:buttons(buttons)
  530.  
  531.         -- Now bring it all together
  532.         local layout = wibox.layout.align.horizontal()
  533.         layout:set_left(left_layout)
  534.         layout:set_right(right_layout)
  535.         layout:set_middle(middle_layout)
  536.  
  537.         awful.titlebar(c):set_widget(layout)
  538.     end
  539. end)
  540.  
  541. client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
  542. client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
  543. -- }}}
  544.  
  545. --{{{
  546.  
  547. function run_once(cmd)
  548.     findme = cmd
  549.     firstspace = cmd:find(" ")
  550.     if firstspace then
  551.         findme = cmd:sub(0, firstspace-1)
  552.     end
  553.     awful.util.spawn_with_shell("pgrep -u $USER -x " .. findme .. " > /dev/null || (" .. cmd .. ")")
  554. end
  555.  
  556. run_once ("setxkbmap -layout 'us,ru' -option 'grp:alt_shift_toggle' ")
  557. run_once ("kbdd &")
  558. run_once ("compton --config ~/.config/compton/config -b &")
  559. run_once ("conky")
  560.  
  561. -- }}}
RAW Paste Data