Re: [dev] dwm xsetroot colorful fonts howto?

From: Le Tian <>
Date: Sat, 14 May 2011 18:08:00 +0300

On Sat, May 14, 2011 at 1:52 PM, Le Tian <> wrote:

> On Sat, May 14, 2011 at 6:45 AM, Anders Andersson <>wrote:
>> On Fri, May 13, 2011 at 11:11 PM, Bogdan IonuČ› <>
>> wrote:
>> > On Sat, May 14, 2011 at 00:01, Le Tian <> wrote:
>> >>
>> >> I'm sorry, maybe its been discussed like a lot of times, but can
>> anybody
>> >> tell me how to color taskbar fonts in dwm? There is a patch
>> >> ( but that I don't like,
>> I need
>> >> fonts to be colored not a colorful bg or fg in the taskbar, and maybe
>> its
>> >> possible to change the colors on-the-fly (when monitoring high CPU
>> temps)?
>> >> Maybe somebody has it implemented already.
>> >>
>> >> --
>> >> Tian
>> Why don't you set something up that throttles the CPU and eventually
>> turns it off in case it gets too hot? What use is there to show the
>> temperature on the status bar? Will the computer break if you're not
>> there to turn it off in case it gets too hot?
>> I just think things like this ruins the clean experience that dwm is.
> cpu temp is not that useful, its agreeable, when hdd temp is very useful,
> its crucial for laptop users like me to keep their hdd temperature under
> proper control. If I was using a desktop pc, I wouldn't bother myself with
> these tweaks, but as long as summer is coming, I think it come useful for my
> laptop.
> --
> Tian
> Hi again, I managed to color taskbar output, but I need the cpu values to
be colored on-the-fly, so when my temp is more than 50C then the values
should be red etc. can somebody help me to correct my script?
I understand that I must add a "if else" condition, but it doesn't work,
when I do, simply because I don't know correct syntax, and try to learn

here is my original script:
while true

cpu_temp=$(cat /proc/acpi/ibm/thermal | awk '{printf("\x04 cpu: "$3"*"$4"

root_vol=$(df -h / | awk 'END {printf("\x01| root: "$5)}' | sed 's/Use%//')
home_vol=$(df -h /home| awk 'END {printf("\x01home: "$5)}' | sed 's/Use%//')
vol=$(aumix -q | awk '/vol/ {printf("\x01|\x03vol:"$3)}')
date=$(date | awk 'END {printf("\x01| \x01"$1" "$2" "$3)}')
uptime=$(uptime | awk 'BEGIN {FS = ":"}; END {printf("\x01|"$1":"$2)}')
taskbar_info=$(echo -e $cpu_temp $root_vol $home_vol $vol $date $uptime)

xsetroot -name "$taskbar_info"
sleep 5

There should be "if $cpu_temp > 60 then; "do the command again with red
colors", and how can I check the range of "if" condition? For example:
when cpu temp is [50-55] then it should be blue, when it goes up to [60-65]
then red, so "if $cpu_temp == [50-55]; then "do command", but it doesn't
work(. Can somebody help me with syntax? Forgive me my ignorance, but I will
be very thankful if somebody will help with it.

Received on Sat May 14 2011 - 17:08:00 CEST

This archive was generated by hypermail 2.2.0 : Sat May 14 2011 - 17:12:02 CEST