Advertisement
Guest User

rc-шка

a guest
Dec 12th, 2013
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 95.04 KB | None | 0 0
  1.     local gears = require("gears")
  2.     local awful = require("awful")
  3.     awful.rules = require("awful.rules")
  4.     require("awful.autofocus")
  5.     local wibox = require("wibox")
  6.     local beautiful = require("beautiful")
  7.     local naughty = require("naughty")
  8.     local vicious = require("vicious")
  9.     local docklist = require("docklist")
  10.     local docktag = require("docktag")
  11.     local lgi = require("lgi")
  12.     local nw_wdgt = require("nw_wdgt")
  13.     local scheduler = require('scheduler')
  14.     local cairo = lgi.cairo
  15.     local capi      =   {
  16.                             screen = screen
  17.                         }
  18.     local scrgeom   =   capi.screen[1].geometry
  19. --]]------------------------------------------------------------------------------
  20.     uh    =   os.getenv("HOME")
  21.     uhaw  =   uh.."/.config/awesome"
  22.  
  23.     terminal1       =   "/usr/bin/urxvt -g 160x48+10+30 "
  24.     terminal2       =   "/usr/bin/xterm -g 140x42+510+230 "
  25.     terminal3       =   "/usr/bin/xterm -name 'ppp_up_modem' -g 190x54+10+30 "
  26.     top_dmenu       =   "dmenu_run -nb '#000000' -nf '#888888' -sb '#000000' -sf '#0090d0' -p "..
  27.                         " 'Run: ' -fn '-xos4-terminus-medium-r-normal-*-12-120-72-72-c-60-iso10646-1'"
  28.  
  29.     font_awesome    =   "Terminus 8";  -- основной
  30.     font_desk       =   "DigifaceWide";
  31.  
  32.     font_tooltip    =   "Terminus 10";
  33.  
  34.     modkey = "Mod4"
  35. --]]------------------------------------------------------------------------------
  36.     beautiful.init(uhaw.."/theme.lua")
  37. --]]------------------------------------------------------------------------------
  38.     if awesome.startup_errors then
  39.         naughty.notify(
  40.                         {
  41.                             font   = font_awesome,
  42.                             preset = naughty.config.presets.critical,
  43.                             title  = "Ошибка на старте!",
  44.                             text   = awesome.startup_errors
  45. --                            timeout = 10
  46.                         }
  47.                       )
  48.     end
  49. --]]------------------------------------------------------------------------------
  50.     do
  51.         local in_error = false
  52.         awesome.connect_signal("debug::error", function (err)
  53.             if in_error then return end
  54.             in_error = true
  55.  
  56.             naughty.notify(
  57.                             {
  58.                                 font   = font_awesome,
  59.                                 preset = naughty.config.presets.critical,
  60.                                 title  = "Ошибка времени исполнения!",
  61.                                 text   = err
  62. --                                timeout = 10
  63.                             }
  64.                           )
  65.             in_error = false
  66.         end)
  67.     end
  68. --]]------------------------------------------------------------------------------
  69.     local layouts =
  70.     {
  71.         awful.layout.suit.max,
  72.         awful.layout.suit.floating,
  73.         awful.layout.suit.tile.right,
  74.         awful.layout.suit.tile.bottom
  75.     }
  76. --]]------------------------------------------------------------------------------
  77.     if (beautiful.wallpaper1) then
  78.         gears.wallpaper.maximized(beautiful.wallpaper1, 1, false)
  79.     end
  80.     if (beautiful.wallpaper2) and (screen.count() == 2) then
  81.         gears.wallpaper.maximized(beautiful.wallpaper2, 2, false)
  82.     end
  83. --]]------------------------------------------------------------------------------
  84.  
  85.     local   tags0   =   {
  86.                         names   =   {   "~",        "1",        "2",        "3",        "4",        "5",        "6",        "7",        "8",        "9",        "0",        "-"      },
  87.                         layout  =   {   layouts[3], layouts[3], layouts[3], layouts[3], layouts[3], layouts[3], layouts[3], layouts[1], layouts[1], layouts[1], layouts[1], layouts[3] },
  88.                         keynum  =   {   "49",       "10",       "11",       "12",       "13",       "14",       "15",       "16",       "17",       "18",       "19",       "20"       }
  89.                         }
  90.     local   tags1   =   {
  91.                         names   =   {   "+"        },
  92.                         layout  =   {   layouts[3] },
  93.                         keynum  =   {   "21"       }
  94.                         }
  95.  
  96.     local   tags    =   {}
  97.  
  98.     local   tags2   =   {}
  99. --]]------------------------------------------------------------------------------
  100.     tags  = awful.tag(tags0.names, 1, tags0.layout)
  101.     if screen.count() == 2 then
  102.         tags2 = awful.tag(tags1.names, 2, tags1.layout)
  103.     end
  104. --]]------------------------------------------------------------------------------
  105. --------------------------------------------------------------------------------
  106.     function wt( tx, wdt, s )
  107.         local w = string.len(tx)
  108.         if s == 0 then
  109.             tx = string.rep(" ", wdt-w)..tx
  110.         else
  111.             tx = tx..string.rep(" ", wdt-w)
  112.         end
  113.         return tx
  114.     end
  115. --]]------------------------------------------------------------------------------
  116. --------------------------------------------------------------------------------
  117.     function dec_col(c)
  118.     -- функция декодировки цвета -----------------------------------------------
  119.         return ((c / 0x1000000) % 0x100) / 255., ((c / 0x10000) % 0x100) / 255., ((c / 0x100) % 0x100) / 255., (c % 0x100) / 255.
  120.     end
  121. --]]------------------------------------------------------------------------------
  122. --------------------------------------------------------------------------------
  123.     n_cpu       =   2
  124.     gr_cpu      =   {}
  125.     for i = 1,n_cpu do
  126.         gr_cpu[i] = awful.widget.graph()
  127.         gr_cpu[i]:set_stack(true):set_max_value(100)
  128.         gr_cpu[i]:set_background_color(beautiful.graph)
  129.         gr_cpu[i]:set_stack_colors({beautiful.prbgrptop})
  130.     end
  131.     tx_cpu      =   wibox.widget.textbox()
  132.     tx_cpu:set_align("center")
  133. --]]------------------------------------------------------------------------------
  134. --------------------------------------------------------------------------------
  135.     gr_mem      = awful.widget.graph()
  136.     gr_mem:set_stack(true):set_max_value(100):set_scale(false)
  137.     gr_mem:set_background_color(beautiful.graph)
  138.     gr_mem:set_stack_colors({"#ffffff","#005090","#5090d0"})
  139.     tx_mem      =   wibox.widget.textbox()
  140.     tx_mem:set_align("center")
  141. --]]------------------------------------------------------------------------------
  142. --------------------------------------------------------------------------------
  143.     n_dev       =   { "sda5", "sda6", "sda7", "sda8", "sda9" }
  144.     gr_dio      =   {}
  145.     for i in pairs(n_dev) do
  146.         gr_dio[i]   =   awful.widget.graph()
  147.         gr_dio[i]:set_stack(true):set_scale(true)
  148.         gr_dio[i]:set_background_color(beautiful.graph)
  149.         gr_dio[i]:set_stack_colors({ "#5090d0", "#005090"})
  150.     end
  151.     tx_dio      =   wibox.widget.textbox()
  152.     tx_dio:set_align("center")
  153. --]]------------------------------------------------------------------------------
  154. --[[------------------------------------------------------------------------------
  155.     n_net       =   { "enp2s0f0", "wlp3s0", "ppp0" }
  156.     gr_nio      =   {}
  157.     for i in pairs(n_dev) do
  158.         gr_nio[i]   =   awful.widget.graph()
  159.         gr_nio[i]:set_stack(true):set_scale(true)
  160.         gr_nio[i]:set_background_color(beautiful.graph)
  161.         gr_nio[i]:set_stack_colors({ "#5090d0", "#005090"})
  162.     end
  163.     tx_nio      =   wibox.widget.textbox()
  164.     tx_nio:set_align("center")
  165. --]]------------------------------------------------------------------------------
  166. --------------------------------------------------------------------------------
  167.     scheduler.register_recurring("updt_cpu", 2.5,
  168.                                     function ()
  169.                                         local cu  = get_cpu_usage()
  170.                                         local ct  = get_cpu_temp()
  171.                                         for i = 1,n_cpu do
  172.                                             gr_cpu[i]:add_value(cu[i+1],1)
  173.                                         end
  174.                                         tx_cpu:set_markup('<span font="'..font_awesome..'" color="'..beautiful.lwh..'">'.."C1:" .. wt(cu[2].."%", 4, 0) .. "/" .. wt(ct[2].."°", 4, 0).." "..
  175.                                                                                                                           "C2:" .. wt(cu[3].."%", 4, 0) .. "/" .. wt(ct[3].."°", 4, 0)..'</span>')
  176.                                     end
  177.                                 )
  178.     scheduler.register_recurring("updt_dio", 2,
  179.                                     function ()
  180.                                         local hs  = get_hddtemp_sda()
  181.                                         local dio = get_disk_dio()
  182.                                         for i in pairs(n_dev) do
  183.                                             gr_dio[i]:add_value(dio["{"..n_dev[i].." read_mb}"],  2)
  184.                                             gr_dio[i]:add_value(dio["{"..n_dev[i].." write_mb}"], 1)
  185.                                         end
  186.                                         tx_dio:set_markup('<span font="'..font_awesome..'" color="'..beautiful.lwh..'"> HDD t°C : ' .. hs[1] .. '° </span>')
  187.                                     end
  188.                                 )
  189.     scheduler.register_recurring("updt_mem", 4,
  190.                                     function ()
  191.                                         local mm  = get_mem_used()
  192.                                         gr_mem:add_value(mm[13],3)
  193.                                         gr_mem:add_value(mm[11],2)
  194.                                         gr_mem:add_value(mm[1],1)
  195.                                         tx_mem:set_markup('<span font="'..font_awesome..'" color="'..beautiful.lwh..'">MU: ' .. wt(mm[2],  5, 0) .. "M  " ..
  196.                                                                                                                       "SW: " .. wt(mm[6],  5, 0) .. "M\n" ..
  197.                                                                                                                       "MB: " .. wt(mm[10], 5, 0) .. "M  " ..
  198.                                                                                                                       "MC: " .. wt(mm[12], 5, 0) .. 'M</span>')
  199.                                     end
  200.                                 )
  201. --[[
  202.     scheduler.register_recurring("updt_nio", 1.5,
  203.                                     function ()
  204.                                         local nio = get_net_io()
  205.                                         for i in pairs(n_net) do
  206.                                             gr_nio[i]:add_value(nio["{"..n_net[i].." down_kb}"], 2)
  207.                                             gr_nio[i]:add_value(nio["{"..n_net[i].." up_kb}"],   1)
  208.                                         end
  209.                                         local outp = '<span font="'..font_awesome..'" color="'..beautiful.lwh..'">'..wt('Down | Up', 16, 0)..'\n'
  210.                                         for i in pairs(n_net) do
  211.                                             outp = outp .. wt(n_net[i], 8, 1)
  212.                                             if nio["{"..n_net[i].." carrier}"] == 1 then
  213.                                                 outp = outp ..  wt(nio["{"..n_net[i].." down_kb}"],   7, 0) .. ' | ' ..
  214.                                                                 wt(nio["{"..n_net[i].." up_kb}"], 6, 1) .. '\n'
  215.                                             else
  216.                                                 outp = outp ..  wt("-", 7, 0) .. ' | ' ..
  217.                                                                 wt("-", 6, 1) .. "\n"
  218.                                             end
  219.                                         end
  220.                                         local outp = outp .. '</span>'
  221.                                         tx_nio:set_markup(outp)
  222.                                     end
  223.                                 )
  224. --]]
  225.  
  226.     prgb_mpd =   awful.widget.progressbar()
  227.     prgb_mpd:set_border_color(beautiful.border_prgb)
  228.     prgb_mpd:set_background_color(beautiful.prgb)
  229.     prgb_mpd:set_color( beautiful.infom )
  230.     tx_mpd      =   wibox.widget.textbox()
  231.     tx_mpd:set_valign("center")
  232.     tx_tme      =   wibox.widget.textbox()
  233.     tx_tme:set_align("center")
  234.  
  235.     btn_mpd  =  {
  236.                     { img = wibox.widget.imagebox(uhaw.."/icons/buttons/prev.png" , false),  img_cmd = "mpc prev "},
  237.                     { img = wibox.widget.imagebox(uhaw.."/icons/buttons/play.png" , false),  img_cmd = "mpc play "},
  238.                     { img = wibox.widget.imagebox(uhaw.."/icons/buttons/pause.png", false),  img_cmd = "mpc pause "},
  239.                     { img = wibox.widget.imagebox(uhaw.."/icons/buttons/stop.png" , false),  img_cmd = "mpc stop "},
  240.                     { img = wibox.widget.imagebox(uhaw.."/icons/buttons/next.png" , false),  img_cmd = "mpc next "}
  241.                 }
  242.     stat_mpd =  {
  243. --                    { img = wibox.widget.imagebox(uhaw.."/icons/buttons/consume_off.png", false),  img_cmd = "mpc consume "},
  244.                     { img = wibox.widget.imagebox(uhaw.."/icons/buttons/random_off.png" , false),  img_cmd = "mpc random "},
  245.                     { img = wibox.widget.imagebox(uhaw.."/icons/buttons/repeat_off.png" , false),  img_cmd = "mpc repeat "},
  246.                     { img = wibox.widget.imagebox(uhaw.."/icons/buttons/single_off.png" , false),  img_cmd = "mpc single "},
  247.                 }
  248.  
  249.     scheduler.register_recurring("updt_mpd", 1,
  250.                                     function ()
  251.                                         local   function crop(str,i)
  252.                                                     if string.len(str) > i then
  253.                                                         return string.sub(str,1,i-2)..".."
  254.                                                     else
  255.                                                         return str
  256.                                                     end
  257.                                                 end
  258.                                         local   function tn(i)
  259.                                                     if string.len(i) == 1 then
  260.                                                         return "0" .. i
  261.                                                     else
  262.                                                         return i
  263.                                                     end
  264.                                                 end
  265.                                         local info = {}
  266.                                         local mpc = awful.util.pread('mpc -f "title: %title%\nartist: %artist%\nalbum: %album%\nduration: %time%"'):gsub("  ", "\n"):gsub("&", "")
  267.                                         info["progress"] = tonumber(string.match(mpc, "(%d+)%%"))
  268.                                         minutes = tonumber(string.match(mpc, "(%d+)%:%d%d%/"))
  269.                                         seconds = tonumber(string.match(mpc, "%:(%d+)%/"))
  270.                                         if  (( minutes ~= "" ) and ( minutes ~= nil )) and
  271.                                             (( seconds ~= "" ) and ( seconds ~= nil )) then
  272.                                             times = minutes .. ":" .. tn(seconds)
  273.                                         else
  274.                                             times = "0:00"
  275.                                         end
  276. --                                            naughty.notify({timeout = 0.5, font = font_awesome, title = "dbi", text =   tn(info1) .. ":"  .. tn(info2) })
  277.                                         for i, v in string.gmatch(mpc,"(%w+): ([^\n]+)") do
  278.                                             info[i]=v
  279.                                         end
  280.                                         prgb_mpd:set_max_value(100)
  281.                                         prgb_mpd:set_value(info["progress"])
  282.                                         local outp = '<span font="'..font_awesome..'" color="'..beautiful.lwh..'">'
  283.                                         if (info["title"] ~= "") and (info["title"] ~= nil) then
  284.                                             outp = outp .. crop(info["title"],50)
  285.                                         else
  286.                                             outp = outp .. "no title"
  287.                                         end
  288.                                         local outp = outp .. '\n'
  289.                                         local aa = ""
  290.                                         if (info["artist"] ~= "") and (info["artist"] ~= nil) then
  291.                                             aa = aa .. crop(info["artist"],50)
  292.                                         else
  293.                                             info["year"] = "no artist"
  294.                                             aa = aa .. "no artist"
  295.                                         end
  296.                                         local aa = aa .. ' - '
  297.                                         if (info["album"] ~= "") and (info["album"] ~= nil) then
  298.                                             aa = aa .. crop(info["album"],50)
  299.                                         else
  300.                                             info["year"] = "no album"
  301.                                             aa = aa .. "no album"
  302.                                         end
  303.                                         if string.len(aa) > 60 then
  304.                                             outp = outp .. crop(info["artist"],25) .. ' - ' .. crop(info["album"],25)
  305.                                         else
  306.                                             outp = outp .. aa
  307.                                         end
  308.                                         local outp = outp .. '\n'
  309.  
  310.                                         tx_mpd:set_markup(outp .. '</span>')
  311.                                         if (info["duration"] ~= "") and (info["duration"] ~= nil) then
  312.                                             tx_tme:set_markup('<span font="'..font_awesome..'" color="'..beautiful.lwh..'">'..times.."/"..info["duration"]..'</span>')
  313.                                         else
  314.                                             tx_tme:set_markup("")
  315.                                         end
  316. --[[
  317.                                         if info["consume"] == "on" then
  318.                                             stat_mpd[1].img:set_image(uhaw.."/icons/buttons/consume_on.png")
  319.                                             naughty.notify({timeout = 0.5, font = font_awesome, title = "dbi", text =   "xyi" })
  320.                                         elseif info["consume"] == "off" then
  321.                                             stat_mpd[1].img:set_image(uhaw.."/icons/buttons/consume_off.png")
  322.                                         end
  323. ]]
  324.                                         if info["random"] == "on" then
  325.                                             stat_mpd[1].img:set_image(uhaw.."/icons/buttons/random_on.png")
  326.                                         elseif info["random"] == "off" then
  327.                                             stat_mpd[1].img:set_image(uhaw.."/icons/buttons/random_off.png")
  328.                                         end
  329.  
  330.                                         if info["repeat"] == "on" then
  331.                                             stat_mpd[2].img:set_image(uhaw.."/icons/buttons/repeat_on.png")
  332.                                         elseif info["repeat"] == "off" then
  333.                                             stat_mpd[2].img:set_image(uhaw.."/icons/buttons/repeat_off.png")
  334.                                         end
  335.  
  336.                                         if info["single"] == "on" then
  337.                                             stat_mpd[3].img:set_image(uhaw.."/icons/buttons/single_on.png")
  338.                                         elseif info["single"] == "off" then
  339.                                             stat_mpd[3].img:set_image(uhaw.."/icons/buttons/single_off.png")
  340.                                         end
  341.  
  342. --                                        prgb_db:set_value(math.floor(dbi["e"]/dbi["l"]*100))
  343. --                                        naughty.notify({timeout = 0.5, font = font_awesome, title = "dbi", text =   info["progress"] })
  344.                                     end
  345.                                 )
  346. --]]------------------------------------------------------------------------------
  347. --------------------------------------------------------------------------------
  348.     btn_scr =   {
  349.                     { img = wibox.widget.imagebox(uhaw.."/icons/screen/LVDS-only.png"   , false), img_cmd=terminal2.." -e bash "..uhaw.."/script/ch_md_scr LVDS-only"   },
  350.                     { img = wibox.widget.imagebox(uhaw.."/icons/screen/LVDS+VH.png"     , false), img_cmd=terminal2.." -e bash "..uhaw.."/script/ch_md_scr LVDS+VH"     },
  351.                     { img = wibox.widget.imagebox(uhaw.."/icons/screen/LVDS+VH-cp.png"  , false), img_cmd=terminal2.." -e bash "..uhaw.."/script/ch_md_scr LVDS+VH-cp"  },
  352.                     { img = wibox.widget.imagebox(uhaw.."/icons/screen/LVDS-off.png"    , false), img_cmd=terminal2.." -e bash "..uhaw.."/script/ch_md_scr LVDS-off"    },
  353.                     { img = wibox.widget.imagebox(uhaw.."/icons/screen/LVDS-off-cp.png" , false), img_cmd=terminal2.." -e bash "..uhaw.."/script/ch_md_scr LVDS-off-cp" }
  354.                 }
  355.  
  356. --]]------------------------------------------------------------------------------
  357. --------------------------------------------------------------------------------
  358.     local tlayoutbox    = awful.widget.layoutbox(1)
  359.  
  360.     local ttaglist      = awful.widget.taglist(1, awful.widget.taglist.filter.all, nil, {font = "Terminus 8"}, docktag.update, wibox.layout.fixed.horizontal())
  361.  
  362.     local ttasklist     = awful.widget.tasklist(1, awful.widget.tasklist.filter.currenttags, nil, {font = "Terminus 8"}, docklist.update, wibox.layout.fixed.horizontal())
  363. --]]------------------------------------------------------------------------------
  364. --------------------------------------------------------------------------------
  365.     local tib = wibox.widget.imagebox(beautiful.ib)
  366. --------------------------------------------------------------------------------
  367.     local tie = wibox.widget.imagebox(beautiful.ie)
  368. --------------------------------------------------------------------------------
  369.     local tieb = wibox.widget.imagebox(beautiful.ieb)
  370. --]]------------------------------------------------------------------------------
  371. --------------------------------------------------------------------------------
  372.     local bwibox  = awful.wibox({ position = "bottom", screen = 1, height = 18, opacity = 1.00, bg = beautiful.grdbg })
  373. --    lwibox[1].visible = false
  374.  
  375.     local top_layout = wibox.layout.fixed.horizontal()
  376.     top_layout:add(tieb)
  377.     top_layout:add(tlayoutbox)
  378.     top_layout:add(tie)
  379.     top_layout:add(ttaglist)
  380.     top_layout:add(tib)
  381.     top_layout:add(ttasklist)
  382.     local bot_layout = wibox.layout.fixed.horizontal()
  383.     bot_layout:add(tieb)
  384. --    local cpud = nw_wdgt.cpu()
  385. --    bot_layout:add(cpud)
  386. --    bot_layout:add()
  387. --    bot_layout:add(tieb)
  388. --    bot_layout:add(tieb)
  389. --    bot_layout:add(tprgb_htemp)
  390. --    bot_layout:add(thtemp)
  391. --    bot_layout:add(tieb)
  392. --    bot_layout:add(tctemp)
  393. --    bot_layout:add(tieb)
  394. --    bot_layout:add(tcpu)
  395. --    bot_layout:add(tieb)
  396. --    for i = 1,n_cpu do
  397. --        bot_layout:add(tprgb_temp[i])
  398. --    end
  399. --    bot_layout:add(tieb)
  400. --    for i = 1,n_cpu do
  401. --        bot_layout:add(tprgb_cpu[i])
  402. --    end
  403.     bot_layout:add(wibox.widget.systray())
  404.     bot_layout:add(tieb)
  405.  
  406.     local llayout = wibox.layout.align.horizontal()
  407.     llayout:set_left(top_layout)
  408. --    llayout:set_middle(ttasklist)
  409.     llayout:set_right(bot_layout)
  410.  
  411.     bwibox:set_widget(llayout)
  412. --]]------------------------------------------------------------------------------
  413. --------------------------------------------------------------------------------
  414. --    local wb_lb_lay = wibox.layout.xyi.new()                                                                                                    -- создание хуй-лайаута
  415. --    wb_lb_lay:add(wgr_time,{x=0,y=0,width=wbox_all.width,height=wbox_all.height})                                                               -- добавляем в лайаут векторный фон
  416. --[[                                                                                                                                                --
  417.     local wb_lb_btn_panel = wibox.layout.flex.horizontal()                                                                                      -- создание флекс-лайаута для кнопок управления мясом
  418.     local wb_lb_btn =   {                                                                                                                       --
  419.                         { icon=uhaw.."/icons/buttons/prev_msc.png",   cmd="deadbeef --prev > /dev/null"},                                       -- пред
  420.                         { icon=uhaw.."/icons/buttons/play_msc.png",   cmd="deadbeef --play > /dev/null"},                                       -- играть
  421.                         { icon=uhaw.."/icons/buttons/pause_msc.png",  cmd="deadbeef --pause > /dev/null"},                                      -- пауза
  422.                         { icon=uhaw.."/icons/buttons/stop_msc.png",   cmd="deadbeef --stop > /dev/null"},                                       -- стоп
  423.                         { icon=uhaw.."/icons/buttons/next_msc.png",   cmd="deadbeef --next > /dev/null"}                                        -- след
  424.                         }                                                                                                                       --
  425.                                                                                                                                                 --
  426.     for i in pairs(wb_lb_btn) do                                                                                                                --
  427.         local wb_lb_btns = wibox.widget.imagebox(wb_lb_btn[i].icon)                                                                             -- создание кнопки
  428.             wb_lb_btns:buttons( awful.util.table.join(                                                                                          -- назначение кнопоке события на левый клик мыши
  429.                                     awful.button(                                                                                               --
  430.                                         { }, 1, function () awful.util.spawn(wb_lb_btn[i].cmd) end)                                             --
  431.                                     )                                                                                                           --
  432.                               )                                                                                                                 --
  433.         wb_lb_btn_panel:add(wb_lb_btns)                                                                                                         -- добавляем в флекс-лайаут кнопки
  434.     end                                                                                                                                         --
  435.     wb_lb_lay:add(wb_lb_btn_panel,{ x = wbox_all.width  - 457 ,                                                                                 -- добавляем в хуй-лайайут флекс-лайаут
  436.                                     y = wbox_all.height - 18 - 35,                                                                              --
  437.                                     width  = 37*5,                                                                                              --
  438.                                     height = 36})                                                                                               --
  439. ]]                                                                                                                                                --
  440. --[[
  441.     local wb_lb_btn_panel = wibox.layout.flex.horizontal()                                                                                      -- создание флекс-лайаута для кнопок управления конфигурацией дислеев
  442.     local wb_lb_btn =   {                                                                                                                       --
  443.                         { icon=uhaw.."/icons/screen/LVDS-only.png",   cmd=terminal2.." -e bash "..uhaw.."/script/ch_md_scr LVDS-only"},         -- только ноут
  444.                         { icon=uhaw.."/icons/screen/LVDS+VH.png",     cmd=terminal2.." -e bash "..uhaw.."/script/ch_md_scr LVDS+VH"},           -- ноут+бол_экран
  445.                         { icon=uhaw.."/icons/screen/LVDS+VH-cp.png",  cmd=terminal2.." -e bash "..uhaw.."/script/ch_md_scr LVDS+VH-cp"},        -- ноут+бол_экран - копия
  446.                         { icon=uhaw.."/icons/screen/LVDS-off.png",    cmd=terminal2.." -e bash "..uhaw.."/script/ch_md_scr LVDS-off"},          -- только бол_экраны
  447.                         { icon=uhaw.."/icons/screen/LVDS-off-cp.png", cmd=terminal2.." -e bash "..uhaw.."/script/ch_md_scr LVDS-off-cp"}        -- только бол_экраны - копия
  448.                         }                                                                                                                       --
  449.                                                                                                                                                 --
  450.     for i in pairs(wb_lb_btn) do                                                                                                                --
  451.         local wb_lb_btns = wibox.widget.imagebox(wb_lb_btn[i].icon)                                                                             -- создание кнопки
  452.             wb_lb_btns:buttons( awful.util.table.join(                                                                                          -- назначение кнопоке события на левый клик мыши
  453.                                     awful.button(                                                                                               --
  454.                                         { }, 1, function () awful.util.spawn(wb_lb_btn[i].cmd) end)                                             --
  455.                                     )                                                                                                           --
  456.                               )                                                                                                                 --
  457.         wb_lb_btn_panel:add(wb_lb_btns)                                                                                                         -- добавляем в флекс-лайаут кнопки
  458.     end                                                                                                                                         --
  459.     wb_lb_lay:add(wb_lb_btn_panel,{ x = 245 - 5*30,                                                                                             -- добавляем в хуй-лайайут флекс-лайаут
  460.                                     y = 7,                                                                                                      --
  461.                                     width  = 5*30,                                                                                              --
  462.                                     height = 21})                                                                                               --
  463.                                                                                                                                                 --
  464.     wbox_all:set_widget(wb_lb_lay)                                                                                                              -- пихаем хуй-лайаут в большой вибокс
  465.                                                                                                                                                 --
  466. --]]------------------------------------------------------------------------------                                                              --
  467. --------------------------------------------------------------------------------
  468.     local cpu_on_xyi =   wibox(
  469.                             {
  470.                                 bg              =   "#111111",
  471.                                 height          =   70,
  472.                                 width           =   160,
  473.                                 opacity         =   0.9,
  474.                                 ontop           =   true,
  475.                                 visible         =   false
  476.                             }
  477.                          )
  478.     cpu_on_xyi:geometry(
  479.                         {
  480.                             x = scrgeom.x + (scrgeom.width  - cpu_on_xyi.width) - 5,
  481.                             y = scrgeom.y + (scrgeom.height - cpu_on_xyi.height - 18) - 5,
  482.                         }
  483.                       )
  484.  
  485.     cpu_on_xyi.screen    =   1
  486.  
  487.     local wb_lb_layout = wibox.layout.xyi.new()
  488.  
  489.     local h = (cpu_on_xyi.height-5*4)/2.5
  490.     local w = cpu_on_xyi.width-5*2
  491.  
  492.     for i = 1,n_cpu do
  493.         gr_cpu[i]:set_height(h)
  494.         gr_cpu[i]:set_width(w)
  495.         wb_lb_layout:add(gr_cpu[i],{    x = 5,
  496.                                         y = 5+(i-1)*(h+5),
  497.                                         width  = w,
  498.                                         height = h})
  499.     end
  500.     wb_lb_layout:add(tx_cpu,{   x = 5,
  501.                                 y = cpu_on_xyi.height-h*0.75,
  502.                                 width  = w,
  503.                                 height = cpu_on_xyi.height-5*4-h*2})
  504.  
  505.     local bc = wibox.widget.imagebox(beautiful.bc)
  506.     bc:buttons( awful.util.table.join(
  507.                     awful.button(
  508.                         { }, 1, function () cpu_on_xyi.visible = false end)
  509.                     )
  510.               )
  511.  
  512.     wb_lb_layout:add(bc,{   x = cpu_on_xyi.width - 10 - 2,
  513.                             y = 2,
  514.                             width  = 10,
  515.                             height = 10})
  516.  
  517.     cpu_on_xyi:set_widget(wb_lb_layout)
  518. --]]------------------------------------------------------------------------------
  519. --------------------------------------------------------------------------------
  520.     local mem_on_xyi =   wibox(
  521.                             {
  522.                                 bg              =   "#111111",
  523.                                 height          =   70,
  524.                                 width           =   cpu_on_xyi.width,
  525.                                 opacity         =   cpu_on_xyi.opacity,
  526.                                 ontop           =   true,
  527.                                 visible         =   false
  528.                             }
  529.                          )
  530.     mem_on_xyi:geometry(
  531.                         {
  532.                             x = scrgeom.x + (scrgeom.width  - cpu_on_xyi.width) - 5,
  533.                             y = cpu_on_xyi.y - mem_on_xyi.height - 5,
  534.                         }
  535.                       )
  536.  
  537.     mem_on_xyi.screen    =   1
  538.  
  539.     local wb_lb_layout = wibox.layout.xyi.new()
  540.  
  541.     local h = (mem_on_xyi.height-5*3)/1.8
  542.     local w = mem_on_xyi.width-5*2
  543.  
  544.     gr_mem:set_height(h)
  545.     gr_mem:set_width(w)
  546.     wb_lb_layout:add(gr_mem,{   x = 5,
  547.                                 y = 5,
  548.                                 width  = w,
  549.                                 height = h})
  550.     wb_lb_layout:add(tx_mem,{   x = 5,
  551.                                 y = 5*2+h,
  552.                                 width  = w,
  553.                                 height = mem_on_xyi.height - h - 5*3})
  554.  
  555.     local bc = wibox.widget.imagebox(beautiful.bc)
  556.     bc:buttons( awful.util.table.join(
  557.                     awful.button(
  558.                         { }, 1, function () mem_on_xyi.visible = false end)
  559.                     )
  560.               )
  561.  
  562.     wb_lb_layout:add(bc,{   x = mem_on_xyi.width - 10 - 2,
  563.                             y = 2,
  564.                             width  = 10,
  565.                             height = 10})
  566.  
  567.     mem_on_xyi:set_widget(wb_lb_layout)
  568.  
  569. --]]------------------------------------------------------------------------------
  570. --------------------------------------------------------------------------------
  571.     local dio_on_xyi =   wibox(
  572.                             {
  573.                                 bg              =   "#111111",
  574.                                 height          =   cpu_on_xyi.height + 5 + mem_on_xyi.height,
  575.                                 width           =   mem_on_xyi.width,
  576.                                 opacity         =   mem_on_xyi.opacity,
  577.                                 ontop           =   true,
  578.                                 visible         =   false
  579.                             }
  580.                          )
  581.     dio_on_xyi:geometry(
  582.                         {
  583. --                            x = cpu_on_xyi.x - 5 - dio_on_xyi.width,
  584.                             x = mem_on_xyi.x,
  585.                             y = mem_on_xyi.y - dio_on_xyi.height - 5,
  586.                         }
  587.                       )
  588.  
  589.     dio_on_xyi.screen    =   1
  590.  
  591.     local wb_lb_layout = wibox.layout.xyi.new()
  592.  
  593.     local h = (dio_on_xyi.height-5*8)/5.4
  594.     local w = dio_on_xyi.width-5*2
  595.  
  596.     for i in pairs(n_dev) do
  597.         gr_dio[i]:set_height(h)
  598.         gr_dio[i]:set_width(w)
  599.         wb_lb_layout:add(gr_dio[i],{    x = 5,
  600.                                         y = 5+(i-1)*(h+5),
  601.                                         width  = w,
  602.                                         height = h})
  603.     end
  604.     wb_lb_layout:add(tx_dio,{   x = 5,
  605.                                 y = dio_on_xyi.height - h*0.6 - 5,
  606.                                 width  = w,
  607.                                 height = h*0.6 })
  608.  
  609.     local bc = wibox.widget.imagebox(beautiful.bc)
  610.     bc:buttons( awful.util.table.join(
  611.                     awful.button(
  612.                         { }, 1, function () dio_on_xyi.visible = false end)
  613.                     )
  614.               )
  615.  
  616.     wb_lb_layout:add(bc,{   x = dio_on_xyi.width - 10 - 2,
  617.                             y = 2,
  618.                             width  = 10,
  619.                             height = 10})
  620.  
  621.     dio_on_xyi:set_widget(wb_lb_layout)
  622. --]]------------------------------------------------------------------------------
  623. --------------------------------------------------------------------------------
  624.     local mpd_on_xyi =   wibox(
  625.                             {
  626.                                 bg              =   "#111111",
  627.                                 height          =   80,
  628.                                 width           =   350,
  629.                                 opacity         =   dio_on_xyi.opacity,
  630.                                 ontop           =   true,
  631.                                 visible         =   false
  632.                             }
  633.                          )
  634.     mpd_on_xyi:geometry(
  635.                         {
  636. --                            x = cpu_on_xyi.x - 5 - mpd_on_xyi.width,
  637.                             x = 5,
  638.                             y = scrgeom.height - mpd_on_xyi.height - 18 - 5,
  639.                         }
  640.                       )
  641.  
  642.     mpd_on_xyi.screen    =   1
  643.  
  644.     local wb_lb_layout = wibox.layout.xyi.new()
  645.  
  646.     local w = mpd_on_xyi.width-5*2
  647.  
  648.     local box = 24
  649.     for i in pairs(btn_mpd) do
  650.         btn_mpd[i].img:buttons( awful.util.table.join(
  651.                                     awful.button(
  652.                                         { }, 1, function () awful.util.spawn(btn_mpd[i].img_cmd, false) end)
  653.                                     )
  654.                               )
  655.         wb_lb_layout:add(btn_mpd[i].img,{   x = 5+(i-1)*(34+2),
  656.                                             y = mpd_on_xyi.height - 5 - box,
  657.                                             width  = 34,
  658.                                             height = box})
  659.     end
  660.     for i in pairs(stat_mpd) do
  661.         stat_mpd[i].img:buttons( awful.util.table.join(
  662.                                     awful.button(
  663.                                         { }, 1, function () awful.util.spawn(stat_mpd[i].img_cmd, false) end)
  664.                                     )
  665.                                )
  666.         wb_lb_layout:add(stat_mpd[i].img,{  x = 5+36*5+5+(i-1)*(24+2),
  667.                                             y = mpd_on_xyi.height - 5 - box,
  668.                                             width  = 24,
  669.                                             height = box})
  670.     end
  671.  
  672.     wb_lb_layout:add(prgb_mpd,{ x = 5,
  673.                                 y = mpd_on_xyi.height - 15 - box,
  674.                                 width  = w,
  675.                                 height = 5})
  676.  
  677.     wb_lb_layout:add(tx_mpd,{   x = 5,
  678.                                 y = 5,
  679.                                 width  = w,
  680.                                 height = mpd_on_xyi.height - 25 - box})
  681.  
  682.     wb_lb_layout:add(tx_tme,{   x = mpd_on_xyi.width  - 80,
  683.                                 y = mpd_on_xyi.height - 30,
  684.                                 width  = 75,
  685.                                 height = 25})
  686.  
  687.     local bc = wibox.widget.imagebox(beautiful.bc)
  688.     bc:buttons( awful.util.table.join(
  689.                     awful.button(
  690.                         { }, 1, function () mpd_on_xyi.visible = false end)
  691.                     )
  692.               )
  693.  
  694.     wb_lb_layout:add(bc,{   x = mpd_on_xyi.width - 10 - 2,
  695.                             y = 2,
  696.                             width  = 10,
  697.                             height = 10})
  698.  
  699.     mpd_on_xyi:set_widget(wb_lb_layout)
  700. --]]------------------------------------------------------------------------------
  701. --------------------------------------------------------------------------------
  702.     local scr_on_xyi =   wibox(
  703.                             {
  704.                                 bg              =   "#111111",
  705.                                 height          =   144,
  706.                                 width           =   36,
  707.                                 opacity         =   mpd_on_xyi.opacity,
  708.                                 ontop           =   true,
  709.                                 visible         =   false
  710.                             }
  711.                          )
  712.     scr_on_xyi:geometry(
  713.                         {
  714. --                            x = cpu_on_xyi.x - 5 - scr_on_xyi.width,
  715.                             x = 5,
  716.                             y = (scrgeom.height - scr_on_xyi.height - 18)/2,
  717.                         }
  718.                       )
  719.  
  720.     scr_on_xyi.screen    =   1
  721.  
  722.     local wb_lb_layout = wibox.layout.xyi.new()
  723.  
  724.     for i in pairs(btn_scr) do
  725.         btn_scr[i].img:buttons( awful.util.table.join(
  726.                                     awful.button(
  727.                                         { }, 1, function () awful.util.spawn(btn_scr[i].img_cmd, false) end)
  728.                                     )
  729.                               )
  730.         wb_lb_layout:add(btn_scr[i].img,{   x = 1,
  731.                                             y = 15+(i-1)*26,
  732.                                             width  = 34,
  733.                                             height = 24})
  734.     end
  735.  
  736.     local bc = wibox.widget.imagebox(beautiful.bc)
  737.     bc:buttons( awful.util.table.join(
  738.                     awful.button(
  739.                         { }, 1, function () scr_on_xyi.visible = false end)
  740.                     )
  741.               )
  742.  
  743.     wb_lb_layout:add(bc,{   x = scr_on_xyi.width - 10 - 2,
  744.                             y = 2,
  745.                             width  = 10,
  746.                             height = 10})
  747.  
  748.     scr_on_xyi:set_widget(wb_lb_layout)
  749. --]]------------------------------------------------------------------------------
  750. --[[------------------------------------------------------------------------------
  751.     local nio_on_xyi =   wibox(
  752.                             {
  753.                                 bg              =   "#111111",
  754.                                 height          =   dio_on_xyi.height,
  755.                                 width           =   dio_on_xyi.width,
  756.                                 opacity         =   dio_on_xyi.opacity,
  757.                                 ontop           =   true,
  758.                                 visible         =   false
  759.                             }
  760.                          )
  761.     nio_on_xyi:geometry(
  762.                         {
  763. --                            x = dio_on_xyi.x - 5 - nio_on_xyi.width,
  764.                             x = dio_on_xyi.x,
  765.                             y = dio_on_xyi.y - nio_on_xyi.height - 5,
  766.                         }
  767.                       )
  768.  
  769.     nio_on_xyi.screen    =   1
  770.  
  771.     local wb_lb_layout = wibox.layout.xyi.new()
  772.  
  773.     local h = (nio_on_xyi.height-5*8)/4.6
  774.     local w = nio_on_xyi.width-5*2
  775.  
  776.     for i in pairs(n_net) do
  777.         gr_nio[i]:set_height(h)
  778.         gr_nio[i]:set_width(w)
  779.         wb_lb_layout:add(gr_nio[i],{    x = 5,
  780.                                         y = 5+(i-1)*(h+5),
  781.                                         width  = w,
  782.                                         height = h})
  783.     end
  784.     wb_lb_layout:add(tx_nio,{   x = 5,
  785.                                 y = 5+3*(h+5),
  786.                                 width  = w,
  787.                                 height = nio_on_xyi.height - (5*2+3*(h+5)) })
  788.  
  789.     local bc = wibox.widget.imagebox(beautiful.bc)
  790.     bc:buttons( awful.util.table.join(
  791.                     awful.button(
  792.                         { }, 1, function () nio_on_xyi.visible = false end)
  793.                     )
  794.               )
  795.  
  796.     wb_lb_layout:add(bc,{   x = nio_on_xyi.width - 10 - 2,
  797.                             y = 2,
  798.                             width  = 10,
  799.                             height = 10})
  800.  
  801.     nio_on_xyi:set_widget(wb_lb_layout)
  802. --]]------------------------------------------------------------------------------
  803. --[[------------------------------------------------------------------------------
  804.     local wbox_msg =   wibox(
  805.                             {
  806.                                 bg              =   "#111111",
  807.                                 height          =   dio_on_xyi.y - 10,
  808.                                 width           =   dio_on_xyi.width + 5 + mem_on_xyi.width,
  809.                                 opacity         =   0.9,
  810.                                 ontop           =   true,
  811.                                 visible         =   false
  812.                             }
  813.                          )
  814.     wbox_msg:geometry(
  815.                         {
  816.                             x = scrgeom.x + scrgeom.width - 5 - wbox_msg.width,
  817.                             y = scrgeom.y + 5,
  818.                         }
  819.                       )
  820.  
  821.     wbox_msg.screen    =   1
  822.  
  823.     local wb_lb_layout = wibox.layout.xyi.new()
  824.  
  825.     local h = 20
  826.     local w = (wbox_msg.width-5*6)/6
  827.     local l = math.floor(wbox_msg.height/14)
  828.  
  829.     local txt = wibox.widget.textbox("")
  830.  
  831.     local bt    =   {
  832. --                    wibox.widget.textbox('<span  color="'..beautiful.infom..'">dmesg</span>'),
  833. --                    wibox.widget.textbox('<span  color="'..beautiful.infom..'">slim</span>'),
  834.                     wibox.widget.textbox('<span  color="'..beautiful.infom..'">acpi</span>'),
  835.                     wibox.widget.textbox('<span  color="'..beautiful.infom..'">udevm</span>'),
  836.                     wibox.widget.textbox('<span  color="'..beautiful.infom..'">state</span>'),
  837. --                    wibox.widget.textbox('<span  color="'..beautiful.infom..'">rclog</span>'),
  838.                     }
  839.  
  840. --*
  841.     bt[1]:buttons( awful.util.table.join(
  842.                         awful.button(
  843.                             { }, 1, function ()
  844.                                         local f = io.popen("bash " .. uhaw .. "/script/get_dmesg "..l)
  845.                                         txt:set_markup('<span  color="'..beautiful.infom..'">==> dmesg | tail -n xx' .. '\n\n</span>'..
  846.                                                        '<span  color="'..beautiful.infot..'">' .. f:read("*all") .. '</span>' .. '\n')
  847.                                         f:close()
  848.                                     end
  849.                                     )
  850.                         )
  851.                   )
  852.     bt[2]:buttons( awful.util.table.join(
  853.                         awful.button(
  854.                             { }, 1, function ()
  855.                                         local f = io.popen("tail -n " .. l .. " /var/log/slim.log | sed 's/<==//g'")
  856.                                         txt:set_markup('<span  color="'..beautiful.infom..'">==> /var/log/slim.log' .. '\n\n</span>'..
  857.                                                        '<span  color="'..beautiful.infot..'">' .. f:read("*all") .. '</span>' .. '\n')
  858.                                         f:close()
  859.                                     end
  860.                                     )
  861.                         )
  862.                   )
  863. --*
  864.     bt[1]:buttons( awful.util.table.join(
  865.                         awful.button(
  866.                             { }, 1, function ()
  867.                                         local f = io.popen("tail -n " .. l .. " /etc/acpi/acpi.log | sed 's/<==//g'")
  868.                                         txt:set_markup('<span  color="'..beautiful.infom..'">==> /etc/acpi/acpi.log' .. '\n\n</span>'..
  869.                                                        '<span  color="'..beautiful.infot..'">' .. f:read("*all") .. '</span>' .. '\n')
  870.                                         f:close()
  871.                                     end
  872.                                     )
  873.                         )
  874.                   )
  875.     bt[2]:buttons( awful.util.table.join(
  876.                         awful.button(
  877.                             { }, 1, function ()
  878.                                         local f = io.popen("tail -n " .. l .. " /var/log/udev-mounts.log | sed 's/<==//g'")
  879.                                         txt:set_markup('<span  color="'..beautiful.infom..'">==> /var/log/udev-mounts.log' .. '\n\n</span>'..
  880.                                                        '<span  color="'..beautiful.infot..'">' .. f:read("*all") .. '</span>' .. '\n')
  881.                                         f:close()
  882.                                     end
  883.                                     )
  884.                         )
  885.                   )
  886.     bt[3]:buttons( awful.util.table.join(
  887.                         awful.button(
  888.                             { }, 1, function ()
  889.                                         local f = io.popen("tail -n " .. l .. " " .. uhaw .. "/tmpfl/.rw_states")
  890.                                         txt:set_markup('<span  color="'..beautiful.infom..'">==> События' .. '\n\n</span>'..
  891.                                                        '<span  color="'..beautiful.infot..'">' .. f:read("*all") .. '</span>' .. '\n')
  892.                                         f:close()
  893.                                     end
  894.                                     )
  895.                         )
  896.                   )
  897. --*
  898.     bt[6]:buttons( awful.util.table.join(
  899.                         awful.button(
  900.                             { }, 1, function ()
  901.                                         local f = io.popen("tail -n " .. l .. " /var/log/rc.log | sed 's/<==//g'")
  902.                                         txt:set_markup('<span  color="'..beautiful.infom..'">==> /var/log/rc.log' .. '\n\n</span>'..
  903.                                                        '<span  color="'..beautiful.infot..'">' .. f:read("*all") .. '</span>' .. '\n')
  904.                                         f:close()
  905.                                     end
  906.                                     )
  907.                         )
  908.                   )
  909. --*
  910.  
  911.     wb_lb_layout:add(txt,{  x = 5,
  912.                             y = 5+h+5,
  913.                             width  = wbox_msg.width-10,
  914.                             height = wbox_msg.height-15-h})
  915.     for i in pairs(bt) do
  916.         bt[i]:set_align("center")
  917.         wb_lb_layout:add(bt[i],{    x = 5+(w+5)*(i-1),
  918.                                     y = 5,
  919.                                     width  = w,
  920.                                     height = h})
  921.     end
  922.  
  923.     local bc = wibox.widget.imagebox(beautiful.bc)
  924.     bc:buttons( awful.util.table.join(
  925.                     awful.button(
  926.                         { }, 1, function () wbox_msg.visible = false end)
  927.                     )
  928.               )
  929.  
  930.     wb_lb_layout:add(bc,{   x = wbox_msg.width - 10 - 2,
  931.                             y = 2,
  932.                             width  = 10,
  933.                             height = 10})
  934.  
  935.     wbox_msg:set_widget(wb_lb_layout)
  936. --]]------------------------------------------------------------------------------
  937. --------------------------------------------------------------------------------
  938.     globalkeys = awful.util.table.join(
  939.         awful.key({ modkey,           }, "Tab", awful.tag.history.restore),
  940.  
  941.         awful.key({ modkey,           }, "l",
  942.             function ()
  943.                 awful.client.focus.byidx( 1)
  944.                 if client.focus then client.focus:raise() end
  945.             end),
  946.         awful.key({ modkey,           }, "j",
  947.             function ()
  948.                 awful.client.focus.byidx(-1)
  949.                 if client.focus then client.focus:raise() end
  950.             end),
  951.  
  952.         awful.key({ modkey, "Shift"             }, "l",         function () awful.client.swap.byidx(  1)    end),
  953.         awful.key({ modkey, "Shift"             }, "j",         function () awful.client.swap.byidx( -1)    end),
  954.         awful.key({ modkey, "Control"           }, "l",         function () awful.screen.focus_relative( 1) end),
  955.         awful.key({ modkey, "Control"           }, "j",         function () awful.screen.focus_relative(-1) end),
  956.         awful.key({ modkey,                     }, "u",         awful.client.urgent.jumpto),
  957.  
  958.         awful.key({ modkey,                     }, "Return",    function () awful.util.spawn(terminal1, true, 1) end),
  959.         awful.key({ modkey, "Control"           }, "Return",    function () awful.util.spawn(terminal2) end),
  960.         awful.key({ modkey, "Control"           }, "r",
  961.                                                                 function ()
  962. --                                                                    os.execute('bash '..uh..'/.xinitrc reload pan1')
  963.                                                                     awesome.restart()
  964. --                                                                    os.execute('bash '..uh..'/.xinitrc reload pan2')
  965.                                                                 end),
  966. --                                                                ),
  967.         awful.key({ modkey, "Shift", "Control"  }, "q",         awesome.quit),
  968.  
  969.         awful.key({ modkey,                     }, "i",         function () awful.tag.incmwfact( 0.05)    end),
  970.         awful.key({ modkey,                     }, "k",         function () awful.tag.incmwfact(-0.05)    end),
  971.         awful.key({ modkey, "Shift"             }, "i",         function () awful.tag.incnmaster( 1)      end),
  972.         awful.key({ modkey, "Shift"             }, "k",         function () awful.tag.incnmaster(-1)      end),
  973.         awful.key({ modkey, "Control"           }, "i",         function () awful.tag.incncol( 1)         end),
  974.         awful.key({ modkey, "Control"           }, "k",         function () awful.tag.incncol(-1)         end),
  975.         awful.key({ modkey,                     }, "space",     function () awful.layout.inc(layouts,  1) end),
  976.  
  977.  
  978.         awful.key({ modkey,                     }, "p",         function () awful.util.spawn(top_dmenu)     end),
  979.         awful.key({ modkey, "Control", "Shift" },   "Return",   function ()
  980.                                                                     awful.util.spawn("scrot -cd 0.33 -e 'mv $f ~/scrot/'")
  981.                                                                     os.execute("sleep 0.5")
  982.                                                                     naughty.notify(
  983.                                                                                     {
  984.                                                                                         title = ' Скриншот',
  985.                                                                                         text  = ' сделан!.. ',
  986.                                                                                         timeout = 8,
  987.                                                                                         hover_timeout = 0.5
  988.                                                                                     }
  989.                                                                                   )
  990. --                                                                    os.execute("bash /etc/000_mplayer/play_voice скриншот.mp3&")
  991.                                                                 end),
  992.         awful.key({ modkey, "Control", "Shift" },   "r",        function () awful.util.spawn("bash " .. uh .. "/.xinitrc reload")       end),
  993.         awful.key({ modkey, "Control", "Shift" },   "o",        function () awful.util.spawn("bash " .. uh .. "/SCR/.screen_off")       end),
  994.         awful.key({ modkey, "Control", "Shift" },   "l",        function () awful.util.spawn("libreoffice --nologo")                    end),
  995.         awful.key({ modkey, "Control", "Shift" },   "p",        function () awful.util.spawn(terminal3 .. "-e /usr/sbin/pon e352")      end), --urxvt -e /usr/sbin/pon e352 --bash /etc/ppp/scripts/.ppp_up_modem
  996.     --[[
  997.         awful.key({ modkey, "Control", "Shift" },   "w",        function () awful.util.spawn("xterm -e 'wvdial ForAll'")                end),
  998.     ]]
  999. --        awful.key({ modkey, "Control", "Shift" },   "m",        function () awful.util.spawn(terminal1 .. " -e bash " .. uh .. "/SCR/.load_qip")end),
  1000.         awful.key({ modkey, "Control", "Shift" },   "m",        function () awful.util.spawn("pidgin")                                  end),
  1001.  
  1002.         awful.key({ modkey, "Control", "Shift" },   "n",        function () awful.util.spawn("nautilus --no-desktop --browser")         end),
  1003.  
  1004.         awful.key({ modkey, "Control", "Shift" },   "c",        function () awful.util.spawn("conkeror")                                end),
  1005. --        awful.key({ modkey, "Control", "Shift" },   "i",        function () awful.util.spawn("iceweasel")                               end),
  1006.         awful.key({ modkey, "Control", "Shift" },   "i",        function () awful.util.spawn("firefox-bin")                             end),
  1007.         awful.key({ modkey, "Control", "Shift" },   "u",        function () awful.util.spawn("google-chrome-beta")                      end),
  1008.         awful.key({ modkey, "Control", "Shift" },   "f",        function () awful.util.spawn("firefox")                                 end),
  1009.     --[[
  1010.         awful.key({ modkey, "Control", "Shift" },   "f",        function () awful.util.spawn(uhome .. "/.fehbg")                        end),
  1011.     ]]
  1012.         awful.key({ modkey, "Control", "Shift" },   "h",        function () awful.util.spawn("urxvt -e htop -d 10")                     end),
  1013.         awful.key({ modkey, "Control", "Shift" },   "a",        function () awful.util.spawn("urxvt -e alsamixer")                      end),
  1014.  
  1015.         awful.key({ modkey, "Control", "Shift" },   "g",        function () awful.util.spawn("geany")                                   end),
  1016.         awful.key({ modkey, "Control", "Shift" },   "d",        function () awful.util.spawn("deadbeef")                                end),
  1017.  
  1018.         awful.key({ modkey, "Control", "Shift" },   ",",        function () awful.util.spawn(terminal2 .. " -e bash " .. uhaw .. '/script/run_1c') end),
  1019.         awful.key({ modkey, "Control", "Shift" },   ".",        function () awful.util.spawn(terminal2 .. " -e bash " .. uhaw .. '/script/run_1c_local') end),
  1020.  
  1021.         awful.key({ modkey, "Control", "Shift" },   "F10",      function ()
  1022.                                                                     naughty.notify(
  1023.                                                                                     {
  1024.                                                                                         title = ' Кол-во экранов ',
  1025.                                                                                         text  = ' равно ' .. screen.count() .. ' шт ',
  1026.                                                                                         timeout = 8,
  1027.                                                                                         hover_timeout = 0.5
  1028.                                                                                     }
  1029.                                                                                   )
  1030.                                                                 end),
  1031.         awful.key({ modkey, "Control", "Shift" },   "F11",      function ()
  1032.                                                                     naughty.notify(
  1033.                                                                                     {
  1034.                                                                                         title = ' Нам сказали ',
  1035.                                                                                         text  = ' перезагружайся!.. ',
  1036.                                                                                         timeout = 8,
  1037.                                                                                         hover_timeout = 0.5
  1038.                                                                                     }
  1039.                                                                                   )
  1040.                                                                     os.execute('bash ' .. uhaw .. '/script/rw_st reboot')
  1041. --                                                                    os.execute("bash /etc/000_mplayer/play_voice перезагрузка.mp3 &")
  1042.                                                                     awful.util.spawn("/sbin/reboot")
  1043.                                                                 end),
  1044.         awful.key({ modkey, "Control", "Shift" },   "F12",      function ()
  1045.                                                                     naughty.notify(
  1046.                                                                                     {
  1047.                                                                                         title = ' Нам сказали ',
  1048.                                                                                         text  = ' выключайся!.. ',
  1049.                                                                                         timeout = 8,
  1050.                                                                                         hover_timeout = 0.5
  1051.                                                                                     }
  1052.                                                                                   )
  1053.                                                                     os.execute('bash ' .. uhaw .. '/script/rw_st halt')
  1054. --                                                                    os.execute("bash /etc/000_mplayer/play_voice выключение.mp3 &")
  1055.                                                                     awful.util.spawn("/sbin/poweroff")
  1056.                                                                 end),
  1057.  
  1058.         awful.key({  }, "XF86AudioPlay",                        function () awful.util.spawn("deadbeef --play-pause > /dev/null")       end),
  1059.         awful.key({  }, "XF86AudioStop",                        function () awful.util.spawn("deadbeef --stop > /dev/null")             end),
  1060.         awful.key({  }, "XF86AudioPrev",                        function () awful.util.spawn("deadbeef --prev > /dev/null")             end),
  1061.         awful.key({  }, "XF86AudioNext",                        function () awful.util.spawn("deadbeef --next > /dev/null")             end),
  1062.         awful.key({  }, "XF86AudioMute",                        function () awful.util.spawn("bash /etc/acpi/amixer_state.sh mute")     end),
  1063.         awful.key({  }, "XF86AudioLowerVolume",                 function () awful.util.spawn("bash /etc/acpi/amixer_state.sh down")     end),
  1064.         awful.key({  }, "XF86AudioRaiseVolume",                 function () awful.util.spawn("bash /etc/acpi/amixer_state.sh up")       end),
  1065.  
  1066.         awful.key({  }, "Scroll_Lock",                          function () awful.util.spawn("slock")                                   end),
  1067.  
  1068.         awful.key({ modkey,           }, "w",                   function () awful.layout.set(layouts[1])    end),
  1069.         awful.key({ modkey,           }, "s",                   function () awful.layout.set(layouts[2])    end),
  1070.         awful.key({ modkey,           }, "d",                   function () awful.layout.set(layouts[3])    end),
  1071.         awful.key({ modkey,           }, "e",                   function () awful.layout.set(layouts[4])    end),
  1072.         awful.key({ modkey,           }, "h",                   function () awful.layout.set(awful.layout.suit.fair.horizontal)         end),
  1073.         awful.key({ modkey,           }, "v",                   function () awful.layout.set(awful.layout.suit.fair)                    end),
  1074.         awful.key({ modkey,           }, "b",                   function () bwibox.visible = not bwibox.visible                         end),
  1075.         awful.key({ modkey,           }, "/",                   function ()
  1076.                                                                     if cpu_on_xyi.visible == true then
  1077.                                                                         cpu_on_xyi.visible = false
  1078.                                                                         mem_on_xyi.visible = false
  1079. --                                                                        dio_on_xyi.visible = false
  1080. --                                                                        nio_on_xyi.visible = false
  1081.                                                                     else
  1082.                                                                         cpu_on_xyi.visible = true
  1083.                                                                         mem_on_xyi.visible = true
  1084. --                                                                        dio_on_xyi.visible = true
  1085. --                                                                        nio_on_xyi.visible = true
  1086.                                                                     end
  1087.                                                                 end),
  1088.         awful.key({ modkey,           }, "'",                   function ()
  1089.                                                                     if dio_on_xyi.visible == true then
  1090.                                                                         dio_on_xyi.visible = false
  1091.                                                                     else
  1092.                                                                         dio_on_xyi.visible = true
  1093.                                                                     end
  1094.                                                                 end),
  1095.         awful.key({ modkey,           }, "a",                   function ()
  1096.                                                                     if mpd_on_xyi.visible == true then
  1097.                                                                         mpd_on_xyi.visible = false
  1098.                                                                     else
  1099.                                                                         mpd_on_xyi.visible = true
  1100.                                                                     end
  1101.                                                                 end),
  1102.         awful.key({ modkey,           }, "x",                   function ()
  1103.                                                                     if scr_on_xyi.visible == true then
  1104.                                                                         scr_on_xyi.visible = false
  1105.                                                                     else
  1106.                                                                         scr_on_xyi.visible = true
  1107.                                                                     end
  1108.                                                                 end),
  1109.         awful.key({ modkey,           }, "z",                   function ()
  1110.                                                                     cpu_on_xyi.visible = false
  1111.                                                                     mem_on_xyi.visible = false
  1112.                                                                     dio_on_xyi.visible = false
  1113.                                                                     mpd_on_xyi.visible = false
  1114.                                                                     scr_on_xyi.visible = false
  1115.                                                                 end),
  1116. --[[
  1117.         awful.key({ modkey,           }, "]",                  function ()
  1118.                                                                     if nio_on_xyi.visible == true then
  1119.                                                                         nio_on_xyi.visible = false
  1120.                                                                     else
  1121.                                                                         nio_on_xyi.visible = true
  1122.                                                                     end
  1123.                                                                 end),
  1124. --
  1125.         awful.key({ modkey,           }, "'",                   function ()
  1126.                                                                     if wbox_msg.visible == true then
  1127.                                                                         wbox_msg.visible = false
  1128.                                                                     else
  1129.                                                                         wbox_msg.visible = true
  1130.                                                                     end
  1131.                                                                 end),
  1132. ]]
  1133. --awful.key({ modkey,}, "a",nil, function () str.visible = not str.visible end),
  1134.  
  1135.         awful.key({ modkey, "Control"           }, "n",         awful.client.restore)
  1136.     )
  1137. --]]------------------------------------------------------------------------------
  1138.     clientkeys = awful.util.table.join(
  1139.         awful.key({ modkey,                     }, "f",         function (c) c.fullscreen = not c.fullscreen  end),
  1140.         awful.key({ modkey, "Shift"             }, "q",         function (c) c:kill()                         end),
  1141.         awful.key({ modkey, "Shift"             }, "space",     awful.client.floating.toggle                     ),
  1142. --        awful.key({ modkey, "Control"           }, "Return",    function (c) c:swap(awful.client.getmaster()) end),
  1143. --        awful.key({ modkey,                     }, "o",         awful.client.movetoscreen                        ),
  1144.         awful.key({ modkey,                     }, "t",         function (c) c.ontop = not c.ontop            end),
  1145.         awful.key({ modkey,                     }, "n",
  1146.             function (c)
  1147.                 c.minimized = true
  1148.             end),
  1149.         awful.key({ modkey,           }, "m",
  1150.             function (c)
  1151.                 c.maximized_horizontal = not c.maximized_horizontal
  1152.                 c.maximized_vertical   = not c.maximized_vertical
  1153.             end)
  1154.     )
  1155. --]]------------------------------------------------------------------------------
  1156.     keynumber = 0
  1157.     keynumber = math.min(20, math.max(#tags, keynumber));
  1158.     for i = 1, keynumber do
  1159.         globalkeys = awful.util.table.join(globalkeys,
  1160.             awful.key({ modkey },           "#" .. tags0.keynum[i],
  1161.                       function ()
  1162.                             local tag = awful.tag.gettags(1)[i]
  1163.                             if tag then
  1164.                               awful.tag.viewnone(1)
  1165.                               awful.tag.viewonly(tag)
  1166.                             end
  1167.                       end),
  1168.             awful.key({ modkey, "Shift" },  "#" .. tags0.keynum[i],
  1169.                       function ()
  1170.                           local tag = awful.tag.gettags(1)[i]
  1171.                           if client.focus and tag then
  1172.                               awful.client.movetotag(tag)
  1173.                          end
  1174.                       end))
  1175.     end
  1176.     if screen.count() == 2 then
  1177.         globalkeys = awful.util.table.join(globalkeys,
  1178.             awful.key({ modkey },           "#" .. tags1.keynum[1],
  1179.                       function ()
  1180.                             local tag = awful.tag.gettags(2)[1]
  1181.                             if tag then
  1182.                               awful.tag.viewnone(2)
  1183.                               awful.tag.viewonly(tag)
  1184.                             end
  1185.                       end),
  1186.             awful.key({ modkey, "Shift" },  "#" .. tags1.keynum[1],
  1187.                       function ()
  1188.                           local tag = awful.tag.gettags(2)[i]
  1189.                           if client.focus and tag then
  1190.                               awful.client.movetotag(tag)
  1191.                          end
  1192.                       end))
  1193.     end
  1194. --]]------------------------------------------------------------------------------
  1195.     clientbuttons = awful.util.table.join(
  1196.         awful.button({ modkey }, 1, awful.mouse.client.move),
  1197.         awful.button({ modkey }, 3, awful.mouse.client.resize))
  1198. --]]------------------------------------------------------------------------------
  1199.     root.keys(globalkeys)
  1200. --]]------------------------------------------------------------------------------
  1201.     awful.rules.rules = {
  1202.                             { rule = {  },
  1203.                               properties =  {
  1204.                                                 border_width = beautiful.border_width,
  1205.                                                 border_color = beautiful.border_normal,
  1206.                                                 focus = true,
  1207.                                                 keys = clientkeys,
  1208.                                                 buttons = clientbuttons,
  1209.                                                 floating = true,
  1210.                                                 callback = awful.placement.centered,
  1211.                                             }
  1212.                             },
  1213.     --[[
  1214.                             { rule = { class = "Captstatusui" },
  1215.                                       properties = { floating = true                         } },
  1216.                             { rule = { class = "XCalc" },
  1217.                                       properties = { floating = true                         } },
  1218.                             { rule = { class = "Thunar" },
  1219.                                       properties = { floating = true                         } },
  1220.                             { rule = { class = "Lxpanel" },
  1221.                                       properties = { floating = true                         } },
  1222.                             { rule = { class = "Nautilus" },
  1223.                                       properties = { floating = true                         } },
  1224.                             { rule = { class = "XFontSel" },
  1225.                                       properties = { floating = true                         } },
  1226.                             { rule = { class = "Geany" },
  1227.                                       properties = { floating = true                         } },
  1228.                             { rule = { class = "Qjackctl" },
  1229.                                       properties = { floating = true                         } },
  1230.                             { rule = { class = "Volumeicon" },
  1231.                                       properties = { floating = true                         } },
  1232.                             { rule = { class = "Gvolwheel" },
  1233.                                       properties = { floating = true                         } },
  1234.                             { rule = { class = "Wine" },
  1235.                                       properties = { floating = true                         } },
  1236.                             { rule = { class = "Gtk" },
  1237.                                       properties = { floating = true                         } },
  1238.                             { rule = { class = "Torchlight.bin.x86" },
  1239.                                       properties = { floating = true                         } },
  1240.                             { rule = { class = "ioquake3.i386" },
  1241.                                       properties = { floating = true                         } },
  1242.                             { rule = { class = "ut-bin" },
  1243.                                       properties = { floating = true                         } },
  1244.                             { rule = { class = "warzone2100" },
  1245.                                       properties = { floating = true                         } },
  1246.                             { rule = { class = "avp" },
  1247.                                       properties = { floating = true                         } },
  1248.                             { rule = { class = "SDL_App" },
  1249.                                       properties = { floating = true                         } },
  1250.  
  1251.                             { rule = { name = "ALSA Mixer"},
  1252.                                       properties = { floating = true                         } },
  1253.                             { rule = { name = "/proc/asound"},
  1254.                                       properties = { floating = true                         } },
  1255.                             { rule = { name = "Fieldrunners"},
  1256.                                       properties = { floating = true                         } },
  1257.                             { rule = { name = "LGP Security System Manager"},
  1258.                                       properties = { floating = true                         } },
  1259.                             { rule = { name = "Launch Sacred"},
  1260.                                       properties = { floating = true                         } },
  1261.                             { rule = { name = "Event Tester"},
  1262.                                       properties = { floating = true                         } },
  1263.                             { rule = { class = "Paman" },
  1264.                                       properties = { floating = true                         } },
  1265.  
  1266.     ]]
  1267.                             { rule = { class = "Gimp", role  = "gimp-startup" },       properties = { floating = true,    tag = tags[3]         } },
  1268.                             { rule = { class = "Gimp", role  = "gimp-toolbox" },       properties = { floating = true,    tag = tags[3],      geometry = {0000,015,0175,770} } },
  1269.                             { rule = { class = "Gimp", role  = "gimp-dock" },          properties = { floating = true,    tag = tags[3],      geometry = {1105,015,0175,770} } },
  1270.                             { rule = { class = "Gimp", role  = "gimp-image-window" },  properties = { floating = false,   tag = tags[3]         } },
  1271.  
  1272.                             { rule = { class = "Xsane" },                              properties = { floating = true,    tag = tags[4]         } },
  1273.                             { rule = { class = "Xscanimage" },                         properties = { floating = true,    tag = tags[4],      callback = awful.placement.centered    } },
  1274.                             { rule = { class = "System-config-printer" },              properties = { floating = true,    tag = tags[4]         } },
  1275.  
  1276.                             { rule = { class = "Djview" },                             properties = { floating = false,   tag = tags[5]         } },
  1277.                             { rule = { class = "Evince" },                             properties = { floating = false,   tag = tags[5]         } },
  1278.                             { rule = { class = "xfreerdp" },                           properties = { floating = false,   tag = tags[5]         } },
  1279.  
  1280.                             { rule = { class = "Deluge" },                             properties = { floating = false,   tag = tags[6]         } },
  1281.                             { rule = { class = "Deluge-gtk" },                         properties = { floating = false,   tag = tags[6]         } },
  1282.                             { rule = { class = "Flush" },                              properties = { floating = false,   tag = tags[6]         } },
  1283.  
  1284.                             { rule = { class = "XPaint" },                             properties = { floating = true,                          } },
  1285.                             { rule = { class = "TopLevelShell" },                      properties = { floating = false,                         } },
  1286.                             { rule = { class = "Gpaint" },                             properties = { floating = false,                         } },
  1287.                             { rule = { class = "Mtpaint" },                            properties = { floating = false,                         } },
  1288.                             { rule = { class = "MyPaint" },                            properties = { floating = false,                         } },
  1289.                             { rule = { class = "Gpicview" },                           properties = { floating = false,                         } },
  1290.                             { rule = { class = "Pythoncad" },                          properties = { floating = false,                         } },
  1291.                             { rule = { class = "Librecad" },                           properties = { floating = false,                         } },
  1292.                             { rule = { class = "Gnome-paint" },                        properties = { floating = false,                         } },
  1293.                             { rule = { class = "GQview" },                             properties = { floating = false,                         } },
  1294.  
  1295.                             { rule = { class = "Brasero" },                            properties = { floating = false,                         } },
  1296.                             { rule = { class = "Xfburn" },                             properties = { floating = false,                         } },
  1297.                             { rule = { class = "Qutim",  role = "buddy_list" },        properties = { floating = false,                         } },
  1298.                             { rule = { class = "Qutim",  role = "conversation" },      properties = { floating = false,                    callback = awful.client.setslave } },-- установить, узнать и доделать
  1299.  
  1300.                             { rule = { class = "Audacious" },                          properties = { floating = true,    tag = tags[7]         } },
  1301.                             { rule = { class = "Audacity" },                           properties = { floating = false,   tag = tags[7]         } },
  1302.  
  1303.                             { rule = { class = "Deadbeef" },                           properties = { floating = false,   tag = tags[8]         } },
  1304.                             { rule = { class = "Exfalso" },                            properties = { floating = false,   tag = tags[8]         } },
  1305.                             { rule = { class = "Volumeicon" },                         properties = { floating = false,   tag = tags[8]         } },
  1306.  
  1307.                             { rule = { class = "Conkeror" },                           properties = { floating = false,   tag = tags[9]         } },
  1308.                             { rule = { class = "Midori" },                             properties = { floating = false,   tag = tags[9]         } },
  1309.                             { rule = { class = "Uzbl-core" },                          properties = { floating = false,   tag = tags[9]         } },
  1310.                             { rule = { class = "Iceweasel" },                          properties = { floating = false,   tag = tags[9]         } },
  1311.                             { rule = { class = "Firefox" },                            properties = { floating = false,   tag = tags[9]         } },
  1312.                             { rule = { class = "Google-chrome" },                      properties = { floating = false,   tag = tags[9]         } },
  1313.                             { rule = { class = "Download" },                           properties = { floating = true,    tag = tags[9]         } },
  1314.                             { rule = { instance = "Download" },                        properties = { floating = true,    tag = tags[9]         } },
  1315.                             { rule = { instance = "Dialog" },                          properties = { floating = true,    tag = tags[9]         } },
  1316.                             { rule = { instance = "Navigator" },                       properties = { floating = false,   tag = tags[9]         } },
  1317.                             { rule = { role = "browser" },                             properties = { floating = false,   tag = tags[9]         } },
  1318.  
  1319.                             { rule = { instance = "VCLSalFrame" },                     properties = { floating = false,   tag = tags[10]        } },
  1320.                             { rule = { name = "LibreOffice" },                         properties = { floating = false,   tag = tags[10]        } },
  1321.                             { rule = { class = "Soffice" },                            properties = { floating = true,    tag = tags[10]        } },
  1322.                             { rule = { class = "openoffice.org" },                     properties = { floating = false,   tag = tags[10]        } },
  1323.                             { rule = { class = "Abiword" },                            properties = { floating = false,   tag = tags[10]        } },
  1324.  
  1325.                             { rule = { class = "MPlayer" },                            properties = { floating = false,                         } },
  1326.                             { rule = { class = "Smplayer" },                           properties = { floating = false,   tag = tags[11]        } },
  1327.                             { rule = { class = "Gnome-mplayer" },                      properties = { floating = true,    tag = tags[11]        } },
  1328.  
  1329. --                            { rule = { class = "Pidgin" },                             properties = { floating = true,    tag = tags[11]        } },
  1330.                             { rule = { class = "Pidgin",  role = "buddy_list" },       properties = { floating = false,   tag = tags[11]       } },
  1331.                             { rule = { class = "Pidgin",  role = "conversation" },     properties = { floating = false,   tag = tags[11],   callback = awful.client.setmaster } },-- установить, узнать и доделать
  1332.  
  1333.                             { rule = { class = "Lxappearance" },                       properties = { floating = true,    tag = tags[11]        } },
  1334.                             { rule = { class = "Qtconfig" },                           properties = { floating = true,    tag = tags[11]        } },
  1335.                             { rule = { class = "Gconf-editor" },                       properties = { floating = true,    tag = tags[11]        } },
  1336.  
  1337.                             { rule = { name = "GParted" },                             properties = { floating = false,   tag = tags[12]        } },
  1338.                             { rule = { class = "Gpartedbin" },                         properties = {                     tag = tags[12]        } },
  1339.  
  1340.                             { rule = { class = "Geany" },                              properties = { floating = false,                         } },
  1341.  
  1342.                             { rule = { class = "URxvt" },                              properties = { floating = false,                         } },
  1343.                             { rule = { class = "XTerm" },                              properties = { floating = true,                          } },
  1344.                             { rule = { class = "XTerm", instance = "ppp_up_modem" },   properties = { floating = true,    tag = tags[12]        } },
  1345.                             { rule = { class = "feh" },                                properties = { floating = false,                         } },
  1346.                             { rule = { class = "Cheese" },                             properties = { floating = false,                         } },
  1347.  
  1348.                             { rule = { name = "Print" },                               properties = { floating = true,                          } },
  1349.                             { rule = { name = "Export" },                              properties = { floating = true,                          } },
  1350.                             { rule = { name = "Import" },                              properties = { floating = true,                          } },
  1351.                             { rule = { name = "Save" },                                properties = { floating = true,                          } },
  1352.                             { rule = { name = "Open" },                                properties = { floating = true,                          } },
  1353.                             { rule = { name = "Prefer" },                              properties = { floating = true,                          } },
  1354.                             { rule = { name = "<untitled>" },                          properties = { floating = true,                          } },
  1355.  
  1356.                             { rule = { name = "Найт" },                                properties = { floating = true,                          } },
  1357.                             { rule = { name = "Замен" },                               properties = { floating = true,                          } },
  1358.                             { rule = { name = "Экспорт" },                             properties = { floating = true,                          } },
  1359.                             { rule = { name = "Импорт" },                              properties = { floating = true,                          } },
  1360.                             { rule = { name = "Настро" },                              properties = { floating = true,                          } },
  1361.                             { rule = { name = "Параметр" },                            properties = { floating = true,                          } },
  1362.                             { rule = { name = "Поиск" },                               properties = { floating = true,                          } },
  1363.                             { rule = { name = "Добав" },                               properties = { floating = true,                          } },
  1364.                             { rule = { name = "Печат" },                               properties = { floating = true,                          } },
  1365.                             { rule = { name = "Сохран" },                              properties = { floating = true,                          } },
  1366.                             { rule = { name = "Откры" },                               properties = { floating = true,                          } },
  1367.                             { rule = { name = "Выреза" },                              properties = { floating = true,                          } },
  1368.                             { rule = { name = "Удал" },                                properties = { floating = true,                          } },
  1369.                             { rule = { name = "айл" },                                 properties = { floating = true,                          } },
  1370.                             { rule = { name = "Выбрать" },                             properties = { floating = true,                          } },
  1371.                             { rule = { name = "Удал" },                                properties = { floating = true,                          } },
  1372.                             { rule = { name = "Загруз" },                              properties = { floating = true,                          } },
  1373.                             { rule = { name = "Предупреждение" },                      properties = { floating = true,                          } },
  1374.  
  1375.                             { rule = { class = "Wine" },                               properties = { ontop = true,                             } }
  1376.                         }
  1377. --]]------------------------------------------------------------------------------
  1378.     client.connect_signal("manage",
  1379.                             function (c, startup)
  1380. --[[
  1381.                                 c:connect_signal("mouse::enter",
  1382.                                                     function(c)
  1383.                                                         if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
  1384.                                                             and awful.client.focus.filter(c) then
  1385.                                                             client.focus = c
  1386.                                                         end
  1387.                                                     end
  1388.                                                 )
  1389. ]]
  1390.                                 if not startup then
  1391.                                     if not c.size_hints.user_position and not c.size_hints.program_position then
  1392.                                         awful.placement.no_overlap(c)
  1393. --                                        if c.class ~= "XTerm" then
  1394. --                                            awful.placement.centered(c, nil)
  1395. --                                        end
  1396.                                     end
  1397.                                 end
  1398.                                 awful.placement.no_offscreen(c)
  1399.                                 c.size_hints_honor = false
  1400.  
  1401.  
  1402.                             end
  1403.                         )
  1404. --]]------------------------------------------------------------------------------
  1405.     client.connect_signal(  "focus",
  1406.                             function(c)
  1407.                                 c.border_color = beautiful.border_focus
  1408.                                awful.placement.no_offscreen(c)
  1409. --                                awful.placement.centered(c, nil)
  1410.                                 c.size_hints_honor = false
  1411.                             end
  1412.                         )
  1413. --]]------------------------------------------------------------------------------
  1414.     client.connect_signal("unfocus",
  1415.                             function(c)
  1416.                                 c.border_color = beautiful.border_normal
  1417.                                 awful.placement.no_offscreen(c)
  1418. --                                awful.placement.centered(c, nil)
  1419.                                 c.size_hints_honor = false
  1420.                             end
  1421.                         )
  1422. --]]------------------------------------------------------------------------------
  1423. --    os.execute("bash /etc/000_mplayer/play_voice загружен_и_готов_к_работе.mp3 &")
  1424. --]]------------------------------------------------------------------------------
  1425. os.execute('bash ' .. uhaw .. '/script/rw_st start-awesome')
  1426.  
  1427. --os.execute('bash '..uh..'/.xinitrc reload pan2')
  1428.  
  1429. local f     = io.popen("cat /proc/uptime")
  1430. local line  = f:read("*line")
  1431. f:close()
  1432.  
  1433. naughty.notify({font   = font_awesome, title  = "Uptime!", text   = line })
  1434.  
  1435. scheduler.start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement