Conky - dynamic color change [SOLVED]

Forum rules
Before you post please read how to get help
User avatar
Jim Hauser
Level 4
Level 4
Posts: 298
Joined: Mon Jun 30, 2014 10:08 pm
Location: Pascagoula, Mississippi

Conky - dynamic color change [SOLVED]

Postby Jim Hauser » Sun Aug 27, 2017 3:54 am

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 Jim Hauser on Sun Aug 27, 2017 6:58 pm, edited 2 times in total.

User avatar
catweazel
Level 8
Level 8
Posts: 2490
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Conky - dynamic color change

Postby catweazel » Sun Aug 27, 2017 3:58 am

https://jimdean.id.au/2016/01/05/dynamic-colour-changes-in-conky/
That uses the battery as an example. It shouldn't be too difficult to change it for your desired sensor.
Mint Donor #6036
If your problem is fixed, please mark your thread as [SOLVED] by editing the title of the first message in the thread.

User avatar
Jim Hauser
Level 4
Level 4
Posts: 298
Joined: Mon Jun 30, 2014 10:08 pm
Location: Pascagoula, Mississippi

Re: Conky - dynamic color change

Postby Jim Hauser » Sun Aug 27, 2017 4:08 am

catweazel wrote:https://jimdean.id.au/2016/01/05/dynamic-colour-changes-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 8
Level 8
Posts: 2490
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Conky - dynamic color change

Postby catweazel » Sun Aug 27, 2017 5:15 am

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:
Mint Donor #6036
If your problem is fixed, please mark your thread as [SOLVED] by editing the title of the first message in the thread.

User avatar
Jim Hauser
Level 4
Level 4
Posts: 298
Joined: Mon Jun 30, 2014 10:08 pm
Location: Pascagoula, Mississippi

Re: Conky - dynamic color change [SOLVED]

Postby Jim Hauser » Sun Aug 27, 2017 6:08 pm

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


Return to “Compiz, Conky, Docks, & Widgets”

Who is online

Users browsing this forum: No registered users and 2 guests