You are not logged in.

#1 2008-12-29 02:53:17

filam
Wiki Maintainer
From: Portland, ME
Registered: 2008-04-11
Posts: 158
Website

[SOLVED] dwm Basic Statusbar spikes CPU usage

When I attempt to add battery status to dwm by adding the following to my ~/.xinitrc and start X I get ~100% CPU usage.

ArchWiki wrote:

while true
do
acpi | awk '{ print $3, $4 }' | sed s/","//g
done | exec dwm

When I uncommented the previous lines and left 'exec dwm' cpu usage returns to normal.

Would you happen to know a reason for the increase in usage?

Last edited by filam (2008-12-30 06:38:42)

Offline

#2 2008-12-29 03:03:18

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: [SOLVED] dwm Basic Statusbar spikes CPU usage

Because it will poll every nanosecond. Put a sleep 10 in there or something

while true
do
acpi | awk '{ print $3, $4 }' | sed s/","//g
sleep 10
done | exec dwm

Offline

Board footer

Powered by FluxBB