You are not logged in.

#1 2009-01-09 23:01:43

semperfiguy
Member
Registered: 2007-12-03
Posts: 224

Awesome WM 3 overloading CPU

Hi, I have recently started running awesome WM and started to get into adding widgets into the status bar and such. But after running it for some relatively short periods of time (2-4 hrs), I have started noticing that my CPU usage in one of my cores increases gradually, increasing the tempertures of both cores. Upon checking htop, the process that is overloading the cores is "/usr/bin/X -nolisten tcp." There is no problem after starting awwesome, it just starts increasing over time. I think it might be a problem in my functions that I borrowed from various people. Could any one check it over and see if there are any flaws that could be causing the cpu usage to build up like this? I just had my laptop running and when I checked back on it, cpu usage was up to 99% and temps up to 59 degrees celcius! Anyway, here is my .lua files


functions.lua

---- Functions
 
-- {{{ Markup functions
function setBg(bgcolor, text)
    return '<bg color="'..bgcolor..'" />'..text
end
 
function setFg(fgcolor, text)
    return '<span color="'..fgcolor..'">'..text..'</span>'
end
 
function setBgFg(bgcolor, fgcolor, text)
    return '<bg color="'..bgcolor..'" /><span color="'..fgcolor..'">'..text..'</span>'
end
 
function setFont(font, text)
    return '<span font_desc="'..font..'">'..text..'</span>'
end

---- Widget functions
-- {{{ Clock
function dateInfo(timeformat)
    local time = os.date(timeformat)
    datewidget.text = spacer..setFg(beautiful.fg_focus, time)..spacer
end
-- }}}

-- {{{ Wifi signal strength
function wifiInfo(adapter)
    local f = io.open("/sys/class/net/"..adapter.."/wireless/link")
    local wifiStrength = f:read()
    f:close()
    
    if wifiStrength == "0" then
        wifiStrength = setFg("#ff6565", wifiStrength)
        naughty.notify({ title = "Wifi Warning",
                         text = "Wireless Network is Down! ("..wifiStrength.." connectivity)",
                         timeout = 3,
                         position = "top_right",
                         fg = beautiful.fg_focus,
                         bg = beautiful.bg_focus
                       })
    end
    
    wifiwidget.text = spacer..setFg(beautiful.widget_fg, "WiFi:")..spacer..setFg("#ffffff", wifiStrength.."%")..spacer
end
-- }}}


-- Gmail function
-- {{{ 
function gmailInfo(gmailFile)
    local f = io.open(gmailFile)
    local mails = ""
    if f ~= nil then
        mails = f:read()
        f:close()
        if tonumber(mails) > 0 then
            mails = setBgFg(beautiful.bg_focus, "#ff6565", tostring(mails))
            naughty.notify({ title = "Mail Notification"
                , text = "You have new mail! ("..mails..")"
                , timeout = 10
                , position = "top_right"
                , fg = beautiful.fg_focus
                , bg = beautiful.bg_focus
            })
        else
            mails = tostring(mails)
        end
    else
        mails = "N/A"
    end
    
    gmailwidget.text = spacer..setFocusFg("Mail:")..spacer..mails..spacer
end

function gmailUpdate()
    os.execute(os.getenv("HOME").."/bin/checkGmail.sh > /tmp/gmail-temp &")
    -- gmailInfo("/tmp/gmail-temp")
end
-- }}}

-- {{{ Battery (BAT0)
function batteryInfo(adapter)
    local fcur = io.open("/sys/class/power_supply/"..adapter.."/charge_now")
    local fcap = io.open("/sys/class/power_supply/"..adapter.."/charge_full")
    local fsta = io.open("/sys/class/power_supply/"..adapter.."/status")
    local cur = fcur:read()
    fcur:close()
    local cap = fcap:read()
    fcap:close()
    local sta = fsta:read()
    fsta:close()
    
    local battery = math.floor(cur * 100 / cap)
    
    if sta:match("Charging") then
        dir = "^"
        battery = dir..battery.."%"..dir
    elseif sta:match("Discharging") then
        dir = "v"
    battery = dir..battery.."%"..dir
        if tonumber(battery) >= 25 and tonumber(battery) <= 50 then
            battery = setFg("#e6d51d", battery)
        elseif tonumber(battery) < 25 then
            if tonumber(battery) <= 10 then
                naughty.notify({ title = "Battery Warning",
                                 text = "Battery low!"..spacer..battery.."%"..spacer.."left!",
                                 timeout = 5,
                                 position = "top_right",
                                 fg = beautiful.fg_focus,
                                 bg = beautiful.bg_focus
                               })
            end
            battery = setFg("#ff6565", battery)
        end
    else
        dir = "="
        battery = dir.."AC"..dir
    end
    
    batterywidget.text = spacer..setFg(beautiful.widget_fg, "Bat:")..spacer..battery..spacer
end
-- }}}

-- {{{ Memory
function memInfo()
    local f = io.open("/proc/meminfo")
 
    for line in f:lines() do
        if line:match("^MemTotal.*") then
            memTotal = math.floor(tonumber(line:match("(%d+)")) / 1024)
        elseif line:match("^MemFree.*") then
            memFree = math.floor(tonumber(line:match("(%d+)")) / 1024)
        elseif line:match("^Buffers.*") then
            memBuffers = math.floor(tonumber(line:match("(%d+)")) / 1024)
        elseif line:match("^Cached.*") then
            memCached = math.floor(tonumber(line:match("(%d+)")) / 1024)
        end
    end
    f:close()
 
    memFree = memFree + memBuffers + memCached
    memInUse = memTotal - memFree
    memUsePct = math.floor(memInUse / memTotal * 100)
 
    memwidget.text = spacer..setFg(beautiful.widget_fg, "Mem:")..memUsePct.."%"..spacer.."("..memInUse.."M)"..spacer
end
-- }}}

-- {{{ CPU Usage, CPU & GPU Temps
function cputemp(core)
  local command = "sensors | grep 'Core"..tostring(core).."'"
  local cpu = io.popen(command):read("*all")
 
  if (cpu == nil) then
    return ''
  end
 
  local pos = cpu:find('+')+1
  cpu = string.sub(cpu, pos, pos+3)
    
    if tonumber(cpu) >= 45 then
        cpu = setFg("#994044", cpu)
    end
    
  return cpu
end
 
function gputemp()
    local gT = io.popen("nvidia-settings -q gpucoretemp | grep '):' | awk '{print $4}' | cut -d '.' -f1")
    local gpuTemp = gT:read()
    gT:close()
    
    -- pL is the nvidia performance setting thats currently being employed by the driver
    -- local pL = io.popen("nvidia-settings -q GPUCurrentPerfLevel | grep -m1 PerfLevel | cut -d' ' -f6 | cut -d'.' -f1")
    -- local perfL = pL:read()
    -- pL:close()
    
    if (gpuTemp == nil) then
        return ''
  end
    
    if tonumber(gpuTemp) >= 65 then
        gpuTemp = setFg("#994044", gpuTemp)
    end
    
    return gpuTemp
end
 
function sysInfo(widget, args)
    local core1 = spacer..setFg(beautiful.widget_fg, "C1: ")..args[2].."%"..spacer..cputemp(0).."°C"
    local core2 = spacer..setFg(beautiful.widget_fg, "C2: ")..args[3].."%"..spacer..cputemp(1).."°C"
    local gpu = spacer..setFg(beautiful.widget_fg, "GPU: ")..gputemp().."°C"..spacer
    local sysinfo = core1..core2..gpu
    
    return sysinfo
    --syswidget.text = sysinfo
end
-- }}}

-- {{{ Volume
function getVol()
  local status = io.popen("amixer -c " .. cardid .. " -- sget " .. channel):read("*all")  
  local volume = string.match(status, "(%d?%d?%d)%%")
  volume = string.format("% 3d", volume)
  status = string.match(status, "%[(o[^%]]*)%]")
    
  if string.find(status, "on", 1, true) then
    volume = volume.."%"
  else
    volume = volume.."M"
  end
    
  volwidget.text = spacer..setFg(beautiful.widget_fg, "Vol:")..volume..spacer
end
-- }}}

and rc.lua

-- Include awesome libraries, with lots of useful function!
require("awful")
require("beautiful")
require("naughty")
require("wicked")

-- My functions
require("functions")

-- {{{ Variable definitions

-- Themes define colours, icons, and wallpapers
theme_path = os.getenv("HOME").."/.config/awesome/myTheme/theme"

-- Actually load theme
beautiful.init(theme_path)

-- This is used later as the default terminal and editor to run.
terminal = "urxvt"
editor = os.getenv("EDITOR") or "vim"
editor_cmd = terminal .. " -e " ..editor
browser = "/usr/bin/firefox"
fileManager = "thunar"

-- Volume
cardid = 0
channel = "Master"

-- Default modkey.
modkey = "Mod4"

-- Table of layouts to cover with awful.layout.inc, order matters.
layouts =
{
    "tile",
    "tileleft",
    "tilebottom",
    "tiletop",
    "fairh",
    "fairv",
    "magnifier",
    "max",
    "fullscreen",
    "spiral",
    "dwindle",
    "floating"
}

-- Table of clients that should be set floating. The index may be either
-- the application class or instance. The instance is useful when running
-- a console app in a terminal like (Music on Console)
--    xterm -name mocp -e mocp
floatapps =
{
    -- by class
    ["MPlayer"] = true,
    ["pinentry"] = true,
    ["gimp"] = true,
    -- by instance
    ["mocp"] = true
}

-- Applications to be moved to a pre-defined tag by class or instance.
-- Use the screen and tags indices.
apptags =
{
    ["Gran Paradiso"] = { screen = 1, tag = 3 },
    -- ["Vimperator"] = { screen = 1, tag = 8 },
    -- ["Thunar"] = { screen = 1, tag = 4 },
    ["Pidgin"] = { screen = 1, tag = 5 },
    ["Gimp"] = { screen = 1, tag = 6 },
    ["OpenOffice.org 3.1"] = { screen = 1, tag = 4 },
}

-- Define if we want to use titlebar on all applications.
use_titlebar = false
-- }}}

-- {{{ Tags
-- Define tags table.
customtagnames = {"one", "two", "www", "four", "five", "floats" }

tags = {}
for s = 1, screen.count() do
    -- Each screen has its own tag table.
    tags[s] = {}
    -- Create 9 tags per screen.
    for tagnumber = 1, 6 do
        tags[s][tagnumber] = tag({ name = customtagnames[tagnumber], layout = layouts[1] })
    tags[s][tagnumber].mwfact = 0.6188324
        -- Add tags to screen one by one
        tags[s][tagnumber].screen = s
    end
    -- I'm sure you want to see at least one tag.
    tags[s][1].selected = true
end

-- }}}
-------------------------------------------------------------------------
-- {{{ Wibox

-- Create a systray
mysystray = widget({ type = "systray", align = "right" })


-- Simple spacer we can use to get cleaner code
spacer = " "

-- Seperator icon
--separator = " | "
separator = widget({ type = "textbox", align = "right" })
separator.text = "|"
-- separator.image = image(awful.util.getdir("config").."/icons/separators/link2.png")
-- Creat sysinfo widget

-- Create the wifi widget
wifiwidget = widget({ type = "textbox", align = "right" })
-- Run it once so we don't have to wait for the hooks to see our signal strength
wifiInfo("wlan0")
 
-- Create the battery widget
batterywidget = widget({ type = "textbox", align = "right" })
-- Run it once so we don't have to wait for the hooks to see our percentage
batteryInfo("BAT0")

-- Date widget.
datewidget = widget({    type = 'textbox', name = 'datewidget', align = 'right' })
dateInfo("%I:%M / %b %d, %a")

-- Volume widget
volwidget = widget({ type = "textbox", align = "right" })
getVol()
-- wicked.register(volwidget, getVol, "$1", 5)

-- Create the CPU Usage, CPU Temps, GPU Temp widget
syswidget = widget({ type = 'textbox', align = 'right' })
--sysInfo()
wicked.register(syswidget, 'cpu', sysInfo, 15, nil, 2)

memwidget = widget({ type ='textbox', align = 'right' })
memInfo()

gmailwidget = widget({ type = 'textbox', align = 'right' })
gmailUpdate()

-- Create a wibox for each screen and add it
mywibox = {}
mypromptbox = {}
mylayoutbox = {}
mytaglist = {}
mytaglist.buttons = { button({ }, 1, awful.tag.viewonly),
                      button({ modkey }, 1, awful.client.movetotag),
                      button({ }, 3, function (tag) tag.selected = not tag.selected end),
                      button({ modkey }, 3, awful.client.toggletag),
                      button({ }, 4, awful.tag.viewnext),
                      button({ }, 5, awful.tag.viewprev) }
mytasklist = {}
mytasklist.buttons = { button({ }, 1, function (c) client.focus = c; c:raise() end),
                       button({ }, 3, function () awful.menu.clients({ width=250 }) end),
                       button({ }, 4, function () awful.client.focus.byidx(1) end),
                       button({ }, 5, function () awful.client.focus.byidx(-1) end) }

for s = 1, screen.count() do
    -- Create a promptbox for each screen
    mypromptbox[s] = widget({ type = "textbox", align = "left" })
    -- Create an imagebox widget which will contains an icon indicating which layout we're using.
    -- We need one layoutbox per screen.
    mylayoutbox[s] = widget({ type = "imagebox", align = "left" })
    mylayoutbox[s]:buttons({ button({ }, 1, function () awful.layout.inc(layouts, 1) end),
                             button({ }, 3, function () awful.layout.inc(layouts, -1) end),
                             button({ }, 4, function () awful.layout.inc(layouts, 1) end),
                             button({ }, 5, function () awful.layout.inc(layouts, -1) end) })
    -- Create a taglist widget
    mytaglist[s] = awful.widget.taglist.new(s, awful.widget.taglist.label.all, mytaglist.buttons)

    -- Create a tasklist widget
    mytasklist[s] = awful.widget.tasklist.new(function(c)
                                                  return awful.widget.tasklist.label.currenttags(c, s)
                                              end, mytasklist.buttons)

--
   -- Create the wibox
    mywibox[s] = wibox({ position = "top", fg = beautiful.fg_normal, bg = beautiful.bg_normal })

    -- Add widgets to the wibox - order matters
    mywibox[s].widgets = {
                           -- mylauncher,
                           mytaglist[s],
                           mylayoutbox[s],
                           mypromptbox[s],
               separator,
               syswidget,
               separator,
               memwidget,
               -- mytasklist[s],
                           separator,
                    wifiwidget,
               separator,
               gmailwidget,
               separator,
               batterywidget,
               separator,
                    volwidget,
               separator,
                    datewidget,
               s == 1 and mysystray or nil }
    mywibox[s].screen = s
end
-- }}}

-- {{{ Mouse bindings
awesome.buttons({
    button({ }, 3, function () mymainmenu:toggle() end),
    button({ }, 4, awful.tag.viewnext),
    button({ }, 5, awful.tag.viewprev)
})
-- }}}

-- {{{ Key bindings

-- Bind keyboard digits
-- Compute the maximum number of digit we need, limited to 9
keynumber = 0
for s = 1, screen.count() do
   keynumber = math.min(9, math.max(#tags[s], keynumber));
end

for i = 1, keynumber do
    keybinding({ modkey }, i,
                   function ()
                       local screen = mouse.screen
                       if tags[screen][i] then
                           awful.tag.viewonly(tags[screen][i])
                       end
                   end):add()
    keybinding({ modkey, "Control" }, i,
                   function ()
                       local screen = mouse.screen
                       if tags[screen][i] then
                           tags[screen][i].selected = not tags[screen][i].selected
                       end
                   end):add()
    keybinding({ modkey, "Shift" }, i,
                   function ()
                       if client.focus then
                           if tags[client.focus.screen][i] then
                               awful.client.movetotag(tags[client.focus.screen][i])
                           end
                       end
                   end):add()
    keybinding({ modkey, "Control", "Shift" }, i,
                   function ()
                       if client.focus then
                           if tags[client.focus.screen][i] then
                               awful.client.toggletag(tags[client.focus.screen][i])
                           end
                       end
                   end):add()
end

keybinding({ modkey }, "Left", awful.tag.viewprev):add()
keybinding({ modkey }, "Right", awful.tag.viewnext):add()
keybinding({ modkey }, "Escape", awful.tag.history.restore):add()

-- Standard program
keybinding({ modkey }, "Return", function () awful.util.spawn(terminal) end):add()
-- Restart awesome
keybinding({ modkey, "Control" }, "r", function ()
                                           mypromptbox[mouse.screen].text =
                                               awful.util.escape(awful.util.restart())
                                        end):add()
-- Quit awesome
keybinding({ modkey, "Control" }, "q", awesome.quit):add()

-- Client manipulation
keybinding({ modkey }, "m", awful.client.maximize):add()
keybinding({ modkey }, "F12", function () if client.focus then client.focus.fullscreen = not client.focus.fullscreen end end):add()
keybinding({ modkey }, "Delete", function () if client.focus then client.focus:kill() end end):add()
-- Cycle through Clients
keybinding({ modkey }, "t", function () awful.client.focus.byidx(1); if client.focus then client.focus:raise() end end):add()
keybinding({ modkey }, "h", function () awful.client.focus.byidx(-1);  if client.focus then client.focus:raise() end end):add()
keybinding({ modkey, "Shift" }, "t", function () awful.client.swap.byidx(1) end):add()
keybinding({ modkey, "Shift" }, "h", function () awful.client.swap.byidx(-1) end):add()
keybinding({ modkey, "Control" }, "t", function () awful.screen.focus(1) end):add()
keybinding({ modkey, "Control" }, "h", function () awful.screen.focus(-1) end):add()
-- Toggle Floating
keybinding({ modkey, "Control" }, "space", awful.client.togglefloating):add()
keybinding({ modkey, "Control" }, "Return", function () if client.focus then client.focus:swap(awful.client.getmaster()) end end):add()
keybinding({ modkey }, "o", awful.client.movetoscreen):add()
keybinding({ modkey }, "Tab", awful.client.focus.history.previous):add()
keybinding({ modkey }, "u", awful.client.urgent.jumpto):add()
keybinding({ modkey, "Shift" }, "r", function () if client.focus then
    client.focus:redraw() end end):add()

-- Layout manipulation
keybinding({ modkey }, "n", function () awful.tag.incmwfact(0.05) end):add()
keybinding({ modkey }, "d", function () awful.tag.incmwfact(-0.05) end):add()
keybinding({ modkey, "Shift" }, "d", function () awful.tag.incnmaster(1) end):add()
keybinding({ modkey, "Shift" }, "n", function () awful.tag.incnmaster(-1) end):add()
keybinding({ modkey, "Control" }, "d", function () awful.tag.incncol(1) end):add()
keybinding({ modkey, "Control" }, "n", function () awful.tag.incncol(-1) end):add()
-- Cycle Layouts
keybinding({ modkey }, "space", function () awful.layout.inc(layouts, 1) end):add()
keybinding({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end):add()

-- Prompt
keybinding({ modkey }, "F1", function ()
                                 awful.prompt.run({ prompt = "Run: " }, mypromptbox[mouse.screen], awful.util.spawn, awful.completion.bash,
                                                  awful.util.getdir("cache") .. "/history")
                             end):add()
keybinding({ modkey }, "F4", function ()
                                 awful.prompt.run({ prompt = "Run Lua code: " }, mypromptbox[mouse.screen], awful.util.eval, awful.prompt.bash,
                                                  awful.util.getdir("cache") .. "/history_eval")
                             end):add()

keybinding({ modkey, "Ctrl" }, "i", function ()
                                        local s = mouse.screen
                                        if mypromptbox[s].text then
                                            mypromptbox[s].text = nil
                                        elseif client.focus then
                                            mypromptbox[s].text = nil
                                            if client.focus.class then
                                                mypromptbox[s].text = "Class: " .. client.focus.class .. " "
                                            end
                                            if client.focus.instance then
                                                mypromptbox[s].text = mypromptbox[s].text .. "Instance: ".. client.focus.instance .. " "
                                            end
                                            if client.focus.role then
                                                mypromptbox[s].text = mypromptbox[s].text .. "Role: ".. client.focus.role
                                            end
                                        end
                                    end):add()

-- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them
keybinding({ modkey }, "y", awful.client.togglemarked):add()

for i = 1, keynumber do
    keybinding({ modkey, "Shift" }, "F" .. i,
                   function ()
                       local screen = mouse.screen
                       if tags[screen][i] then
                           for k, c in pairs(awful.client.getmarked()) do
                               awful.client.movetotag(tags[screen][i], c)
                           end
                       end
                   end):add()
end
-- }}}
------------------------------------------------------------------------
-- {{{ Hooks
-- Hook function to execute when focusing a client.
awful.hooks.focus.register(function (c)
    if not awful.client.ismarked(c) then
        c.border_color = beautiful.border_focus
    c.opacity = 1
    end
end)

-- Hook function to execute when unfocusing a client.
awful.hooks.unfocus.register(function (c)
    if not awful.client.ismarked(c) then
        c.border_color = beautiful.border_normal
    c.opacity = 0.85
    end
end)

-- Hook function to execute when marking a client
awful.hooks.marked.register(function (c)
    c.border_color = beautiful.border_marked
end)

-- Hook function to execute when unmarking a client.
awful.hooks.unmarked.register(function (c)
    c.border_color = beautiful.border_focus
end)

-- Hook function to execute when the mouse enters a client.
awful.hooks.mouse_enter.register(function (c)
    -- Sloppy focus, but disabled for magnifier layout
    if awful.layout.get(c.screen) ~= "magnifier"
        and awful.client.focus.filter(c) then
        client.focus = c
    end
end)

-- Hook function to execute when a new client appears.
awful.hooks.manage.register(function (c)
    if use_titlebar then
        -- Add a titlebar
        awful.titlebar.add(c, { modkey = modkey })
    end
    -- Add mouse bindings
    c:buttons({
        button({ }, 1, function (c) client.focus = c; c:raise() end),
        button({ modkey }, 1, function (c) c:mouse_move() end),
        button({ modkey }, 3, function (c) c:mouse_resize() end)
    })
    -- New client may not receive focus
    -- if they're not focusable, so set border anyway.
    c.border_width = beautiful.border_width
    c.border_color = beautiful.border_normal

    -- Check if the application should be floating.
    local cls = c.class
    local inst = c.instance
    if floatapps[cls] then
        c.floating = floatapps[cls]
    elseif floatapps[inst] then
        c.floating = floatapps[inst]
    end

    -- Check application->screen/tag mappings.
    local target
    if apptags[cls] then
        target = apptags[cls]
    elseif apptags[inst] then
        target = apptags[inst]
    end
    if target then
        c.screen = target.screen
        awful.client.movetotag(tags[target.screen][target.tag], c)
    end

    -- Do this after tag mapping, so you don't see it on the wrong tag for a split second.
    client.focus = c

    -- Set the windows at the slave,
    -- i.e. put it at the end of others instead of setting it master.
    -- awful.client.setslave(c)

    -- Honor size hints: if you want to drop the gaps between windows, set this to false.
    c.honorsizehints = false
end)

-- Hook function to execute when arranging the screen.
-- (tag switch, new client, etc)
awful.hooks.arrange.register(function (screen)
    local layout = awful.layout.get(screen)
    if layout then
        mylayoutbox[screen].image = image(beautiful["layout_" .. layout])
    else
        mylayoutbox[screen].image = nil
    end

    -- Give focus to the latest client in history if no window has focus
    -- or if the current window is a desktop or a dock one.
    if not client.focus then
        local c = awful.client.focus.history.get(screen, 0)
        if c then client.focus = c end
    end

    -- Uncomment if you want mouse warping
    --[[
    if client.focus then
        local c_c = client.focus:fullgeometry()
        local m_c = mouse.coords()

        if m_c.x < c_c.x or m_c.x >= c_c.x + c_c.width or
            m_c.y < c_c.y or m_c.y >= c_c.y + c_c.height then
            if table.maxn(m_c.buttons) == 0 then
                mouse.coords({ x = c_c.x + 5, y = c_c.y + 5})
            end
        end
    end
    ]]
end)

-- Timed hooks for the different widgets

-- Hook called every second
awful.hooks.timer.register(1, function ()
    dateInfo("%I:%M / %b %d, %a")
    getVol()
end)

-- every 5 seconds
awful.hooks.timer.register(5, function ()
    wifiInfo("wlan0")
    memInfo()
end)

-- every 10 seconds
awful.hooks.timer.register(10, function ()
    batteryInfo("BAT0")
--    sysInfo()
end)

-- every 60 seconds
awful.hooks.timer.register(60, function ()
    gmailUpdate()
end)
-- }}}

Last edited by semperfiguy (2009-01-09 23:02:08)

Offline

#2 2009-01-10 00:26:17

labox
Member
From: Sweden
Registered: 2009-01-06
Posts: 10

Re: Awesome WM 3 overloading CPU

Had the same problem a while ago on my desktop with a nvidia card (running openbox now). Works like a charm on my laptop though. Anyways... According to the thread i found while searching for a solution there was (is.. obviously)  a problem with the nvidia drivers and awesome.

Offline

#3 2009-01-10 00:28:08

Ghost1227
Forum Fellow
From: Omaha, NE, USA
Registered: 2008-04-21
Posts: 1,422
Website

Re: Awesome WM 3 overloading CPU

I'm using awesome3 with nvidia drivers.... no problems here!


.:[My Blog] || [My GitHub]:.

Offline

#4 2009-01-10 00:39:31

labox
Member
From: Sweden
Registered: 2009-01-06
Posts: 10

Re: Awesome WM 3 overloading CPU

Ghost1227 wrote:

I'm using awesome3 with nvidia drivers.... no problems here!

Yeah well  this was a couple of months ago... I've run Awesome without problems since then on my desk, I just don't prefer it over openbox. I just rememer having the same problem. I used a unmodified config BTW.

Offline

#5 2009-01-10 04:15:34

Intrepid
Member
Registered: 2008-06-11
Posts: 254

Re: Awesome WM 3 overloading CPU

@semperfiguy:  Do trial and error.  Your functions are utilized as widgets.  I have many home-made and borrowed functions and have no problem.  First, test your settings with the default rc.lua and tell us if something is still wrong.  Are all your modules up to date?  Nvidia drivers/kernel? (Sorry but NOT everybody does this smile.

Also, what kind of machine/arch (32-bit/64-bit) are you running?  I use 64 bit amd with 64 bit archlinux and an nvidia card.

Lastly, if it's not any trouble, try trial and error on widgets and notifications, using lua comments to comment your widgets out and keep adding them back.  I suggest you change your volume hook for example.  Your hooks load rather quickly.  I would do Gmail notification every 5 minutes or so and my volume hook updates every 10 seconds but getVol is displayed as soon as I mouse over to change the volume.  Instead,  If you are using a tray, you can replace naughty notification with Noteo, highly recommended.  I do not suggest checking gpu temp so often with nvidia-settings.  Do you have powermizer and thermal monitor on in nvidia-settings?

Use lua style comments to comment all custom widgets out then gradually add them again, noticing any difference while we look over your rc.lua/functions.lua.  Also, load the same background processes and try using a different WM to see if the same thing occurs.  Hope to hear back.  I don't see anything wrong in functions.lua.


Intrepid (adj.): Resolutely courageous; fearless.

Offline

#6 2009-01-10 18:43:48

Intrepid
Member
Registered: 2008-06-11
Posts: 254

Re: Awesome WM 3 overloading CPU

I just thought of something.  Are you running Xcompmgr?  xcompmgr is known to sometimes bring CPU usage of X to 100%.  It did that to me today.  Killing it solved the cpu usage for me.

Last edited by Intrepid (2009-01-10 18:44:45)


Intrepid (adj.): Resolutely courageous; fearless.

Offline

#7 2009-01-10 19:29:07

semperfiguy
Member
Registered: 2007-12-03
Posts: 224

Re: Awesome WM 3 overloading CPU

Yes I am using xcompmgr. I will try running without it. Maybe that will solve some things.

And just for testing purposes, what is a "block" comment in lua? I know the line comment is "--" but that gets tedious for long chunks of code.

Last edited by semperfiguy (2009-01-10 19:51:10)

Offline

#8 2009-01-10 22:07:44

ST.x
Member
From: Sydney, Australia
Registered: 2008-01-25
Posts: 363
Website

Re: Awesome WM 3 overloading CPU

semperfiguy wrote:

Yes I am using xcompmgr. I will try running without it. Maybe that will solve some things.

And just for testing purposes, what is a "block" comment in lua? I know the line comment is "--" but that gets tedious for long chunks of code.

It's --[[ ]]--
I see you're using some of the stuff from my config, don't do the volume hook every second, also increase the times for sysinfo and others to around 20s or 15s. And when I used to use xcompmanager it used to be like that sometimes as well. Instead just use the pseudo-transparency through xdefaults (check my configs).

Last edited by ST.x (2009-01-10 22:10:26)

Offline

#9 2009-01-13 17:06:10

semperfiguy
Member
Registered: 2007-12-03
Posts: 224

Re: Awesome WM 3 overloading CPU

I am pretty sure the problem was the xcompmgr. I made the volume hook run so often because I don't like waiting to see what my volume is at. Just a pet peeve I guess. I may increase the sysinfo though. Your functions work very well though. Thank You. smile

Offline

Board footer

Powered by FluxBB