Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local gears = require("gears")
- local awful = require("awful")
- awful.rules = require("awful.rules")
- require("awful.autofocus")
- local wibox = require("wibox")
- local beautiful = require("beautiful")
- local naughty = require("naughty")
- local vicious = require("vicious")
- local docklist = require("docklist")
- local docktag = require("docktag")
- local lgi = require("lgi")
- local nw_wdgt = require("nw_wdgt")
- local scheduler = require('scheduler')
- local cairo = lgi.cairo
- local capi = {
- screen = screen
- }
- local scrgeom = capi.screen[1].geometry
- --]]------------------------------------------------------------------------------
- uh = os.getenv("HOME")
- uhaw = uh.."/.config/awesome"
- terminal1 = "/usr/bin/urxvt -g 160x48+10+30 "
- terminal2 = "/usr/bin/xterm -g 140x42+510+230 "
- terminal3 = "/usr/bin/xterm -name 'ppp_up_modem' -g 190x54+10+30 "
- top_dmenu = "dmenu_run -nb '#000000' -nf '#888888' -sb '#000000' -sf '#0090d0' -p "..
- " 'Run: ' -fn '-xos4-terminus-medium-r-normal-*-12-120-72-72-c-60-iso10646-1'"
- font_awesome = "Terminus 8"; -- основной
- font_desk = "DigifaceWide";
- font_tooltip = "Terminus 10";
- modkey = "Mod4"
- --]]------------------------------------------------------------------------------
- beautiful.init(uhaw.."/theme.lua")
- --]]------------------------------------------------------------------------------
- if awesome.startup_errors then
- naughty.notify(
- {
- font = font_awesome,
- preset = naughty.config.presets.critical,
- title = "Ошибка на старте!",
- text = awesome.startup_errors
- -- timeout = 10
- }
- )
- end
- --]]------------------------------------------------------------------------------
- do
- local in_error = false
- awesome.connect_signal("debug::error", function (err)
- if in_error then return end
- in_error = true
- naughty.notify(
- {
- font = font_awesome,
- preset = naughty.config.presets.critical,
- title = "Ошибка времени исполнения!",
- text = err
- -- timeout = 10
- }
- )
- in_error = false
- end)
- end
- --]]------------------------------------------------------------------------------
- local layouts =
- {
- awful.layout.suit.max,
- awful.layout.suit.floating,
- awful.layout.suit.tile.right,
- awful.layout.suit.tile.bottom
- }
- --]]------------------------------------------------------------------------------
- if (beautiful.wallpaper1) then
- gears.wallpaper.maximized(beautiful.wallpaper1, 1, false)
- end
- if (beautiful.wallpaper2) and (screen.count() == 2) then
- gears.wallpaper.maximized(beautiful.wallpaper2, 2, false)
- end
- --]]------------------------------------------------------------------------------
- local tags0 = {
- names = { "~", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-" },
- 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] },
- keynum = { "49", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20" }
- }
- local tags1 = {
- names = { "+" },
- layout = { layouts[3] },
- keynum = { "21" }
- }
- local tags = {}
- local tags2 = {}
- --]]------------------------------------------------------------------------------
- tags = awful.tag(tags0.names, 1, tags0.layout)
- if screen.count() == 2 then
- tags2 = awful.tag(tags1.names, 2, tags1.layout)
- end
- --]]------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- function wt( tx, wdt, s )
- local w = string.len(tx)
- if s == 0 then
- tx = string.rep(" ", wdt-w)..tx
- else
- tx = tx..string.rep(" ", wdt-w)
- end
- return tx
- end
- --]]------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- function dec_col(c)
- -- функция декодировки цвета -----------------------------------------------
- return ((c / 0x1000000) % 0x100) / 255., ((c / 0x10000) % 0x100) / 255., ((c / 0x100) % 0x100) / 255., (c % 0x100) / 255.
- end
- --]]------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- n_cpu = 2
- gr_cpu = {}
- for i = 1,n_cpu do
- gr_cpu[i] = awful.widget.graph()
- gr_cpu[i]:set_stack(true):set_max_value(100)
- gr_cpu[i]:set_background_color(beautiful.graph)
- gr_cpu[i]:set_stack_colors({beautiful.prbgrptop})
- end
- tx_cpu = wibox.widget.textbox()
- tx_cpu:set_align("center")
- --]]------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- gr_mem = awful.widget.graph()
- gr_mem:set_stack(true):set_max_value(100):set_scale(false)
- gr_mem:set_background_color(beautiful.graph)
- gr_mem:set_stack_colors({"#ffffff","#005090","#5090d0"})
- tx_mem = wibox.widget.textbox()
- tx_mem:set_align("center")
- --]]------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- n_dev = { "sda5", "sda6", "sda7", "sda8", "sda9" }
- gr_dio = {}
- for i in pairs(n_dev) do
- gr_dio[i] = awful.widget.graph()
- gr_dio[i]:set_stack(true):set_scale(true)
- gr_dio[i]:set_background_color(beautiful.graph)
- gr_dio[i]:set_stack_colors({ "#5090d0", "#005090"})
- end
- tx_dio = wibox.widget.textbox()
- tx_dio:set_align("center")
- --]]------------------------------------------------------------------------------
- --[[------------------------------------------------------------------------------
- n_net = { "enp2s0f0", "wlp3s0", "ppp0" }
- gr_nio = {}
- for i in pairs(n_dev) do
- gr_nio[i] = awful.widget.graph()
- gr_nio[i]:set_stack(true):set_scale(true)
- gr_nio[i]:set_background_color(beautiful.graph)
- gr_nio[i]:set_stack_colors({ "#5090d0", "#005090"})
- end
- tx_nio = wibox.widget.textbox()
- tx_nio:set_align("center")
- --]]------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- scheduler.register_recurring("updt_cpu", 2.5,
- function ()
- local cu = get_cpu_usage()
- local ct = get_cpu_temp()
- for i = 1,n_cpu do
- gr_cpu[i]:add_value(cu[i+1],1)
- end
- tx_cpu:set_markup('<span font="'..font_awesome..'" color="'..beautiful.lwh..'">'.."C1:" .. wt(cu[2].."%", 4, 0) .. "/" .. wt(ct[2].."°", 4, 0).." "..
- "C2:" .. wt(cu[3].."%", 4, 0) .. "/" .. wt(ct[3].."°", 4, 0)..'</span>')
- end
- )
- scheduler.register_recurring("updt_dio", 2,
- function ()
- local hs = get_hddtemp_sda()
- local dio = get_disk_dio()
- for i in pairs(n_dev) do
- gr_dio[i]:add_value(dio["{"..n_dev[i].." read_mb}"], 2)
- gr_dio[i]:add_value(dio["{"..n_dev[i].." write_mb}"], 1)
- end
- tx_dio:set_markup('<span font="'..font_awesome..'" color="'..beautiful.lwh..'"> HDD t°C : ' .. hs[1] .. '° </span>')
- end
- )
- scheduler.register_recurring("updt_mem", 4,
- function ()
- local mm = get_mem_used()
- gr_mem:add_value(mm[13],3)
- gr_mem:add_value(mm[11],2)
- gr_mem:add_value(mm[1],1)
- tx_mem:set_markup('<span font="'..font_awesome..'" color="'..beautiful.lwh..'">MU: ' .. wt(mm[2], 5, 0) .. "M " ..
- "SW: " .. wt(mm[6], 5, 0) .. "M\n" ..
- "MB: " .. wt(mm[10], 5, 0) .. "M " ..
- "MC: " .. wt(mm[12], 5, 0) .. 'M</span>')
- end
- )
- --[[
- scheduler.register_recurring("updt_nio", 1.5,
- function ()
- local nio = get_net_io()
- for i in pairs(n_net) do
- gr_nio[i]:add_value(nio["{"..n_net[i].." down_kb}"], 2)
- gr_nio[i]:add_value(nio["{"..n_net[i].." up_kb}"], 1)
- end
- local outp = '<span font="'..font_awesome..'" color="'..beautiful.lwh..'">'..wt('Down | Up', 16, 0)..'\n'
- for i in pairs(n_net) do
- outp = outp .. wt(n_net[i], 8, 1)
- if nio["{"..n_net[i].." carrier}"] == 1 then
- outp = outp .. wt(nio["{"..n_net[i].." down_kb}"], 7, 0) .. ' | ' ..
- wt(nio["{"..n_net[i].." up_kb}"], 6, 1) .. '\n'
- else
- outp = outp .. wt("-", 7, 0) .. ' | ' ..
- wt("-", 6, 1) .. "\n"
- end
- end
- local outp = outp .. '</span>'
- tx_nio:set_markup(outp)
- end
- )
- --]]
- prgb_mpd = awful.widget.progressbar()
- prgb_mpd:set_border_color(beautiful.border_prgb)
- prgb_mpd:set_background_color(beautiful.prgb)
- prgb_mpd:set_color( beautiful.infom )
- tx_mpd = wibox.widget.textbox()
- tx_mpd:set_valign("center")
- tx_tme = wibox.widget.textbox()
- tx_tme:set_align("center")
- btn_mpd = {
- { img = wibox.widget.imagebox(uhaw.."/icons/buttons/prev.png" , false), img_cmd = "mpc prev "},
- { img = wibox.widget.imagebox(uhaw.."/icons/buttons/play.png" , false), img_cmd = "mpc play "},
- { img = wibox.widget.imagebox(uhaw.."/icons/buttons/pause.png", false), img_cmd = "mpc pause "},
- { img = wibox.widget.imagebox(uhaw.."/icons/buttons/stop.png" , false), img_cmd = "mpc stop "},
- { img = wibox.widget.imagebox(uhaw.."/icons/buttons/next.png" , false), img_cmd = "mpc next "}
- }
- stat_mpd = {
- -- { img = wibox.widget.imagebox(uhaw.."/icons/buttons/consume_off.png", false), img_cmd = "mpc consume "},
- { img = wibox.widget.imagebox(uhaw.."/icons/buttons/random_off.png" , false), img_cmd = "mpc random "},
- { img = wibox.widget.imagebox(uhaw.."/icons/buttons/repeat_off.png" , false), img_cmd = "mpc repeat "},
- { img = wibox.widget.imagebox(uhaw.."/icons/buttons/single_off.png" , false), img_cmd = "mpc single "},
- }
- scheduler.register_recurring("updt_mpd", 1,
- function ()
- local function crop(str,i)
- if string.len(str) > i then
- return string.sub(str,1,i-2)..".."
- else
- return str
- end
- end
- local function tn(i)
- if string.len(i) == 1 then
- return "0" .. i
- else
- return i
- end
- end
- local info = {}
- local mpc = awful.util.pread('mpc -f "title: %title%\nartist: %artist%\nalbum: %album%\nduration: %time%"'):gsub(" ", "\n"):gsub("&", "")
- info["progress"] = tonumber(string.match(mpc, "(%d+)%%"))
- minutes = tonumber(string.match(mpc, "(%d+)%:%d%d%/"))
- seconds = tonumber(string.match(mpc, "%:(%d+)%/"))
- if (( minutes ~= "" ) and ( minutes ~= nil )) and
- (( seconds ~= "" ) and ( seconds ~= nil )) then
- times = minutes .. ":" .. tn(seconds)
- else
- times = "0:00"
- end
- -- naughty.notify({timeout = 0.5, font = font_awesome, title = "dbi", text = tn(info1) .. ":" .. tn(info2) })
- for i, v in string.gmatch(mpc,"(%w+): ([^\n]+)") do
- info[i]=v
- end
- prgb_mpd:set_max_value(100)
- prgb_mpd:set_value(info["progress"])
- local outp = '<span font="'..font_awesome..'" color="'..beautiful.lwh..'">'
- if (info["title"] ~= "") and (info["title"] ~= nil) then
- outp = outp .. crop(info["title"],50)
- else
- outp = outp .. "no title"
- end
- local outp = outp .. '\n'
- local aa = ""
- if (info["artist"] ~= "") and (info["artist"] ~= nil) then
- aa = aa .. crop(info["artist"],50)
- else
- info["year"] = "no artist"
- aa = aa .. "no artist"
- end
- local aa = aa .. ' - '
- if (info["album"] ~= "") and (info["album"] ~= nil) then
- aa = aa .. crop(info["album"],50)
- else
- info["year"] = "no album"
- aa = aa .. "no album"
- end
- if string.len(aa) > 60 then
- outp = outp .. crop(info["artist"],25) .. ' - ' .. crop(info["album"],25)
- else
- outp = outp .. aa
- end
- local outp = outp .. '\n'
- tx_mpd:set_markup(outp .. '</span>')
- if (info["duration"] ~= "") and (info["duration"] ~= nil) then
- tx_tme:set_markup('<span font="'..font_awesome..'" color="'..beautiful.lwh..'">'..times.."/"..info["duration"]..'</span>')
- else
- tx_tme:set_markup("")
- end
- --[[
- if info["consume"] == "on" then
- stat_mpd[1].img:set_image(uhaw.."/icons/buttons/consume_on.png")
- naughty.notify({timeout = 0.5, font = font_awesome, title = "dbi", text = "xyi" })
- elseif info["consume"] == "off" then
- stat_mpd[1].img:set_image(uhaw.."/icons/buttons/consume_off.png")
- end
- ]]
- if info["random"] == "on" then
- stat_mpd[1].img:set_image(uhaw.."/icons/buttons/random_on.png")
- elseif info["random"] == "off" then
- stat_mpd[1].img:set_image(uhaw.."/icons/buttons/random_off.png")
- end
- if info["repeat"] == "on" then
- stat_mpd[2].img:set_image(uhaw.."/icons/buttons/repeat_on.png")
- elseif info["repeat"] == "off" then
- stat_mpd[2].img:set_image(uhaw.."/icons/buttons/repeat_off.png")
- end
- if info["single"] == "on" then
- stat_mpd[3].img:set_image(uhaw.."/icons/buttons/single_on.png")
- elseif info["single"] == "off" then
- stat_mpd[3].img:set_image(uhaw.."/icons/buttons/single_off.png")
- end
- -- prgb_db:set_value(math.floor(dbi["e"]/dbi["l"]*100))
- -- naughty.notify({timeout = 0.5, font = font_awesome, title = "dbi", text = info["progress"] })
- end
- )
- --]]------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- btn_scr = {
- { img = wibox.widget.imagebox(uhaw.."/icons/screen/LVDS-only.png" , false), img_cmd=terminal2.." -e bash "..uhaw.."/script/ch_md_scr LVDS-only" },
- { img = wibox.widget.imagebox(uhaw.."/icons/screen/LVDS+VH.png" , false), img_cmd=terminal2.." -e bash "..uhaw.."/script/ch_md_scr LVDS+VH" },
- { 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" },
- { img = wibox.widget.imagebox(uhaw.."/icons/screen/LVDS-off.png" , false), img_cmd=terminal2.." -e bash "..uhaw.."/script/ch_md_scr LVDS-off" },
- { 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" }
- }
- --]]------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- local tlayoutbox = awful.widget.layoutbox(1)
- local ttaglist = awful.widget.taglist(1, awful.widget.taglist.filter.all, nil, {font = "Terminus 8"}, docktag.update, wibox.layout.fixed.horizontal())
- local ttasklist = awful.widget.tasklist(1, awful.widget.tasklist.filter.currenttags, nil, {font = "Terminus 8"}, docklist.update, wibox.layout.fixed.horizontal())
- --]]------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- local tib = wibox.widget.imagebox(beautiful.ib)
- --------------------------------------------------------------------------------
- local tie = wibox.widget.imagebox(beautiful.ie)
- --------------------------------------------------------------------------------
- local tieb = wibox.widget.imagebox(beautiful.ieb)
- --]]------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- local bwibox = awful.wibox({ position = "bottom", screen = 1, height = 18, opacity = 1.00, bg = beautiful.grdbg })
- -- lwibox[1].visible = false
- local top_layout = wibox.layout.fixed.horizontal()
- top_layout:add(tieb)
- top_layout:add(tlayoutbox)
- top_layout:add(tie)
- top_layout:add(ttaglist)
- top_layout:add(tib)
- top_layout:add(ttasklist)
- local bot_layout = wibox.layout.fixed.horizontal()
- bot_layout:add(tieb)
- -- local cpud = nw_wdgt.cpu()
- -- bot_layout:add(cpud)
- -- bot_layout:add()
- -- bot_layout:add(tieb)
- -- bot_layout:add(tieb)
- -- bot_layout:add(tprgb_htemp)
- -- bot_layout:add(thtemp)
- -- bot_layout:add(tieb)
- -- bot_layout:add(tctemp)
- -- bot_layout:add(tieb)
- -- bot_layout:add(tcpu)
- -- bot_layout:add(tieb)
- -- for i = 1,n_cpu do
- -- bot_layout:add(tprgb_temp[i])
- -- end
- -- bot_layout:add(tieb)
- -- for i = 1,n_cpu do
- -- bot_layout:add(tprgb_cpu[i])
- -- end
- bot_layout:add(wibox.widget.systray())
- bot_layout:add(tieb)
- local llayout = wibox.layout.align.horizontal()
- llayout:set_left(top_layout)
- -- llayout:set_middle(ttasklist)
- llayout:set_right(bot_layout)
- bwibox:set_widget(llayout)
- --]]------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- -- local wb_lb_lay = wibox.layout.xyi.new() -- создание хуй-лайаута
- -- wb_lb_lay:add(wgr_time,{x=0,y=0,width=wbox_all.width,height=wbox_all.height}) -- добавляем в лайаут векторный фон
- --[[ --
- local wb_lb_btn_panel = wibox.layout.flex.horizontal() -- создание флекс-лайаута для кнопок управления мясом
- local wb_lb_btn = { --
- { icon=uhaw.."/icons/buttons/prev_msc.png", cmd="deadbeef --prev > /dev/null"}, -- пред
- { icon=uhaw.."/icons/buttons/play_msc.png", cmd="deadbeef --play > /dev/null"}, -- играть
- { icon=uhaw.."/icons/buttons/pause_msc.png", cmd="deadbeef --pause > /dev/null"}, -- пауза
- { icon=uhaw.."/icons/buttons/stop_msc.png", cmd="deadbeef --stop > /dev/null"}, -- стоп
- { icon=uhaw.."/icons/buttons/next_msc.png", cmd="deadbeef --next > /dev/null"} -- след
- } --
- --
- for i in pairs(wb_lb_btn) do --
- local wb_lb_btns = wibox.widget.imagebox(wb_lb_btn[i].icon) -- создание кнопки
- wb_lb_btns:buttons( awful.util.table.join( -- назначение кнопоке события на левый клик мыши
- awful.button( --
- { }, 1, function () awful.util.spawn(wb_lb_btn[i].cmd) end) --
- ) --
- ) --
- wb_lb_btn_panel:add(wb_lb_btns) -- добавляем в флекс-лайаут кнопки
- end --
- wb_lb_lay:add(wb_lb_btn_panel,{ x = wbox_all.width - 457 , -- добавляем в хуй-лайайут флекс-лайаут
- y = wbox_all.height - 18 - 35, --
- width = 37*5, --
- height = 36}) --
- ]] --
- --[[
- local wb_lb_btn_panel = wibox.layout.flex.horizontal() -- создание флекс-лайаута для кнопок управления конфигурацией дислеев
- local wb_lb_btn = { --
- { icon=uhaw.."/icons/screen/LVDS-only.png", cmd=terminal2.." -e bash "..uhaw.."/script/ch_md_scr LVDS-only"}, -- только ноут
- { icon=uhaw.."/icons/screen/LVDS+VH.png", cmd=terminal2.." -e bash "..uhaw.."/script/ch_md_scr LVDS+VH"}, -- ноут+бол_экран
- { icon=uhaw.."/icons/screen/LVDS+VH-cp.png", cmd=terminal2.." -e bash "..uhaw.."/script/ch_md_scr LVDS+VH-cp"}, -- ноут+бол_экран - копия
- { icon=uhaw.."/icons/screen/LVDS-off.png", cmd=terminal2.." -e bash "..uhaw.."/script/ch_md_scr LVDS-off"}, -- только бол_экраны
- { icon=uhaw.."/icons/screen/LVDS-off-cp.png", cmd=terminal2.." -e bash "..uhaw.."/script/ch_md_scr LVDS-off-cp"} -- только бол_экраны - копия
- } --
- --
- for i in pairs(wb_lb_btn) do --
- local wb_lb_btns = wibox.widget.imagebox(wb_lb_btn[i].icon) -- создание кнопки
- wb_lb_btns:buttons( awful.util.table.join( -- назначение кнопоке события на левый клик мыши
- awful.button( --
- { }, 1, function () awful.util.spawn(wb_lb_btn[i].cmd) end) --
- ) --
- ) --
- wb_lb_btn_panel:add(wb_lb_btns) -- добавляем в флекс-лайаут кнопки
- end --
- wb_lb_lay:add(wb_lb_btn_panel,{ x = 245 - 5*30, -- добавляем в хуй-лайайут флекс-лайаут
- y = 7, --
- width = 5*30, --
- height = 21}) --
- --
- wbox_all:set_widget(wb_lb_lay) -- пихаем хуй-лайаут в большой вибокс
- --
- --]]------------------------------------------------------------------------------ --
- --------------------------------------------------------------------------------
- local cpu_on_xyi = wibox(
- {
- bg = "#111111",
- height = 70,
- width = 160,
- opacity = 0.9,
- ontop = true,
- visible = false
- }
- )
- cpu_on_xyi:geometry(
- {
- x = scrgeom.x + (scrgeom.width - cpu_on_xyi.width) - 5,
- y = scrgeom.y + (scrgeom.height - cpu_on_xyi.height - 18) - 5,
- }
- )
- cpu_on_xyi.screen = 1
- local wb_lb_layout = wibox.layout.xyi.new()
- local h = (cpu_on_xyi.height-5*4)/2.5
- local w = cpu_on_xyi.width-5*2
- for i = 1,n_cpu do
- gr_cpu[i]:set_height(h)
- gr_cpu[i]:set_width(w)
- wb_lb_layout:add(gr_cpu[i],{ x = 5,
- y = 5+(i-1)*(h+5),
- width = w,
- height = h})
- end
- wb_lb_layout:add(tx_cpu,{ x = 5,
- y = cpu_on_xyi.height-h*0.75,
- width = w,
- height = cpu_on_xyi.height-5*4-h*2})
- local bc = wibox.widget.imagebox(beautiful.bc)
- bc:buttons( awful.util.table.join(
- awful.button(
- { }, 1, function () cpu_on_xyi.visible = false end)
- )
- )
- wb_lb_layout:add(bc,{ x = cpu_on_xyi.width - 10 - 2,
- y = 2,
- width = 10,
- height = 10})
- cpu_on_xyi:set_widget(wb_lb_layout)
- --]]------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- local mem_on_xyi = wibox(
- {
- bg = "#111111",
- height = 70,
- width = cpu_on_xyi.width,
- opacity = cpu_on_xyi.opacity,
- ontop = true,
- visible = false
- }
- )
- mem_on_xyi:geometry(
- {
- x = scrgeom.x + (scrgeom.width - cpu_on_xyi.width) - 5,
- y = cpu_on_xyi.y - mem_on_xyi.height - 5,
- }
- )
- mem_on_xyi.screen = 1
- local wb_lb_layout = wibox.layout.xyi.new()
- local h = (mem_on_xyi.height-5*3)/1.8
- local w = mem_on_xyi.width-5*2
- gr_mem:set_height(h)
- gr_mem:set_width(w)
- wb_lb_layout:add(gr_mem,{ x = 5,
- y = 5,
- width = w,
- height = h})
- wb_lb_layout:add(tx_mem,{ x = 5,
- y = 5*2+h,
- width = w,
- height = mem_on_xyi.height - h - 5*3})
- local bc = wibox.widget.imagebox(beautiful.bc)
- bc:buttons( awful.util.table.join(
- awful.button(
- { }, 1, function () mem_on_xyi.visible = false end)
- )
- )
- wb_lb_layout:add(bc,{ x = mem_on_xyi.width - 10 - 2,
- y = 2,
- width = 10,
- height = 10})
- mem_on_xyi:set_widget(wb_lb_layout)
- --]]------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- local dio_on_xyi = wibox(
- {
- bg = "#111111",
- height = cpu_on_xyi.height + 5 + mem_on_xyi.height,
- width = mem_on_xyi.width,
- opacity = mem_on_xyi.opacity,
- ontop = true,
- visible = false
- }
- )
- dio_on_xyi:geometry(
- {
- -- x = cpu_on_xyi.x - 5 - dio_on_xyi.width,
- x = mem_on_xyi.x,
- y = mem_on_xyi.y - dio_on_xyi.height - 5,
- }
- )
- dio_on_xyi.screen = 1
- local wb_lb_layout = wibox.layout.xyi.new()
- local h = (dio_on_xyi.height-5*8)/5.4
- local w = dio_on_xyi.width-5*2
- for i in pairs(n_dev) do
- gr_dio[i]:set_height(h)
- gr_dio[i]:set_width(w)
- wb_lb_layout:add(gr_dio[i],{ x = 5,
- y = 5+(i-1)*(h+5),
- width = w,
- height = h})
- end
- wb_lb_layout:add(tx_dio,{ x = 5,
- y = dio_on_xyi.height - h*0.6 - 5,
- width = w,
- height = h*0.6 })
- local bc = wibox.widget.imagebox(beautiful.bc)
- bc:buttons( awful.util.table.join(
- awful.button(
- { }, 1, function () dio_on_xyi.visible = false end)
- )
- )
- wb_lb_layout:add(bc,{ x = dio_on_xyi.width - 10 - 2,
- y = 2,
- width = 10,
- height = 10})
- dio_on_xyi:set_widget(wb_lb_layout)
- --]]------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- local mpd_on_xyi = wibox(
- {
- bg = "#111111",
- height = 80,
- width = 350,
- opacity = dio_on_xyi.opacity,
- ontop = true,
- visible = false
- }
- )
- mpd_on_xyi:geometry(
- {
- -- x = cpu_on_xyi.x - 5 - mpd_on_xyi.width,
- x = 5,
- y = scrgeom.height - mpd_on_xyi.height - 18 - 5,
- }
- )
- mpd_on_xyi.screen = 1
- local wb_lb_layout = wibox.layout.xyi.new()
- local w = mpd_on_xyi.width-5*2
- local box = 24
- for i in pairs(btn_mpd) do
- btn_mpd[i].img:buttons( awful.util.table.join(
- awful.button(
- { }, 1, function () awful.util.spawn(btn_mpd[i].img_cmd, false) end)
- )
- )
- wb_lb_layout:add(btn_mpd[i].img,{ x = 5+(i-1)*(34+2),
- y = mpd_on_xyi.height - 5 - box,
- width = 34,
- height = box})
- end
- for i in pairs(stat_mpd) do
- stat_mpd[i].img:buttons( awful.util.table.join(
- awful.button(
- { }, 1, function () awful.util.spawn(stat_mpd[i].img_cmd, false) end)
- )
- )
- wb_lb_layout:add(stat_mpd[i].img,{ x = 5+36*5+5+(i-1)*(24+2),
- y = mpd_on_xyi.height - 5 - box,
- width = 24,
- height = box})
- end
- wb_lb_layout:add(prgb_mpd,{ x = 5,
- y = mpd_on_xyi.height - 15 - box,
- width = w,
- height = 5})
- wb_lb_layout:add(tx_mpd,{ x = 5,
- y = 5,
- width = w,
- height = mpd_on_xyi.height - 25 - box})
- wb_lb_layout:add(tx_tme,{ x = mpd_on_xyi.width - 80,
- y = mpd_on_xyi.height - 30,
- width = 75,
- height = 25})
- local bc = wibox.widget.imagebox(beautiful.bc)
- bc:buttons( awful.util.table.join(
- awful.button(
- { }, 1, function () mpd_on_xyi.visible = false end)
- )
- )
- wb_lb_layout:add(bc,{ x = mpd_on_xyi.width - 10 - 2,
- y = 2,
- width = 10,
- height = 10})
- mpd_on_xyi:set_widget(wb_lb_layout)
- --]]------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- local scr_on_xyi = wibox(
- {
- bg = "#111111",
- height = 144,
- width = 36,
- opacity = mpd_on_xyi.opacity,
- ontop = true,
- visible = false
- }
- )
- scr_on_xyi:geometry(
- {
- -- x = cpu_on_xyi.x - 5 - scr_on_xyi.width,
- x = 5,
- y = (scrgeom.height - scr_on_xyi.height - 18)/2,
- }
- )
- scr_on_xyi.screen = 1
- local wb_lb_layout = wibox.layout.xyi.new()
- for i in pairs(btn_scr) do
- btn_scr[i].img:buttons( awful.util.table.join(
- awful.button(
- { }, 1, function () awful.util.spawn(btn_scr[i].img_cmd, false) end)
- )
- )
- wb_lb_layout:add(btn_scr[i].img,{ x = 1,
- y = 15+(i-1)*26,
- width = 34,
- height = 24})
- end
- local bc = wibox.widget.imagebox(beautiful.bc)
- bc:buttons( awful.util.table.join(
- awful.button(
- { }, 1, function () scr_on_xyi.visible = false end)
- )
- )
- wb_lb_layout:add(bc,{ x = scr_on_xyi.width - 10 - 2,
- y = 2,
- width = 10,
- height = 10})
- scr_on_xyi:set_widget(wb_lb_layout)
- --]]------------------------------------------------------------------------------
- --[[------------------------------------------------------------------------------
- local nio_on_xyi = wibox(
- {
- bg = "#111111",
- height = dio_on_xyi.height,
- width = dio_on_xyi.width,
- opacity = dio_on_xyi.opacity,
- ontop = true,
- visible = false
- }
- )
- nio_on_xyi:geometry(
- {
- -- x = dio_on_xyi.x - 5 - nio_on_xyi.width,
- x = dio_on_xyi.x,
- y = dio_on_xyi.y - nio_on_xyi.height - 5,
- }
- )
- nio_on_xyi.screen = 1
- local wb_lb_layout = wibox.layout.xyi.new()
- local h = (nio_on_xyi.height-5*8)/4.6
- local w = nio_on_xyi.width-5*2
- for i in pairs(n_net) do
- gr_nio[i]:set_height(h)
- gr_nio[i]:set_width(w)
- wb_lb_layout:add(gr_nio[i],{ x = 5,
- y = 5+(i-1)*(h+5),
- width = w,
- height = h})
- end
- wb_lb_layout:add(tx_nio,{ x = 5,
- y = 5+3*(h+5),
- width = w,
- height = nio_on_xyi.height - (5*2+3*(h+5)) })
- local bc = wibox.widget.imagebox(beautiful.bc)
- bc:buttons( awful.util.table.join(
- awful.button(
- { }, 1, function () nio_on_xyi.visible = false end)
- )
- )
- wb_lb_layout:add(bc,{ x = nio_on_xyi.width - 10 - 2,
- y = 2,
- width = 10,
- height = 10})
- nio_on_xyi:set_widget(wb_lb_layout)
- --]]------------------------------------------------------------------------------
- --[[------------------------------------------------------------------------------
- local wbox_msg = wibox(
- {
- bg = "#111111",
- height = dio_on_xyi.y - 10,
- width = dio_on_xyi.width + 5 + mem_on_xyi.width,
- opacity = 0.9,
- ontop = true,
- visible = false
- }
- )
- wbox_msg:geometry(
- {
- x = scrgeom.x + scrgeom.width - 5 - wbox_msg.width,
- y = scrgeom.y + 5,
- }
- )
- wbox_msg.screen = 1
- local wb_lb_layout = wibox.layout.xyi.new()
- local h = 20
- local w = (wbox_msg.width-5*6)/6
- local l = math.floor(wbox_msg.height/14)
- local txt = wibox.widget.textbox("")
- local bt = {
- -- wibox.widget.textbox('<span color="'..beautiful.infom..'">dmesg</span>'),
- -- wibox.widget.textbox('<span color="'..beautiful.infom..'">slim</span>'),
- wibox.widget.textbox('<span color="'..beautiful.infom..'">acpi</span>'),
- wibox.widget.textbox('<span color="'..beautiful.infom..'">udevm</span>'),
- wibox.widget.textbox('<span color="'..beautiful.infom..'">state</span>'),
- -- wibox.widget.textbox('<span color="'..beautiful.infom..'">rclog</span>'),
- }
- --*
- bt[1]:buttons( awful.util.table.join(
- awful.button(
- { }, 1, function ()
- local f = io.popen("bash " .. uhaw .. "/script/get_dmesg "..l)
- txt:set_markup('<span color="'..beautiful.infom..'">==> dmesg | tail -n xx' .. '\n\n</span>'..
- '<span color="'..beautiful.infot..'">' .. f:read("*all") .. '</span>' .. '\n')
- f:close()
- end
- )
- )
- )
- bt[2]:buttons( awful.util.table.join(
- awful.button(
- { }, 1, function ()
- local f = io.popen("tail -n " .. l .. " /var/log/slim.log | sed 's/<==//g'")
- txt:set_markup('<span color="'..beautiful.infom..'">==> /var/log/slim.log' .. '\n\n</span>'..
- '<span color="'..beautiful.infot..'">' .. f:read("*all") .. '</span>' .. '\n')
- f:close()
- end
- )
- )
- )
- --*
- bt[1]:buttons( awful.util.table.join(
- awful.button(
- { }, 1, function ()
- local f = io.popen("tail -n " .. l .. " /etc/acpi/acpi.log | sed 's/<==//g'")
- txt:set_markup('<span color="'..beautiful.infom..'">==> /etc/acpi/acpi.log' .. '\n\n</span>'..
- '<span color="'..beautiful.infot..'">' .. f:read("*all") .. '</span>' .. '\n')
- f:close()
- end
- )
- )
- )
- bt[2]:buttons( awful.util.table.join(
- awful.button(
- { }, 1, function ()
- local f = io.popen("tail -n " .. l .. " /var/log/udev-mounts.log | sed 's/<==//g'")
- txt:set_markup('<span color="'..beautiful.infom..'">==> /var/log/udev-mounts.log' .. '\n\n</span>'..
- '<span color="'..beautiful.infot..'">' .. f:read("*all") .. '</span>' .. '\n')
- f:close()
- end
- )
- )
- )
- bt[3]:buttons( awful.util.table.join(
- awful.button(
- { }, 1, function ()
- local f = io.popen("tail -n " .. l .. " " .. uhaw .. "/tmpfl/.rw_states")
- txt:set_markup('<span color="'..beautiful.infom..'">==> События' .. '\n\n</span>'..
- '<span color="'..beautiful.infot..'">' .. f:read("*all") .. '</span>' .. '\n')
- f:close()
- end
- )
- )
- )
- --*
- bt[6]:buttons( awful.util.table.join(
- awful.button(
- { }, 1, function ()
- local f = io.popen("tail -n " .. l .. " /var/log/rc.log | sed 's/<==//g'")
- txt:set_markup('<span color="'..beautiful.infom..'">==> /var/log/rc.log' .. '\n\n</span>'..
- '<span color="'..beautiful.infot..'">' .. f:read("*all") .. '</span>' .. '\n')
- f:close()
- end
- )
- )
- )
- --*
- wb_lb_layout:add(txt,{ x = 5,
- y = 5+h+5,
- width = wbox_msg.width-10,
- height = wbox_msg.height-15-h})
- for i in pairs(bt) do
- bt[i]:set_align("center")
- wb_lb_layout:add(bt[i],{ x = 5+(w+5)*(i-1),
- y = 5,
- width = w,
- height = h})
- end
- local bc = wibox.widget.imagebox(beautiful.bc)
- bc:buttons( awful.util.table.join(
- awful.button(
- { }, 1, function () wbox_msg.visible = false end)
- )
- )
- wb_lb_layout:add(bc,{ x = wbox_msg.width - 10 - 2,
- y = 2,
- width = 10,
- height = 10})
- wbox_msg:set_widget(wb_lb_layout)
- --]]------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- globalkeys = awful.util.table.join(
- awful.key({ modkey, }, "Tab", awful.tag.history.restore),
- awful.key({ modkey, }, "l",
- function ()
- awful.client.focus.byidx( 1)
- if client.focus then client.focus:raise() end
- end),
- awful.key({ modkey, }, "j",
- function ()
- awful.client.focus.byidx(-1)
- if client.focus then client.focus:raise() end
- end),
- awful.key({ modkey, "Shift" }, "l", function () awful.client.swap.byidx( 1) end),
- awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( -1) end),
- awful.key({ modkey, "Control" }, "l", function () awful.screen.focus_relative( 1) end),
- awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative(-1) end),
- awful.key({ modkey, }, "u", awful.client.urgent.jumpto),
- awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal1, true, 1) end),
- awful.key({ modkey, "Control" }, "Return", function () awful.util.spawn(terminal2) end),
- awful.key({ modkey, "Control" }, "r",
- function ()
- -- os.execute('bash '..uh..'/.xinitrc reload pan1')
- awesome.restart()
- -- os.execute('bash '..uh..'/.xinitrc reload pan2')
- end),
- -- ),
- awful.key({ modkey, "Shift", "Control" }, "q", awesome.quit),
- awful.key({ modkey, }, "i", function () awful.tag.incmwfact( 0.05) end),
- awful.key({ modkey, }, "k", function () awful.tag.incmwfact(-0.05) end),
- awful.key({ modkey, "Shift" }, "i", function () awful.tag.incnmaster( 1) end),
- awful.key({ modkey, "Shift" }, "k", function () awful.tag.incnmaster(-1) end),
- awful.key({ modkey, "Control" }, "i", function () awful.tag.incncol( 1) end),
- awful.key({ modkey, "Control" }, "k", function () awful.tag.incncol(-1) end),
- awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end),
- awful.key({ modkey, }, "p", function () awful.util.spawn(top_dmenu) end),
- awful.key({ modkey, "Control", "Shift" }, "Return", function ()
- awful.util.spawn("scrot -cd 0.33 -e 'mv $f ~/scrot/'")
- os.execute("sleep 0.5")
- naughty.notify(
- {
- title = ' Скриншот',
- text = ' сделан!.. ',
- timeout = 8,
- hover_timeout = 0.5
- }
- )
- -- os.execute("bash /etc/000_mplayer/play_voice скриншот.mp3&")
- end),
- awful.key({ modkey, "Control", "Shift" }, "r", function () awful.util.spawn("bash " .. uh .. "/.xinitrc reload") end),
- awful.key({ modkey, "Control", "Shift" }, "o", function () awful.util.spawn("bash " .. uh .. "/SCR/.screen_off") end),
- awful.key({ modkey, "Control", "Shift" }, "l", function () awful.util.spawn("libreoffice --nologo") end),
- 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
- --[[
- awful.key({ modkey, "Control", "Shift" }, "w", function () awful.util.spawn("xterm -e 'wvdial ForAll'") end),
- ]]
- -- awful.key({ modkey, "Control", "Shift" }, "m", function () awful.util.spawn(terminal1 .. " -e bash " .. uh .. "/SCR/.load_qip")end),
- awful.key({ modkey, "Control", "Shift" }, "m", function () awful.util.spawn("pidgin") end),
- awful.key({ modkey, "Control", "Shift" }, "n", function () awful.util.spawn("nautilus --no-desktop --browser") end),
- awful.key({ modkey, "Control", "Shift" }, "c", function () awful.util.spawn("conkeror") end),
- -- awful.key({ modkey, "Control", "Shift" }, "i", function () awful.util.spawn("iceweasel") end),
- awful.key({ modkey, "Control", "Shift" }, "i", function () awful.util.spawn("firefox-bin") end),
- awful.key({ modkey, "Control", "Shift" }, "u", function () awful.util.spawn("google-chrome-beta") end),
- awful.key({ modkey, "Control", "Shift" }, "f", function () awful.util.spawn("firefox") end),
- --[[
- awful.key({ modkey, "Control", "Shift" }, "f", function () awful.util.spawn(uhome .. "/.fehbg") end),
- ]]
- awful.key({ modkey, "Control", "Shift" }, "h", function () awful.util.spawn("urxvt -e htop -d 10") end),
- awful.key({ modkey, "Control", "Shift" }, "a", function () awful.util.spawn("urxvt -e alsamixer") end),
- awful.key({ modkey, "Control", "Shift" }, "g", function () awful.util.spawn("geany") end),
- awful.key({ modkey, "Control", "Shift" }, "d", function () awful.util.spawn("deadbeef") end),
- awful.key({ modkey, "Control", "Shift" }, ",", function () awful.util.spawn(terminal2 .. " -e bash " .. uhaw .. '/script/run_1c') end),
- awful.key({ modkey, "Control", "Shift" }, ".", function () awful.util.spawn(terminal2 .. " -e bash " .. uhaw .. '/script/run_1c_local') end),
- awful.key({ modkey, "Control", "Shift" }, "F10", function ()
- naughty.notify(
- {
- title = ' Кол-во экранов ',
- text = ' равно ' .. screen.count() .. ' шт ',
- timeout = 8,
- hover_timeout = 0.5
- }
- )
- end),
- awful.key({ modkey, "Control", "Shift" }, "F11", function ()
- naughty.notify(
- {
- title = ' Нам сказали ',
- text = ' перезагружайся!.. ',
- timeout = 8,
- hover_timeout = 0.5
- }
- )
- os.execute('bash ' .. uhaw .. '/script/rw_st reboot')
- -- os.execute("bash /etc/000_mplayer/play_voice перезагрузка.mp3 &")
- awful.util.spawn("/sbin/reboot")
- end),
- awful.key({ modkey, "Control", "Shift" }, "F12", function ()
- naughty.notify(
- {
- title = ' Нам сказали ',
- text = ' выключайся!.. ',
- timeout = 8,
- hover_timeout = 0.5
- }
- )
- os.execute('bash ' .. uhaw .. '/script/rw_st halt')
- -- os.execute("bash /etc/000_mplayer/play_voice выключение.mp3 &")
- awful.util.spawn("/sbin/poweroff")
- end),
- awful.key({ }, "XF86AudioPlay", function () awful.util.spawn("deadbeef --play-pause > /dev/null") end),
- awful.key({ }, "XF86AudioStop", function () awful.util.spawn("deadbeef --stop > /dev/null") end),
- awful.key({ }, "XF86AudioPrev", function () awful.util.spawn("deadbeef --prev > /dev/null") end),
- awful.key({ }, "XF86AudioNext", function () awful.util.spawn("deadbeef --next > /dev/null") end),
- awful.key({ }, "XF86AudioMute", function () awful.util.spawn("bash /etc/acpi/amixer_state.sh mute") end),
- awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("bash /etc/acpi/amixer_state.sh down") end),
- awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("bash /etc/acpi/amixer_state.sh up") end),
- awful.key({ }, "Scroll_Lock", function () awful.util.spawn("slock") end),
- awful.key({ modkey, }, "w", function () awful.layout.set(layouts[1]) end),
- awful.key({ modkey, }, "s", function () awful.layout.set(layouts[2]) end),
- awful.key({ modkey, }, "d", function () awful.layout.set(layouts[3]) end),
- awful.key({ modkey, }, "e", function () awful.layout.set(layouts[4]) end),
- awful.key({ modkey, }, "h", function () awful.layout.set(awful.layout.suit.fair.horizontal) end),
- awful.key({ modkey, }, "v", function () awful.layout.set(awful.layout.suit.fair) end),
- awful.key({ modkey, }, "b", function () bwibox.visible = not bwibox.visible end),
- awful.key({ modkey, }, "/", function ()
- if cpu_on_xyi.visible == true then
- cpu_on_xyi.visible = false
- mem_on_xyi.visible = false
- -- dio_on_xyi.visible = false
- -- nio_on_xyi.visible = false
- else
- cpu_on_xyi.visible = true
- mem_on_xyi.visible = true
- -- dio_on_xyi.visible = true
- -- nio_on_xyi.visible = true
- end
- end),
- awful.key({ modkey, }, "'", function ()
- if dio_on_xyi.visible == true then
- dio_on_xyi.visible = false
- else
- dio_on_xyi.visible = true
- end
- end),
- awful.key({ modkey, }, "a", function ()
- if mpd_on_xyi.visible == true then
- mpd_on_xyi.visible = false
- else
- mpd_on_xyi.visible = true
- end
- end),
- awful.key({ modkey, }, "x", function ()
- if scr_on_xyi.visible == true then
- scr_on_xyi.visible = false
- else
- scr_on_xyi.visible = true
- end
- end),
- awful.key({ modkey, }, "z", function ()
- cpu_on_xyi.visible = false
- mem_on_xyi.visible = false
- dio_on_xyi.visible = false
- mpd_on_xyi.visible = false
- scr_on_xyi.visible = false
- end),
- --[[
- awful.key({ modkey, }, "]", function ()
- if nio_on_xyi.visible == true then
- nio_on_xyi.visible = false
- else
- nio_on_xyi.visible = true
- end
- end),
- --
- awful.key({ modkey, }, "'", function ()
- if wbox_msg.visible == true then
- wbox_msg.visible = false
- else
- wbox_msg.visible = true
- end
- end),
- ]]
- --awful.key({ modkey,}, "a",nil, function () str.visible = not str.visible end),
- awful.key({ modkey, "Control" }, "n", awful.client.restore)
- )
- --]]------------------------------------------------------------------------------
- clientkeys = awful.util.table.join(
- awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end),
- awful.key({ modkey, "Shift" }, "q", function (c) c:kill() end),
- awful.key({ modkey, "Shift" }, "space", awful.client.floating.toggle ),
- -- awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
- -- awful.key({ modkey, }, "o", awful.client.movetoscreen ),
- awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end),
- awful.key({ modkey, }, "n",
- function (c)
- c.minimized = true
- end),
- awful.key({ modkey, }, "m",
- function (c)
- c.maximized_horizontal = not c.maximized_horizontal
- c.maximized_vertical = not c.maximized_vertical
- end)
- )
- --]]------------------------------------------------------------------------------
- keynumber = 0
- keynumber = math.min(20, math.max(#tags, keynumber));
- for i = 1, keynumber do
- globalkeys = awful.util.table.join(globalkeys,
- awful.key({ modkey }, "#" .. tags0.keynum[i],
- function ()
- local tag = awful.tag.gettags(1)[i]
- if tag then
- awful.tag.viewnone(1)
- awful.tag.viewonly(tag)
- end
- end),
- awful.key({ modkey, "Shift" }, "#" .. tags0.keynum[i],
- function ()
- local tag = awful.tag.gettags(1)[i]
- if client.focus and tag then
- awful.client.movetotag(tag)
- end
- end))
- end
- if screen.count() == 2 then
- globalkeys = awful.util.table.join(globalkeys,
- awful.key({ modkey }, "#" .. tags1.keynum[1],
- function ()
- local tag = awful.tag.gettags(2)[1]
- if tag then
- awful.tag.viewnone(2)
- awful.tag.viewonly(tag)
- end
- end),
- awful.key({ modkey, "Shift" }, "#" .. tags1.keynum[1],
- function ()
- local tag = awful.tag.gettags(2)[i]
- if client.focus and tag then
- awful.client.movetotag(tag)
- end
- end))
- end
- --]]------------------------------------------------------------------------------
- clientbuttons = awful.util.table.join(
- awful.button({ modkey }, 1, awful.mouse.client.move),
- awful.button({ modkey }, 3, awful.mouse.client.resize))
- --]]------------------------------------------------------------------------------
- root.keys(globalkeys)
- --]]------------------------------------------------------------------------------
- awful.rules.rules = {
- { rule = { },
- properties = {
- border_width = beautiful.border_width,
- border_color = beautiful.border_normal,
- focus = true,
- keys = clientkeys,
- buttons = clientbuttons,
- floating = true,
- callback = awful.placement.centered,
- }
- },
- --[[
- { rule = { class = "Captstatusui" },
- properties = { floating = true } },
- { rule = { class = "XCalc" },
- properties = { floating = true } },
- { rule = { class = "Thunar" },
- properties = { floating = true } },
- { rule = { class = "Lxpanel" },
- properties = { floating = true } },
- { rule = { class = "Nautilus" },
- properties = { floating = true } },
- { rule = { class = "XFontSel" },
- properties = { floating = true } },
- { rule = { class = "Geany" },
- properties = { floating = true } },
- { rule = { class = "Qjackctl" },
- properties = { floating = true } },
- { rule = { class = "Volumeicon" },
- properties = { floating = true } },
- { rule = { class = "Gvolwheel" },
- properties = { floating = true } },
- { rule = { class = "Wine" },
- properties = { floating = true } },
- { rule = { class = "Gtk" },
- properties = { floating = true } },
- { rule = { class = "Torchlight.bin.x86" },
- properties = { floating = true } },
- { rule = { class = "ioquake3.i386" },
- properties = { floating = true } },
- { rule = { class = "ut-bin" },
- properties = { floating = true } },
- { rule = { class = "warzone2100" },
- properties = { floating = true } },
- { rule = { class = "avp" },
- properties = { floating = true } },
- { rule = { class = "SDL_App" },
- properties = { floating = true } },
- { rule = { name = "ALSA Mixer"},
- properties = { floating = true } },
- { rule = { name = "/proc/asound"},
- properties = { floating = true } },
- { rule = { name = "Fieldrunners"},
- properties = { floating = true } },
- { rule = { name = "LGP Security System Manager"},
- properties = { floating = true } },
- { rule = { name = "Launch Sacred"},
- properties = { floating = true } },
- { rule = { name = "Event Tester"},
- properties = { floating = true } },
- { rule = { class = "Paman" },
- properties = { floating = true } },
- ]]
- { rule = { class = "Gimp", role = "gimp-startup" }, properties = { floating = true, tag = tags[3] } },
- { rule = { class = "Gimp", role = "gimp-toolbox" }, properties = { floating = true, tag = tags[3], geometry = {0000,015,0175,770} } },
- { rule = { class = "Gimp", role = "gimp-dock" }, properties = { floating = true, tag = tags[3], geometry = {1105,015,0175,770} } },
- { rule = { class = "Gimp", role = "gimp-image-window" }, properties = { floating = false, tag = tags[3] } },
- { rule = { class = "Xsane" }, properties = { floating = true, tag = tags[4] } },
- { rule = { class = "Xscanimage" }, properties = { floating = true, tag = tags[4], callback = awful.placement.centered } },
- { rule = { class = "System-config-printer" }, properties = { floating = true, tag = tags[4] } },
- { rule = { class = "Djview" }, properties = { floating = false, tag = tags[5] } },
- { rule = { class = "Evince" }, properties = { floating = false, tag = tags[5] } },
- { rule = { class = "xfreerdp" }, properties = { floating = false, tag = tags[5] } },
- { rule = { class = "Deluge" }, properties = { floating = false, tag = tags[6] } },
- { rule = { class = "Deluge-gtk" }, properties = { floating = false, tag = tags[6] } },
- { rule = { class = "Flush" }, properties = { floating = false, tag = tags[6] } },
- { rule = { class = "XPaint" }, properties = { floating = true, } },
- { rule = { class = "TopLevelShell" }, properties = { floating = false, } },
- { rule = { class = "Gpaint" }, properties = { floating = false, } },
- { rule = { class = "Mtpaint" }, properties = { floating = false, } },
- { rule = { class = "MyPaint" }, properties = { floating = false, } },
- { rule = { class = "Gpicview" }, properties = { floating = false, } },
- { rule = { class = "Pythoncad" }, properties = { floating = false, } },
- { rule = { class = "Librecad" }, properties = { floating = false, } },
- { rule = { class = "Gnome-paint" }, properties = { floating = false, } },
- { rule = { class = "GQview" }, properties = { floating = false, } },
- { rule = { class = "Brasero" }, properties = { floating = false, } },
- { rule = { class = "Xfburn" }, properties = { floating = false, } },
- { rule = { class = "Qutim", role = "buddy_list" }, properties = { floating = false, } },
- { rule = { class = "Qutim", role = "conversation" }, properties = { floating = false, callback = awful.client.setslave } },-- установить, узнать и доделать
- { rule = { class = "Audacious" }, properties = { floating = true, tag = tags[7] } },
- { rule = { class = "Audacity" }, properties = { floating = false, tag = tags[7] } },
- { rule = { class = "Deadbeef" }, properties = { floating = false, tag = tags[8] } },
- { rule = { class = "Exfalso" }, properties = { floating = false, tag = tags[8] } },
- { rule = { class = "Volumeicon" }, properties = { floating = false, tag = tags[8] } },
- { rule = { class = "Conkeror" }, properties = { floating = false, tag = tags[9] } },
- { rule = { class = "Midori" }, properties = { floating = false, tag = tags[9] } },
- { rule = { class = "Uzbl-core" }, properties = { floating = false, tag = tags[9] } },
- { rule = { class = "Iceweasel" }, properties = { floating = false, tag = tags[9] } },
- { rule = { class = "Firefox" }, properties = { floating = false, tag = tags[9] } },
- { rule = { class = "Google-chrome" }, properties = { floating = false, tag = tags[9] } },
- { rule = { class = "Download" }, properties = { floating = true, tag = tags[9] } },
- { rule = { instance = "Download" }, properties = { floating = true, tag = tags[9] } },
- { rule = { instance = "Dialog" }, properties = { floating = true, tag = tags[9] } },
- { rule = { instance = "Navigator" }, properties = { floating = false, tag = tags[9] } },
- { rule = { role = "browser" }, properties = { floating = false, tag = tags[9] } },
- { rule = { instance = "VCLSalFrame" }, properties = { floating = false, tag = tags[10] } },
- { rule = { name = "LibreOffice" }, properties = { floating = false, tag = tags[10] } },
- { rule = { class = "Soffice" }, properties = { floating = true, tag = tags[10] } },
- { rule = { class = "openoffice.org" }, properties = { floating = false, tag = tags[10] } },
- { rule = { class = "Abiword" }, properties = { floating = false, tag = tags[10] } },
- { rule = { class = "MPlayer" }, properties = { floating = false, } },
- { rule = { class = "Smplayer" }, properties = { floating = false, tag = tags[11] } },
- { rule = { class = "Gnome-mplayer" }, properties = { floating = true, tag = tags[11] } },
- -- { rule = { class = "Pidgin" }, properties = { floating = true, tag = tags[11] } },
- { rule = { class = "Pidgin", role = "buddy_list" }, properties = { floating = false, tag = tags[11] } },
- { rule = { class = "Pidgin", role = "conversation" }, properties = { floating = false, tag = tags[11], callback = awful.client.setmaster } },-- установить, узнать и доделать
- { rule = { class = "Lxappearance" }, properties = { floating = true, tag = tags[11] } },
- { rule = { class = "Qtconfig" }, properties = { floating = true, tag = tags[11] } },
- { rule = { class = "Gconf-editor" }, properties = { floating = true, tag = tags[11] } },
- { rule = { name = "GParted" }, properties = { floating = false, tag = tags[12] } },
- { rule = { class = "Gpartedbin" }, properties = { tag = tags[12] } },
- { rule = { class = "Geany" }, properties = { floating = false, } },
- { rule = { class = "URxvt" }, properties = { floating = false, } },
- { rule = { class = "XTerm" }, properties = { floating = true, } },
- { rule = { class = "XTerm", instance = "ppp_up_modem" }, properties = { floating = true, tag = tags[12] } },
- { rule = { class = "feh" }, properties = { floating = false, } },
- { rule = { class = "Cheese" }, properties = { floating = false, } },
- { rule = { name = "Print" }, properties = { floating = true, } },
- { rule = { name = "Export" }, properties = { floating = true, } },
- { rule = { name = "Import" }, properties = { floating = true, } },
- { rule = { name = "Save" }, properties = { floating = true, } },
- { rule = { name = "Open" }, properties = { floating = true, } },
- { rule = { name = "Prefer" }, properties = { floating = true, } },
- { rule = { name = "<untitled>" }, properties = { floating = true, } },
- { rule = { name = "Найт" }, properties = { floating = true, } },
- { rule = { name = "Замен" }, properties = { floating = true, } },
- { rule = { name = "Экспорт" }, properties = { floating = true, } },
- { rule = { name = "Импорт" }, properties = { floating = true, } },
- { rule = { name = "Настро" }, properties = { floating = true, } },
- { rule = { name = "Параметр" }, properties = { floating = true, } },
- { rule = { name = "Поиск" }, properties = { floating = true, } },
- { rule = { name = "Добав" }, properties = { floating = true, } },
- { rule = { name = "Печат" }, properties = { floating = true, } },
- { rule = { name = "Сохран" }, properties = { floating = true, } },
- { rule = { name = "Откры" }, properties = { floating = true, } },
- { rule = { name = "Выреза" }, properties = { floating = true, } },
- { rule = { name = "Удал" }, properties = { floating = true, } },
- { rule = { name = "айл" }, properties = { floating = true, } },
- { rule = { name = "Выбрать" }, properties = { floating = true, } },
- { rule = { name = "Удал" }, properties = { floating = true, } },
- { rule = { name = "Загруз" }, properties = { floating = true, } },
- { rule = { name = "Предупреждение" }, properties = { floating = true, } },
- { rule = { class = "Wine" }, properties = { ontop = true, } }
- }
- --]]------------------------------------------------------------------------------
- client.connect_signal("manage",
- function (c, startup)
- --[[
- c:connect_signal("mouse::enter",
- function(c)
- if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
- and awful.client.focus.filter(c) then
- client.focus = c
- end
- end
- )
- ]]
- if not startup then
- if not c.size_hints.user_position and not c.size_hints.program_position then
- awful.placement.no_overlap(c)
- -- if c.class ~= "XTerm" then
- -- awful.placement.centered(c, nil)
- -- end
- end
- end
- awful.placement.no_offscreen(c)
- c.size_hints_honor = false
- end
- )
- --]]------------------------------------------------------------------------------
- client.connect_signal( "focus",
- function(c)
- c.border_color = beautiful.border_focus
- awful.placement.no_offscreen(c)
- -- awful.placement.centered(c, nil)
- c.size_hints_honor = false
- end
- )
- --]]------------------------------------------------------------------------------
- client.connect_signal("unfocus",
- function(c)
- c.border_color = beautiful.border_normal
- awful.placement.no_offscreen(c)
- -- awful.placement.centered(c, nil)
- c.size_hints_honor = false
- end
- )
- --]]------------------------------------------------------------------------------
- -- os.execute("bash /etc/000_mplayer/play_voice загружен_и_готов_к_работе.mp3 &")
- --]]------------------------------------------------------------------------------
- os.execute('bash ' .. uhaw .. '/script/rw_st start-awesome')
- --os.execute('bash '..uh..'/.xinitrc reload pan2')
- local f = io.popen("cat /proc/uptime")
- local line = f:read("*line")
- f:close()
- naughty.notify({font = font_awesome, title = "Uptime!", text = line })
- scheduler.start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement