[SOLVED] Conky help needed

Message
Author
User avatar
JayM
Qualified MX Guide
Posts: 6793
Joined: Tue Jan 08, 2019 4:47 am

[SOLVED] Re: Conky help needed

#11 Post by JayM »

jonnken wrote: Sun Mar 17, 2019 7:39 am In Spreadsheet grammar, an IF bracket encapsulates the AND logic result. So if two IF's are used to generate the AND true/false result...then wouldn't a third IF be needed to REDIRECT the AND result of the first two IF's?
I'm not using nested IFs to replicate an AND, I'm only saying IF thisA do this1 ELSE IF thisB do this2 ELSE do this3.
Last edited by JayM on Mon Mar 18, 2019 3:10 am, edited 1 time in total.
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

User avatar
manyroads
Posts: 2603
Joined: Sat Jun 30, 2018 6:33 pm

Re: Conky help needed

#12 Post by manyroads »

If you look at the conky I wrote (see /home/,username>/.conky/MX-ManyRoads/) You'll find other (eye candy) ways of doing this sort of thing using graduated color bars. In mine I use it for disk, mem, but not temp.
Pax vobiscum,
Mark Rabideau - ManyRoads Genealogy -or- eirenicon llc. (geeky stuff)
i3wm, bspwm, hlwm, dwm, spectrwm ~ Linux #449130
"For every complex problem there is an answer that is clear, simple, and wrong." -- H. L. Mencken

User avatar
fehlix
Developer
Posts: 10310
Joined: Wed Apr 11, 2018 5:09 pm

Re: Conky help needed

#13 Post by fehlix »

JayM wrote: Sun Mar 17, 2019 4:46 am I "unsolved" this because now my hard drive temperatures aren't behaving and I'm not seeing what the problem is. Maybe an extra pair of eyes will see what I'm missing. My drive sdb is currently at 41 degrees but its temp is still showing as green, not yellow.
See this:

Code: Select all

false:${if_match "41°C" <  40 } < 40°C ${else} >=40°C ${endif}
right:${if_match "41°C" < "40"} < 40°C ${else} >=40°C ${endif}
:puppy:
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

User avatar
JayM
Qualified MX Guide
Posts: 6793
Joined: Tue Jan 08, 2019 4:47 am

Re: Conky help needed

#14 Post by JayM »

fehlix wrote: Sun Mar 17, 2019 9:55 am
JayM wrote: Sun Mar 17, 2019 4:46 am I "unsolved" this because now my hard drive temperatures aren't behaving and I'm not seeing what the problem is. Maybe an extra pair of eyes will see what I'm missing. My drive sdb is currently at 41 degrees but its temp is still showing as green, not yellow.
See this:

Code: Select all

false:${if_match "41°C" <  40 } < 40°C ${else} >=40°C ${endif}
right:${if_match "41°C" < "40"} < 40°C ${else} >=40°C ${endif}
:puppy:
I didn't get much sleep last night as I had to get up very early to be somewhere by 8:30AM, so my brain isn't functioning well today. But I don't understand what you're saying, or rather, how I can make use of your example. However, you've given me a huge hint: I'd forgotten that "hddtemp /dev/sdb" returns "/dev/sdb: WDC WD5000AAKX-75U6AA0: 42°C" and piping that through "awk '{print $4}'" returns "42°C"" not "42". So what I need to figure out is how to pipe awk's results through something that removes the "°C"" from the end so the end result is just "42" in order to make my if statement work for the hard drive temps, or else use something other than that awk statement to extract just the temperature's number from the entire string produced by hddtemp (remove everything but the third and fourth characters from the end of the string. Please, please don't make me have to use sed, God!)

I'll take a little nap then see if I can figure this out.
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

User avatar
JayM
Qualified MX Guide
Posts: 6793
Joined: Tue Jan 08, 2019 4:47 am

Re: Conky help needed

#15 Post by JayM »

In bash

Code: Select all

$ hddtemp /dev/sda | awk '{print $3}' | sed 's/..$//'
38
and

Code: Select all

$ hddtemp /dev/sdb | awk '{print $4}' | sed 's/..$//'
43
give me the results I'm looking for, yet

Code: Select all

alignment top_right
background yes
background_color 000000
border_inner_margin 0
border_width 0
default_color FFFFFF
default_outline_color black
default_shade_color black
double_buffer yes
draw_borders no
draw_graph_borders no
draw_outline no
draw_shades no
gap_x 0
gap_y 50
minimum_size 250 150
no_buffers yes
override_utf8_locale yes
own_window yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_argb_visual no
own_window_argb_value 255
own_window_class Conky
own_window yes
own_window_transparent no
own_window_type normal
pad_percents 2
short_units yes
stippled_borders 0
top_name_width 5
update_interval 1
uppercase yes
use_spacer right
use_xft yes
xftalpha 1.0 #0.2
xftfont Cure:bold:size=12

# Color scheme #
default_color ffffff

color1 FFFFFF
color2 FF9616
color3 1CE3BB
color4 FFFF00 #yellow
color5 009900 #green
color6 FF0000 #red
###########################
own_window_colour 000000
TEXT

${if_match ${hwmon 0 temp 1} <"40"}${color5}${hwmon 0 temp 1}°C${color}
	${else}
${if_match ${hwmon 0 temp 1} >"50"} ${color6}${hwmon 0 temp 1}°C${color}
	${else}
${color4}${hwmon 0 temp 1}°C${color}
${endif}
${endif}
${if_match ${exec /usr/sbin/hddtemp /dev/sda | awk '{print $3}' | sed 's/..$//'} <"40"}${color5}${exec /usr/sbin/hddtemp /dev/sda | awk '{print $3}'}${color}
	${else}
${if_match ${exec /usr/sbin/hddtemp /dev/sda | awk '{print $3}' | sed 's/..$//'} >"50"}${color6}${exec /usr/sbin/hddtemp /dev/sda | awk '{print $3}'}${color}
	${else}  
${color4}${exec "/usr/sbin/hddtemp /dev/sda | awk '{print $3}'"}${color}
${endif}
${endif}
		
${if_match ${exec /usr/sbin/hddtemp /dev/sdb | awk '{print $4}' | sed 's/..$//'} <"40"}${color5}${exec /usr/sbin/hddtemp /dev/sdb | awk '{print $4}'}${color}
	${else}
${if_match ${exec /usr/sbin/hddtemp /dev/sdb | awk '{print $4}' | sed 's/..$//'} >"50"}${color6}${exec /usr/sbin/hddtemp /dev/sdb | awk '{print $4}'}${color}
	${else}  
${color4}${exec /usr/sbin/hddtemp /dev/sdb | awk '{print $4}'}${color}
gives me Image
Why is 42°C still green instead of yellow?
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

User avatar
JayM
Qualified MX Guide
Posts: 6793
Joined: Tue Jan 08, 2019 4:47 am

Re: Conky help needed

#16 Post by JayM »

Solved it. I had to remove the quotation marks around the numbers 40 and 50 so they'll be treated as actual numeric values, not strings.
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

Post Reply

Return to “XFCE Desktop Environment”