From 9a0341829376eb781d3302569c1cd67f4fc34f59 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Wed, 18 Jul 2012 16:45:57 +0400 Subject: [PATCH] Widgets: cpu, mem, bat, wired, wifi, sound --- apprules.lua | 2 ++ rc.lua | 60 +++++++++++++++++++++++++++++++++++++++++----------- theme.lua | 13 +++++++++--- 3 files changed, 60 insertions(+), 15 deletions(-) diff --git a/apprules.lua b/apprules.lua index c81c5ee..516c3d2 100644 --- a/apprules.lua +++ b/apprules.lua @@ -37,6 +37,8 @@ awful.rules.rules = { properties = { tag = tags[1][8] } }, { rule = { class = "MPlayer" }, properties = { floating = true } }, + -- XTerm на пятом и шестом теге первого экрана + { rule = { class = "XTerm" }, callback = function(c) c:tags({tags[1][5], tags[1][6]}) end}, } -- }}} diff --git a/rc.lua b/rc.lua index 1438323..1b9a7a5 100644 --- a/rc.lua +++ b/rc.lua @@ -128,15 +128,48 @@ mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), -- }}} -- {{{ Wibox - -- Network usage widget - -- Initialize widget - netwidget = widget({ type = "textbox" }) - -- Register widget - vicious.register(netwidget, vicious.widgets.net, '${wlan0 down_kb} ${wlan0 up_kb}', 3) -dnicon = widget({ type = "imagebox" }) -upicon = widget({ type = "imagebox" }) -dnicon.image = image(beautiful.widget_net) -upicon.image = image(beautiful.widget_netup) + -- My widgets + wifi_widget_down = widget({ type = "textbox" }) + wifi_widget_up = widget({ type = "textbox" }) + icon_wifi = widget({ type = "imagebox" }) + icon_wifidown = widget({ type = "imagebox" }) + icon_wifiup = widget({ type = "imagebox" }) + icon_wifi.image = image(beautiful.widget_wifi) + icon_wifidown.image = image(beautiful.widget_wifidown) + icon_wifiup.image = image(beautiful.widget_wifiup) + wired_widget_down = widget({ type = "textbox" }) + wired_widget_up = widget({ type = "textbox" }) + icon_wired = widget({ type = "imagebox" }) + icon_wireddown = widget({ type = "imagebox" }) + icon_wiredup = widget({ type = "imagebox" }) + icon_wired.image = image(beautiful.widget_wired) + icon_wireddown.image = image(beautiful.widget_wireddown) + icon_wiredup.image = image(beautiful.widget_wiredup) + + bat_widget = widget({ type = "textbox" }) + bat_icon = widget({ type = "imagebox" }) + bat_icon.image = image(beautiful.widget_bat) + + cpu_widget = widget({ type = "textbox" }) + cpu_icon = widget({ type = "imagebox" }) + cpu_icon.image = image(beautiful.widget_cpu) + + mem_widget = widget({ type = "textbox" }) + mem_icon = widget({ type = "imagebox" }) + mem_icon.image = image(beautiful.widget_mem) + + -- vol_widget = widget({ type = "textbox" }) + vol_icon = widget({ type = "imagebox" }) + vol_icon.image = image(beautiful.widget_vol) + + vicious.register(wifi_widget_down, vicious.widgets.net, '${wlan0 down_kb}', 3) + vicious.register(wifi_widget_up, vicious.widgets.net, '${wlan0 up_kb}', 3) + vicious.register(wired_widget_down, vicious.widgets.net, '${eth0 down_kb}', 3) + vicious.register(wired_widget_up, vicious.widgets.net, '${eth0 up_kb}', 3) + vicious.register(bat_widget, vicious.widgets.bat, "$2%", 120, "BAT0") + vicious.register(cpu_widget, vicious.widgets.cpu, "$1%") + vicious.register(mem_widget, vicious.widgets.mem, "$1%") + -- Create a textclock widget mytextclock = awful.widget.textclock({ align = "right" }) @@ -220,9 +253,12 @@ for s = 1, screen.count() do }, mylayoutbox[s], mytextclock, - volume_widget, - netwidget, - -- separator, upicon, netwidget, dnicon, + volume_widget, vol_icon, + separator, wifi_widget_up, icon_wifiup, wifi_widget_down, icon_wifidown, icon_wifi, + separator, wired_widget_up, icon_wiredup, wired_widget_down, icon_wireddown, icon_wired, + bat_widget, bat_icon, + mem_widget, mem_icon, + cpu_widget, cpu_icon, s == 1 and mysystray or nil, mytasklist[s], layout = awful.widget.layout.horizontal.rightleft diff --git a/theme.lua b/theme.lua index 9b92a8d..e0762b6 100644 --- a/theme.lua +++ b/theme.lua @@ -92,9 +92,16 @@ theme.layout_dwindle = "/usr/share/awesome/themes/default/layouts/dwindlew.png" theme.awesome_icon = "/usr/share/awesome/icons/awesome16.png" - -theme.widget_net = "~/.config/awesome/icons/down.png" -theme.widget_netup = "~/.config/awesome/icons/up.png" +theme.widget_cpu = "~/.config/awesome/icons/16x16/cpu.png" +theme.widget_mem = "~/.config/awesome/icons/16x16/mem.png" +theme.widget_bat = "~/.config/awesome/icons/16x16/battery.png" +theme.widget_vol = "~/.config/awesome/icons/16x16/vol-hi.png" +theme.widget_wifi = "~/.config/awesome/icons/16x16/net-wifi.png" +theme.widget_wifidown = "~/.config/awesome/icons/16x16/down.png" +theme.widget_wifiup = "~/.config/awesome/icons/16x16/up.png" +theme.widget_wired = "~/.config/awesome/icons/16x16/net-wired2.png" +theme.widget_wireddown = "~/.config/awesome/icons/16x16/down.png" +theme.widget_wiredup = "~/.config/awesome/icons/16x16/up.png" return theme -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80