0

I have a conky script displaying drives info, percentage used, current amount used and total size

I have a total bar under each drive name and I want to change the colour to red if the total is greater than 90%

For the highest cpu/mem sections I am running top command for top4 processes and setting top1 to red

Do i need some sort of if statement to do this with the total bar for drives? Not sure how to do if statements in conky.

enter image description here

here is my current script

use_xft yes
xftfont 123:size=8
xftalpha 0.1
update_interval 1
total_run_times 0

own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_colour 000000
own_window_argb_visual yes
own_window_argb_value 0

double_buffer yes
#minimum_size 250 5
#maximum_width 500
draw_shades no
draw_outline yes
draw_borders no
draw_graph_borders no
default_color 000000
default_shade_color 000000
default_outline_color 99ddff

alignment top_left
gap_x 0
gap_y 320
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale yes
use_spacer yes


minimum_size 0 0
TEXT
${font GE Inspira:pixelsize=25}
${color }CPU:  ${color }$cpu% 
${color 99ddff}${cpubar 5,150}
${color }MEM:  ${color }$memperc% $mem/$memmax
${color 99ddff}${membar 5,150}

${color }SWAP: ${color }$swapperc% $swap/$swapmax
${color 99ddff}${swapbar 5,150}
${color }ROOT: ${color }${fs_used_perc /}% ${fs_free /}/${fs_size /}
${color 99ddff}${fs_bar 5,150 /}
${color }HOME: ${color }${fs_used_perc /home/brian/}% ${fs_free /home/brian/}/${fs_size /home/brian/}
${color 99ddff}${fs_bar 5,150 /home/brian/}
${color }MOVIES: ${color }${fs_used_perc /media/brian/Movies/}% ${fs_free /media/brian/Movies/}/${fs_size /media/brian/Movies/}
${color 99ddff}${fs_bar 5,150 /media/brian/Movies}
${color }ANIME: ${color }${fs_used_perc /media/brian/Anime/}% ${fs_free /media/brian/Anime/}/${fs_size /media/brian/Anime/}
${color 99ddff}${fs_bar 5,150 /media/brian/Anime}
${color }TV SHOWS: ${color }${fs_used_perc /media/brian/Tv Shows/}% ${fs_free /media/brian/Tv Shows/}/${fs_size /media/brian/Tv Shows/}
${color 99ddff}${fs_bar 5,150 /media/brian/Tv Shows}

1 Answers1

0

The Conky object if_match is the key. For example...

${if_match ${fs_used_perc /media/brian/Tv Shows/} > 90}${color red}${else}${color 99ddff}${endif}${fs_bar 5,150 /media/brian/Tv Shows}

See man conky for more info.

David Yockey
  • 595
  • 3
  • 11