{"id":214467,"date":"2014-03-03T15:02:03","date_gmt":"2014-03-03T11:02:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=214467"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=214467","title":{"rendered":"<span class=\"post_title\">\u041c\u043e\u0451 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 WM Awesome. \u0427\u0430\u0441\u0442\u044c 2<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0435\u0433\u043e \u0442.\u043d. \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u0430 \u0441 WM Awesome<\/p>\n<p>  <a href=\"http:\/\/habrahabr.ru\/post\/214411\/\">\u041f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0438 \u0442\u0443\u0442.<\/a><\/p>\n<p>  \u0422\u0443\u0442 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u0421\u0440\u0430\u0437\u0443 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0431\u0430\u0433 \u2014 \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u00ab\u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0437\u0432\u0443\u043a\u00bb \u0437\u0432\u0443\u043a \u0438\u0441\u0447\u0435\u0437\u0430\u0435\u0442, \u043f\u0440\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u043c \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u2014 \u043d\u0430 \u0432\u0438\u0434\u0436\u0435\u0442\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442, \u0447\u0442\u043e \u0437\u0432\u0443\u043a \u0432\u043a\u043b\u044e\u0447\u0451\u043d, \u043d\u043e \u0435\u0433\u043e \u043d\u0435\u0442\u0443. \u041f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u0441\u0442\u0440\u0430\u043d\u043d\u043e. \u041f\u043e\u043a\u0430 \u043d\u0435 \u043d\u0430\u0448\u0451\u043b \u043a\u0430\u043a \u0435\u0433\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c. \u0418 \u0435\u0449\u0451 \u0441\u043c\u0443\u0449\u0430\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043d\u0438\u0435 \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u0438 \u2014 90% \u043f\u043e \u0444\u0430\u043a\u0442\u0443 ~70 \u0435\u0434\u0438\u043d\u0438\u0446 \u0432 alsamixer, \u043d\u0430\u0434\u043e \u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u043d\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0434\u043e\u0439\u0434\u0451\u0442 \u0440\u0443\u043a\u0438. \u041d\u0443 \u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u043e\u0434\u0435 \u043a\u0430\u043a \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e<br \/>  <a name=\"habracut\"><\/a><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0436\u0435\u0442\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"lua\">--------------------- --- \u0412\u0438\u0434\u0436\u0435\u0442\u044b --- --------------------- opening_brace = '&lt;span foreground=&quot;white&quot; font_desc=&quot;Ubuntu&quot;&gt;[&lt;\/span&gt;' closing_brace = '&lt;span foreground=&quot;white&quot; font_desc=&quot;Ubuntu&quot;&gt;] &lt;\/span&gt;' function enbrace(str)    return &quot; &quot;..opening_brace..str..closing_brace..' ' end  function colorify(str, color)    return '&lt;span foreground=&quot;'..color..'&quot;&gt;'..str..'&lt;\/span&gt;' end  function get_colorload(val)    local color = 'green'    if val &gt; 85 then       color = 'red'    elseif val &gt; 60 then       color = 'yellow'    end    return color end  function format_throughput(val)    if (val &lt; 1000) then       return string.format('%3dKB\/s', val)    elseif (val &lt; 10240) then       return string.format('%.1fMB\/s', val\/1024)    else       return string.format('%3dMB\/s', val\/1024)    end end  one_sec_timer = timer{timeout = 1} ten_sec_timer = timer{timeout = 10}  spacer_big = wibox.widget.textbox()   spacer_big:set_text('     ') spacer_small = wibox.widget.textbox()   spacer_small:set_text('  ') volumecfg = {} volumecfg.cardid  = 0 volumecfg.channel = &quot;Master&quot; volumecfg.widget = wibox.widget.textbox() vol_color = {} -- command must start with a space! volumecfg.mixercommand = function (command)        local fd = io.popen(&quot;amixer -c &quot; .. volumecfg.cardid .. command)        local status = fd:read(&quot;*all&quot;)        fd:close()         local volume = string.match(status, &quot;(%d?%d?%d)%%&quot;)        volume = string.format(&quot;% 3d&quot;, volume)        status = string.match(status, &quot;%[(o[^%]]*)%]&quot;)        if string.find(status, &quot;on&quot;, 1, true) then                volume = volume .. &quot;%&quot; \t       vol_color=&quot;cyan&quot;        else                volume = volume .. &quot;\u00d7&quot; \t\tvol_color = &quot;red&quot;        end        volumecfg.widget:set_markup(enbrace(colorify(volume, vol_color)))  end volumecfg.update = function ()        volumecfg.mixercommand(&quot; sget &quot; .. volumecfg.channel) end volumecfg.up = function ()        volumecfg.mixercommand(&quot; sset &quot; .. volumecfg.channel .. &quot; 1%+&quot;) end volumecfg.down = function ()        volumecfg.mixercommand(&quot; sset &quot; .. volumecfg.channel .. &quot; 1%-&quot;) end volumecfg.toggle = function ()        volumecfg.mixercommand(&quot; sset &quot; .. volumecfg.channel .. &quot; toggle&quot;) end volumecfg.update()  client.connect_signal(&quot;manage&quot;, function (c, startup)     c.size_hints_honor = false end)  batterybox = wibox.widget.textbox()  function battery ()    local io_info = io.open(&quot;\/proc\/acpi\/battery\/BAT0\/info&quot;)    local io_state  = io.open(&quot;\/proc\/acpi\/battery\/BAT0\/state&quot;)    local str_info = io_info:read(&quot;*a&quot;)    local str_state = io_state:read(&quot;*a&quot;)    io.close(io_info)    io.close(io_state)     local capacity = str_info:match(&quot;last full capacity:%s+(%d+)&quot;)    local current  = str_state:match(&quot;remaining capacity:%s+(%d+)&quot;)    local state    = str_state:match(&quot;charging state:%s+(%a+)&quot;)    local rate     = str_state:match(&quot;present rate:%s+(%d+)&quot;)     local st_color = 'green'    if state == 'discharging' then       st_color = 'red'    elseif state == 'charging' then       st_color = 'yellow'    end     local remain_time_str = 'inf'    remain_chrg = ((current * 100) \/ capacity)    if (('discharging' == state) and (nil ~= rate) and (rate &gt; '0')) then       remain_time = current\/rate       remain_time_str = string.format('%dh %.2dm', remain_time, remain_time*60%60)    end    local rem_color = 'red'    if remain_chrg &gt; 15 then       rem_color = 'yellow'    end    if remain_chrg &gt; 60 then       rem_color = 'green'    end    batterybox:set_markup( enbrace(colorify('bat: ', 'orange')                            ..colorify(string.format(&quot;%d%%&quot;, remain_chrg), rem_color)                            ..', '                            ..colorify(remain_time_str, rem_color)                            ..', '                            ..colorify(state, st_color))) end  battery() ten_sec_timer:connect_signal(&quot;timeout&quot;, battery)   membox = wibox.widget.textbox() function memory()    local io_meminfo      = io.open(&quot;\/proc\/meminfo&quot;)    local str_meminfo     = io_meminfo:read(&quot;*a&quot;)    io.close(io_meminfo)     local total           = str_meminfo:match(&quot;MemTotal:%s+(%d+)&quot;)    local free            = str_meminfo:match(&quot;MemFree:%s+(%d+)&quot;)    local buffers         = str_meminfo:match(&quot;Buffers:%s+(%d+)&quot;)    local cached          = str_meminfo:match(&quot;Cached:%s+(%d+)&quot;)    local swap_total      = str_meminfo:match(&quot;SwapTotal:%s+(%d+)&quot;)    local swap_free       = str_meminfo:match(&quot;SwapFree:%s+(%d+)&quot;)    local swap_cached     = str_meminfo:match(&quot;SwapCached:%s+(%d+)&quot;)     local total_free      = free + buffers + cached    local total_swap_free = swap_free + swap_cached     local p_mem           = 100*(total - total_free)\/total    local mem_color       = get_colorload(p_mem)    local sw_mem          = 100*(swap_total - total_swap_free)\/swap_total    local sw_mem_color    = get_colorload(sw_mem)     local p_mem           = 100*(total - total_free)\/total    local mem_color       = get_colorload(p_mem)    local sw_mem          = 100*(swap_total - total_swap_free)\/swap_total    local sw_mem_color    = get_colorload(sw_mem)     membox:set_markup(enbrace(                              colorify('mem: ', 'orange')                              ..colorify(string.format('%2d%%', p_mem), mem_color)                              ..'('..colorify(string.format('%3dMb', (total - total_free)\/1024), mem_color)                              ..colorify(string.format('\/%3dMb', (total)\/1024), 'white')                              ..')'                              ..' | '                              ..colorify('swap: ', 'orange')                              ..colorify(string.format('%2d%%', sw_mem), sw_mem_color)                              ..'('..colorify(string.format('%3dMb', (swap_total - total_swap_free)\/1024), sw_mem_color)                              ..colorify(string.format('\/%3dMb', (swap_total)\/1024), 'white')                              ..')'                             )                      ) end memory() one_sec_timer:connect_signal(&quot;timeout&quot;, memory)  -- CPU usage widget cpugraph = awful.widget.graph() cpugraph:set_width(75) cpugraph:set_height(25) cpugraph:set_background_color(&quot;#494B4F&quot;) --cpugraph:set_color(&quot;#FF5656&quot;) cpugraph:set_color({ type = &quot;horisontal&quot;, from = { 0, 0 }, to = { 0, 20 }, stops = { { 0, &quot;#FF5656&quot; }, { 0.5, &quot;#88A175&quot; }, { 1, &quot;#AECF96&quot; } }}) -- Register CPU widget vicious.register(cpugraph, vicious.widgets.cpu,                      function (widget, args)                         return args[1]                     end) cpubox = wibox.widget.textbox() cpubox_img = wibox.widget.imagebox() cpu_arr = {} cpu0_arr = {} cpu1_arr = {} for i = 0, 4 do    cpu_arr[i] = 0    cpu0_arr[i] = 0    cpu1_arr[i] = 0 end function parse_cpu(cpu, stat)    local cpu_new = {}    local ret = {}    cpu_new[0], cpu_new[1], cpu_new[2], cpu_new[3], cpu_new[4] = stat:match(&quot;cpu%d*%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)&quot;)     local idle   = (cpu_new[3] - cpu[3]) + (cpu_new[4] - cpu[4])    local user   = (cpu_new[1] - cpu[1]) + (cpu_new[0] - cpu[0])    local system = (cpu_new[2] - cpu[2])    local total  = idle + user + system    local busy   = user + system     ret['busy'] = busy*100\/total    ret['sys'] = system*100\/total    ret['user'] = user*100\/total    ret['cpu'] = cpu_new     return ret end  function cpu()    local io_stat  = io.open(&quot;\/proc\/stat&quot;)    local str_stat = io_stat:read(&quot;*l&quot;)    io.close(io_stat)     local ret = parse_cpu(cpu_arr, str_stat)    cpu_arr = ret['cpu']       cpubox:set_markup (enbrace(colorify('cpu: ', 'orange')                        ..'('                        ..colorify(string.format('%3d%%', ret['busy']), get_colorload(ret['busy']))                        ..') | (u:'                        ..colorify(string.format('%3d%%', ret['user']), get_colorload(ret['user']))                        ..', s:'                        ..colorify(string.format('%3d%%', ret['sys']), get_colorload(ret['sys']))                        ..')')) end  cpu() one_sec_timer:connect_signal(&quot;timeout&quot;, cpu)  \t\t     hddbox = wibox.widget.textbox() hdd_r = 0 hdd_w = 0 hddlist = {'\/sys\/block\/sda\/stat', '\/sys\/block\/sdb\/stat'}  function hdd()    local new_r = 0    local new_w = 0    for i = 1, 2 do       local io_stat = io.open(hddlist[i])       local str_stat = io_stat:read(&quot;*a&quot;)       io.close(io_stat)       local rd, wr = str_stat:match(&quot;%s+%d+%s+%d+%s+(%d+)%s+%d+%s+%d+%s+%d+%s+(%d+)&quot;)       new_w = new_w + wr       new_r = new_r + rd    end    local r = (new_r - hdd_r)\/2    local w = (new_w - hdd_w)\/2    hdd_w = new_w    hdd_r = new_r     hddbox:set_markup ( enbrace(colorify('i\/o: ', 'orange')                        ..'(r: '                        ..colorify(format_throughput(r), 'green')                        ..', w:'                        ..colorify(format_throughput(w), 'green')                        ..')')) end -- RAM usage widget memwidget = awful.widget.progressbar() memwidget:set_width(30) memwidget:set_height(25) memwidget:set_vertical(true) memwidget:set_background_color('#494B4F') memwidget:set_color('#AECF96') cpugraph:set_color({ type = &quot;linear&quot;, from = { 0, 0 }, to = { 0, 20 }, stops = { { 0, &quot;#AECF96&quot; }, { 0.5, &quot;#88A175&quot; }, { 1, &quot;#FF5656&quot; } }})  vicious.cache(vicious.widgets.mem) vicious.register(memwidget, vicious.widgets.mem,                 function (widget, args)                     return args[1]                  end, 1)                  --update every 13 seconds  hdd() one_sec_timer:connect_signal(&quot;timeout&quot;, hdd)   -- Start timers to update widgets one_sec_timer:start() ten_sec_timer:start() -- \u0427\u0430\u0441\u044b \u0438 \u0434\u0430\u0442\u0430 text_clock = awful.widget.textclock() -- Create a systray systray = wibox.widget.systray() <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0417\u043d\u0430\u044e, \u0447\u0442\u043e \u0432\u0435\u0440\u0445\u043d\u044e\u044e \u0438 \u043d\u0438\u0436\u043d\u044e\u044e \u043f\u0430\u043d\u0435\u043b\u044c \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435, \u0430 \u043d\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0442\u044c, \u0438 \u0442\u0430\u043a \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0434\u0430\u0436\u0435 \u0433\u0440\u0430\u043c\u043e\u0442\u043d\u0435\u0435, \u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u0440\u0443\u043a\u0438 \u043d\u0435 \u0434\u043e\u0445\u043e\u0434\u044f\u0442 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c. \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0442\u0435\u0433\u0438 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c \u0432\u0438\u0434\u0436\u0435\u0442\u044b.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0430\u043d\u0435\u043b\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"lua\">-------------------------------------------------- --- \u0414\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u044d\u0433\u043e\u0432 #1 --- -------------------------------------------------- main_wibox = {} prompt_box = {} layout_box = {} tag_list = {} -- \u0417\u0430\u0434\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043a\u043d\u043e\u043f\u043e\u043a \u043c\u044b\u0448\u0438 \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0442\u0435\u0433\u043e\u0432 tag_list.buttons = awful.util.table.join(                  -- \u041e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0442\u044d\u0433                  awful.button({ }, left_button, awful.tag.viewonly ),                  -- \u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u044d\u0433                  awful.button({ modkey }, left_button, awful.client.movetotag ),                  -- \u041e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0442\u044d\u0433 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0442\u0435\u043a\u0443\u0449\u0438\u043c                  awful.button({ }, right_button, awful.tag.viewtoggle ),                  -- \u041e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u043b\u0438\u0435\u043d\u0442 \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0438 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u0442\u044d\u0433\u0435                  awful.button({ modkey }, right_button, awful.client.toggletag ),                  -- \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0442\u044d\u0433                  awful.button({ }, plus_button, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end ),                  -- \u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0442\u044d\u0433                  awful.button({ }, minus_button, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end ) ) --------------------------------------------------- --- \u0414\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0434\u0430\u0447 #1 --- --------------------------------------------------- -- \u0417\u0430\u0434\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043a\u043d\u043e\u043f\u043e\u043a \u043c\u044b\u0448\u0438 \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 task_list = {} task_list.buttons = awful.util.table.join(                   -- \u041b\u0435\u0432\u0430\u044f \u043a\u043d\u043e\u043f\u043a\u0430                   awful.button({ }, left_button, function(c)                                -- \u0415\u0441\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442 \u0438\u043c\u0435\u0435\u0442 \u0444\u043e\u043a\u0443\u0441 - \u0441\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0435\u0433\u043e                                if c == client.focus then                                   c.minimized = true                                else -- \u0418\u043d\u0430\u0447\u0435, \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0444\u043e\u043a\u0443\u0441 \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442 \u043d\u0435 \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044f                                   c.minimized = false                                    -- \u0438 \u0435\u0449\u0451 \u0432\u043e\u0442 \u044d\u0442\u0430 \u0445\u0440\u0435\u043d\u044c, \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043d\u0435 \u043f\u043e\u043a\u0430 \u043d\u0435 \u044f\u0441\u043d\u043e                                   if not c:isvisible() then \t                             awful.tag.viewonly(c:tags()[1])                                   end                                   client.focus = c                                   c:raise()                                end                   end),                   -- \u0429\u0435\u043b\u0447\u043e\u043a \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439                   awful.button({ }, right_button, function(c)                                if instance then                                   instance:hide()                                   instance = nil                                else                                   instance = awful.menu.clients({ width=250 })                                end                   end),                   -- \u0421\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0444\u043e\u043a\u0443\u0441 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043e\u043a\u043d\u043e                   awful.button({ }, plus_button, function ()                                awful.client.focus.byidx(1)                                if client.focus then                                    client.focus:raise()                                end                   end),                   -- \u0421\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0444\u043e\u043a\u0443\u0441 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u043e\u043a\u043d\u043e                   awful.button({ }, minus_button, function()                                awful.client.focus.byidx(-1)                                if client.focus then                                    client.focus:raise()                                end                   end) )  -------------------------------------------------------------------------- --- \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u044c \u0437\u0430\u0434\u0430\u0447 #1 --- --------------------------------------------------------------------------- -- \u0426\u0438\u043a\u043b, \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u044e\u0449\u0438\u0439 \u0432\u0441\u0435 \u044d\u043a\u0440\u0430\u043d\u044b for s = 1, screen.count() do   -- \u0421\u043f\u0438\u0441\u043e\u043a \u0442\u044d\u0433\u043e\u0432: \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043d\u043e\u043c\u0435\u0440 \u044d\u043a\u0440\u0430\u043d\u0430, \u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043d\u043e\u043f\u043e\u043a \u043c\u044b\u0448\u0438   tag_list[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, tag_list.buttons)   -- \u0421\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447: \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043d\u043e\u043c\u0435\u0440 \u044d\u043a\u0440\u0430\u043d\u0430, \u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043d\u043e\u043f\u043e\u043a \u043c\u044b\u0448\u0438   task_list[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, task_list.buttons)   -- \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 - \u043d\u0430\u0448\u0430 \u043f\u0430\u043d\u0435\u043b\u044c \u0437\u0430\u0434\u0430\u0447   -- \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u0432\u043d\u0438\u0437\u0443 \u044d\u043a\u0440\u0430\u043d\u0430 \u043d\u043e\u043c\u0435\u0440 s \u0438 \u0448\u0438\u0440\u0438\u043d\u043e\u0439   main_wibox[s] = awful.wibox({ position = &quot;top&quot;, height = &quot;28&quot;, screen = s })   -- \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0441\u043b\u0435\u0432\u0430  (\u043b\u0435\u0432\u044b\u0439 \u0431\u043b\u043e\u043a \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432)   local left_layout = wibox.layout.fixed.horizontal()   -- \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430 \u043b\u0435\u0432\u044b\u0439 \u0431\u043b\u043e\u043a \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e   left_layout:add(launcher) -- \u043b\u0430\u0443\u043d\u0447\u0435\u0440 (\u043a\u043d\u043e\u043f\u043a\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044e)   left_layout:add(tag_list[s]) -- \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u044d\u0433\u043e\u0432   -- \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0441\u043f\u0440\u0430\u0432\u0430   local right_layout = wibox.layout.fixed.horizontal()   -- \u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0442\u0440\u0435\u0439 \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u044d\u043a\u0440\u0430\u043d\u0435, \u0432\u0437\u044f\u0442\u043e \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0430   if s == 1 then right_layout:add(wibox.widget.systray()) end   -- \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c   right_layout:add(volumecfg.widget)   right_layout:add(text_clock) -- \u0422\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0447\u0430\u0441\u044b   -- \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043b\u044f \u0432\u0441\u0435\u0439 \u043f\u0430\u043d\u0435\u043b\u0438 \u0437\u0430\u0434\u0430\u0447   local layout = wibox.layout.align.horizontal()   layout:set_left(left_layout)   layout:set_middle(task_list[s])   layout:set_right(right_layout)   main_wibox[s]:set_widget(layout) end  -------------------------------------------------- --- \u0414\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u044d\u0433\u043e\u0432 #2 --- -------------------------------------------------- bottom_wibox = {} bottom_prompt_box = {} botton_layout_box = {}  --------------------------------------------------------------------------- --- \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u044c \u0437\u0430\u0434\u0430\u0447 #2 --- --------------------------------------------------------------------------- -- \u0426\u0438\u043a\u043b, \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u044e\u0449\u0438\u0439 \u0432\u0441\u0435 \u044d\u043a\u0440\u0430\u043d\u044b for s = 1, screen.count() do -- \u041a\u043d\u043e\u043f\u043a\u0430 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u043a\u0435\u0442\u043e\u0432 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e\u043a\u043e\u043d layout_box[s] = awful.widget.layoutbox(s) -- \u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u0443\u0435\u043c \u0434\u043b\u044f \u043d\u0435\u0451 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043d\u043e\u043f\u043e\u043a \u043c\u044b\u0448\u0438 layout_box[s]:buttons(awful.util.table.join(        -- \u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043d\u0430 \u043c\u0430\u043a\u0435\u0442 \u0432\u043f\u0435\u0440\u0435\u0434        awful.button({ }, left_button, function () awful.layout.inc(layouts, 1) end),        -- \u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043d\u0430 \u043c\u0430\u043a\u0435\u0442 \u043d\u0430\u0437\u0430\u0434         awful.button({ }, right_button, function () awful.layout.inc(layouts, -1) end)   ) )   -- \u041a\u043e\u043c\u0430\u043d\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 - \u0432\u0438\u0434\u0436\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 \u0437\u0430\u0434\u0430\u0447 bottom_prompt_box[s] = awful.widget.prompt()   -- \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 - \u043d\u0430\u0448\u0430 \u043f\u0430\u043d\u0435\u043b\u044c \u0437\u0430\u0434\u0430\u0447   -- \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u0432\u043d\u0438\u0437\u0443 \u044d\u043a\u0440\u0430\u043d\u0430 \u043d\u043e\u043c\u0435\u0440 s \u0438 \u0448\u0438\u0440\u0438\u043d\u043e\u0439 \u0432 px bottom_wibox[s] = awful.wibox({ position = &quot;bottom&quot;, height = &quot;25&quot;, screen = s })   -- \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0441\u043b\u0435\u0432\u0430  (\u043b\u0435\u0432\u044b\u0439 \u0431\u043b\u043e\u043a \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432) local l_layout = wibox.layout.fixed.horizontal()   -- \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430 \u043b\u0435\u0432\u044b\u0439 \u0431\u043b\u043e\u043a \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e l_layout:add(bottom_prompt_box[s]) -- \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 l_layout:add(spacer_small)         -- otstup l_layout:add(cpubox) l_layout:add(cpugraph) l_layout:add(spacer_small) l_layout:add(membox) l_layout:add(memwidget)   -- \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0441\u043f\u0440\u0430\u0432\u0430 local r_layout = wibox.layout.fixed.horizontal() r_layout:add(hddbox) r_layout:add(spacer_small) r_layout:add(batterybox) r_layout:add(spacer_small) r_layout:add(layout_box[s]) -- \u041a\u043d\u043e\u043f\u043a\u0443 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u043a\u0435\u0442\u043e\u0432   -- \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043b\u044f \u0432\u0441\u0435\u0439 \u043f\u0430\u043d\u0435\u043b\u0438 \u0437\u0430\u0434\u0430\u0447 local lay = wibox.layout.align.horizontal() lay:set_left(l_layout) --lay:set_middle() lay:set_right(r_layout) bottom_wibox[s]:set_widget(lay) end <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/214467\/\"> http:\/\/habrahabr.ru\/post\/214467\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0435\u0433\u043e \u0442.\u043d. \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u0430 \u0441 WM Awesome<\/p>\n<p>  <a href=\"http:\/\/habrahabr.ru\/post\/214411\/\">\u041f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0438 \u0442\u0443\u0442.<\/a><\/p>\n<p>  \u0422\u0443\u0442 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u0421\u0440\u0430\u0437\u0443 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0431\u0430\u0433 \u2014 \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u00ab\u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0437\u0432\u0443\u043a\u00bb \u0437\u0432\u0443\u043a \u0438\u0441\u0447\u0435\u0437\u0430\u0435\u0442, \u043f\u0440\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u043c \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u2014 \u043d\u0430 \u0432\u0438\u0434\u0436\u0435\u0442\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442, \u0447\u0442\u043e \u0437\u0432\u0443\u043a \u0432\u043a\u043b\u044e\u0447\u0451\u043d, \u043d\u043e \u0435\u0433\u043e \u043d\u0435\u0442\u0443. \u041f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u0441\u0442\u0440\u0430\u043d\u043d\u043e. \u041f\u043e\u043a\u0430 \u043d\u0435 \u043d\u0430\u0448\u0451\u043b \u043a\u0430\u043a \u0435\u0433\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c. \u0418 \u0435\u0449\u0451 \u0441\u043c\u0443\u0449\u0430\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043d\u0438\u0435 \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u0438 \u2014 90% \u043f\u043e \u0444\u0430\u043a\u0442\u0443 ~70 \u0435\u0434\u0438\u043d\u0438\u0446 \u0432 alsamixer, \u043d\u0430\u0434\u043e \u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u043d\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0434\u043e\u0439\u0434\u0451\u0442 \u0440\u0443\u043a\u0438. \u041d\u0443 \u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u043e\u0434\u0435 \u043a\u0430\u043a \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-214467","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/214467","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=214467"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/214467\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=214467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=214467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=214467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}