Conky - dynamic color change [SOLVED]

Add functionality to your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Jim Hauser

Conky - dynamic color change [SOLVED]

Post by Jim Hauser »

Hi all:

Occasionally when rendering fractals with Fractorium, the GPU render causes the GPU temperature to climb dramatically. The normal temperature with no real load is around 110 F. While rendering it can get as high as 150 F. This is in itself not a big problem but with a few dust bunnies it could go higher.

I am currently using conky to monitor this temperature and would like to know if there is a simple way to change the color of the temperature reading at pre-determined increments. For instance <130 F green, >130 F but <140 F yellow, and >140 F red.

I am currently using conky version 1.10.1-3 and it works fine as is.

This is the code for GPU temperature.

Code: Select all

${color}GeForce GT 740 SC              ${color green} ${alignr}${nvidia temp} F
Here is the inxi -Fxz if that helps.

Code: Select all

System:    Host: JDHKDE1 Kernel: 4.10.0-32-generic x86_64 (64 bit gcc: 5.4.0)
           Desktop: KDE Plasma 5.8.7 (Qt 5.6.1) Distro: Linux Mint 18.2 Sonya
Machine:   Mobo: ASUSTeK model: M5A78L-M/USB3 v: Rev X.0x Bios: American Megatrends v: 2101 date: 12/02/2014
CPU:       Octa core AMD FX-8350 Eight-Core (-MCP-) cache: 16384 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm) bmips: 64283
           clock speeds: max: 4017 MHz 1: 4017 MHz 2: 4017 MHz 3: 4017 MHz 4: 4017 MHz 5: 4017 MHz 6: 4017 MHz
           7: 4017 MHz 8: 4017 MHz
Graphics:  Card: NVIDIA GK107 [GeForce GT 740] bus-ID: 01:00.0
           Display Server: X.Org 1.18.4 drivers: nvidia (unloaded: fbdev,vesa,nouveau)
           Resolution: 1280x1024@60.02hz, 1920x1080@60.00hz
           GLX Renderer: GeForce GT 740/PCIe/SSE2 GLX Version: 4.5.0 NVIDIA 375.66 Direct Rendering: Yes
Audio:     Card-1 NVIDIA GK107 HDMI Audio Controller driver: snd_hda_intel bus-ID: 01:00.1
           Card-2 Advanced Micro Devices [AMD/ATI] SBx00 Azalia (Intel HDA) driver: snd_hda_intel bus-ID: 00:14.2
           Sound: Advanced Linux Sound Architecture v: k4.10.0-32-generic
Network:   Card: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
           driver: r8169 v: 2.3LK-NAPI port: e800 bus-ID: 03:00.0
           IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives:    HDD Total Size: 6001.2GB (20.4% used) ID-1: /dev/sda model: ST2000DM006 size: 2000.4GB
           ID-2: /dev/sdb model: ST2000DM006 size: 2000.4GB ID-3: /dev/sdc model: ST1000DM003 size: 1000.2GB
           ID-4: /dev/sdd model: ST1000DM003 size: 1000.2GB
Partition: ID-1: / size: 106G used: 37G (37%) fs: ext4 dev: /dev/dm-0
           ID-2: swap-1 size: 18.87GB used: 0.00GB (0%) fs: swap dev: /dev/sda2
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 34.0C mobo: 39.0C gpu: 0.0:48C
           Fan Speeds (in rpm): cpu: 1418 sys-1: 1415
Info:      Processes: 270 Uptime: 11 min Memory: 1030.7/16028.1MB Init: systemd runlevel: 5 Gcc sys: 5.4.0
           Client: Shell (bash 4.3.481) inxi: 2.2.35 
I am just looking for something that can grab my attention. It seems like it should be something simple but I simply do not know. I do know that adding too many things in conky can impact system performance and am keeping that in mind.

This is not an extremely serious issue but any tips will be appreciated. I will continue to search but this is not a deal killer, I'm just trying to learn new things.

Going on 4 years now with Mint KDE thanks to all of the fine developers, moderators and community members.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Conky - dynamic color change

Post by catweazel »

https://jimdean.id.au/2016/01/05/dynami ... -in-conky/
That uses the battery as an example. It shouldn't be too difficult to change it for your desired sensor.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Jim Hauser

Re: Conky - dynamic color change

Post by Jim Hauser »

catweazel wrote:https://jimdean.id.au/2016/01/05/dynami ... -in-conky/
That uses the battery as an example. It shouldn't be too difficult to change it for your desired sensor.
Thanks catweazel!

This looks like the type of script that I can use. Will give it a go tomorrow (later today...)
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Conky - dynamic color change

Post by catweazel »

Jim Hauser wrote:Thanks catweazel!

This looks like the type of script that I can use. Will give it a go tomorrow (later today...)
It's amazing what you can find with google :mrgreen:
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Jim Hauser

Re: Conky - dynamic color change [SOLVED]

Post by Jim Hauser »

It worked like a charm catweazel! Conky is now doing exactly what I wanted. Here is what I ended up with for the script.

Code: Select all

${color}GeForce GT 740 SC              ${color green} ${if_match ${nvidia temp}<=140}${color green}${alignr}${nvidia temp} F${else}${if_match ${nvidia temp}<=150}${color yellow}${alignr}${nvidia temp} F${else}${if_match ${nvidia temp}>150}${color red}${alignr}${nvidia temp} F${endif}${endif}${endif}${color}
This will come in handy down the road for other things but for now it is perfect...

P.S. I do not use google search but that is another discussion for another day.

Cheers!

Jim
Locked

Return to “Compiz, Conky, Docks & Widgets”