Ok, I finally tested this
It turns out I was wrong. You can use < > <= >= when comparing text to text. Some texts are greater than others I guess.
Code:minimum_size 256 512 maximum_width 1366 gap_x 1 gap_y 1 #alignment bm update_interval 2.0 draw_shades no draw_outline no draw_borders no draw_graph_borders no uppercase no own_window yes own_window_type normal # normal desktop override own_window_transparent no # yes no own_window_hints skip_taskbar,skip_pager # undecorated,below,above,sticky,skip_taskbar,skip_pager own_window_colour black double_buffer yes use_xft yes xftfont Radio Space Bold:size=8 default_color white #${font sans:size=10}${font} #${color green}YES/1/TRUE${color}${else}${color red}NO/0/FALSE${color}${endif} #no test ${font sans:size=8}^_^${font} TEXT ${color yellow}build_arch ${conky_build_arch} build_date ${conky_build_date} conky_version ${conky_version}${color} ${color green}start test${color} ${font sans:size=8} B002 > A002 ${if_match "B002" > "A002"}${color green}YES/1/TRUE${color}${else}${color red}NO/0/FALSE${color}${endif} B002 = A002 ${if_match "B002" == "A002"}${color green}YES/1/TRUE${color}${else}${color red}NO/0/FALSE${color}${endif} B002 < A002 ${if_match "B002" < "A002"}${color green}YES/1/TRUE${color}${else}${color red}NO/0/FALSE${color}${endif} ${font} ${color red}end test${color} ${color yellow}${kernel} ${machine}${if_match "${battery}" != "not present"}${if_match "${execi 60 cat /proc/acpi/battery/BAT0/state | grep charged | awk '{print $3}'}" != "charged"} ${execi 60 cat /proc/acpi/battery/BAT0/state | grep capacity: | awk '{print $3 $4}'} ${execi 60 cat /proc/acpi/battery/BAT0/state | grep rate: | awk '{print $3 $4}'} ${battery_time}${endif}${endif}${color}
you might also want to try strings that cannot be interpreted as Hexidecimal.
|| Kubuntu x86_64 (15.10 Dev.) || KDE 4.9.00 ||
|| Dell Inspiron 570 || 8GB PC3-10600 DDR3 RAM || AMD Phenom II X4 820 @ 2.8Ghz ||
|| Logitech M570 Trackball || Logitech G15 Gaming Keyboard ||
Conky: ... no such configuration: 'normal'
Good point.
Let's see what conky says about ${if_match "Crinos512" > "miegiel"}
oops
Code:minimum_size 256 512 maximum_width 1366 gap_x 1 gap_y 1 #alignment bm update_interval 2.0 draw_shades no draw_outline no draw_borders no draw_graph_borders no uppercase no own_window yes own_window_type normal # normal desktop override own_window_transparent no # yes no own_window_hints skip_taskbar,skip_pager # undecorated,below,above,sticky,skip_taskbar,skip_pager own_window_colour black double_buffer yes use_xft yes xftfont Radio Space Bold:size=8 default_color white #${font sans:size=10}${font} #${color green}1 / TRUE / YES${color}${else}${color red}0 / FALSE / NO${color}${endif} #no test ${font sans:size=8}^_^${font} TEXT ${color yellow}build_arch ${conky_build_arch} build_date ${conky_build_date} conky_version ${conky_version}${color} ${color green}start test${color} ${font sans:size=8} Crinos512 > miegiel ${if_match "Crinos512" > "miegiel"}${color green}1 / TRUE / YES${color}${else}${color red}0 / FALSE / NO${color}${endif} Crinos512 = miegiel ${if_match "Crinos512" == "miegiel"}${color green}1 / TRUE / YES${color}${else}${color red}0 / FALSE / NO${color}${endif} Crinos512 < miegiel ${if_match "Crinos512" < "miegiel"}${color green}1 / TRUE / YES${color}${else}${color red}0 / FALSE / NO${color}${endif} ${font} ${color red}end test${color} ${color yellow}${kernel} ${machine}${if_match "${battery}" != "not present"}${if_match "${execi 60 cat /proc/acpi/battery/BAT0/state | grep charged | awk '{print $3}'}" != "charged"} ${execi 60 cat /proc/acpi/battery/BAT0/state | grep capacity: | awk '{print $3 $4}'} ${execi 60 cat /proc/acpi/battery/BAT0/state | grep rate: | awk '{print $3 $4}'} ${battery_time}${endif}${endif}${color}
I've been messing with my conky layout since I switched from XFCE4 to Fluxbox. The main change was making the TV listing in two columns.
screenshot2010-01-28T19:48:17-0500.png
A list of all the Bash stuff I use can be found in my public Dropbox. I also have a semi-maintained website with some info about the stuff I use. I still have to do a proper writeup of the date highlighting on my calendar.
Notice that nice "feels like" temperature in the weather section. I was outside earlier. It totally did feel like 0 degrees.
|| Kubuntu x86_64 (15.10 Dev.) || KDE 4.9.00 ||
|| Dell Inspiron 570 || 8GB PC3-10600 DDR3 RAM || AMD Phenom II X4 820 @ 2.8Ghz ||
|| Logitech M570 Trackball || Logitech G15 Gaming Keyboard ||
Conky: ... no such configuration: 'normal'
I was wondering if someone could tell me how to display all of the output of: top -u camden in a block on one side of the desktop, configuring conky seems to be beyond me right now.
"There does not exist, nor can there exist, true chaos, rather what is taken to be chaotic is by nature a system which is governed by laws the observer either cannot or refuses to accept." ~Camden Narzt
I'm running boinc.pl to monitor my BOINC projects. It ouputs the project name, the workunit number, percent complete for each workunit, and an indicator if that particular work unit is currently running or not. The problem is each percentage varies between one decimal place to four. Does anyone know of a way to force it to output only two or three decimal places, and to append a 0 when needed?
boinc.pl
Code:#!/usr/bin/perl $BoincStatePath="/var/lib/boinc-client"; $BoincClientStateFile="client_state.xml"; $StateFile="$BoincStatePath/$BoincClientStateFile"; open(INFO, $StateFile); @lines = <INFO>; close(INFO); sub strip_tags($); sub convert_time_to_string($); sub estimate_time_remaining; $projectCount = 0; $wuCount = 0; $wuActive = 0; $wuActiveTask = 0; foreach $line (@lines) { if ($line =~ /<master_url>/) { $projectMasterURL[$projectCount] = strip_tags($line); } if ($line =~ /<project_name>/) { $projectName[$projectCount] = strip_tags($line); $projectCount++; } if ($line =~ /<workunit>/) { $wuCount++; } if ($line =~ /<active_task_state>1/) { $wuA[$wuActiveTask] = "\${voffset 2}*\${voffset -2}"; $wuActive++; } if ($line =~ /<active_task>/) { $wuActiveTask++; } if ($line =~ /<result_name>/) { $wuName[$wuActiveTask] = strip_tags($line); } if ($line =~ /<fraction_done>/) { $wuPercent[$wuActiveTask] = strip_tags($line) * 100; } if ($line =~ /<project_master_url>/) { $wuMasterURL[$wuActiveTask] = strip_tags($line); } if ($line =~ /<current_cpu_time>/) { $wuCPUTime[$wuActiveTask] = convert_time_to_string(strip_tags($line)); $wuCPUTimeRaw[$wuActiveTask] = strip_tags($line); } } print "\${color3}Active BOINC WUs: \${color1}".$wuActive."/".$wuCount."\n"; for($i = 0; $i <= $projectCount; ++$i) { print $projectName[$i]; for ($j = 1; $j <= $wuActiveTask; ++$j) { if($projectMasterURL[$i] eq $wuMasterURL[$j]) { print "\${color3}WU".$j.":\${color1} ".$wuPercent[$j]."% Complete ".$wuA[$j]."\n"; # $estTime = convert_time_to_string(estimate_time_remaining($wuCPUTimeRaw[$j],$wuPercent[$j])); # print "CPU Time: ".$wuCPUTime[$j]." Time Remaining: ".$estTime."\n"; } } } sub strip_tags($) { my $string = shift; $string =~ s/<(.*?)>//gi; $string =~ s/ //gi; return $string; } sub convert_time_to_string($) { $cpuTime = int($_[0]); #Calculate the number of days if ($cpuTime > 86400) { $timeDays = $cpuTime/(24*60*60).":"; } else { $timeDays = ""; } #Calculate the number of hours and minutes $timeHours = ($cpuTime/(60*60))%24; $timeMinutes = ($cpuTime/60)%60; $timeSeconds = $cpuTime%60; $cpuTimeString = $timeDays.$timeHours.":".$timeMinutes.":".$timeSeconds; return $cpuTimeString; } sub estimate_time_remaining { $cpuTime = $_[0]; $currentPercent = $_[1]; $onePercentTime = $cpuTime/$currentPercent; $totalTime = $onePercentTime * 100; $estimatedTimeReminaing = $totalTime - $cpuTime; return $estimatedTimeReminaing; }
Is ugly and probably not what you want. Try this instead :Code:${exec top -u camden}
(both should be below the TEXT line in your .conkyrc (just in case))Code:load = ${loadavg} ${top name 1} (c/m/p) ${goto 170}${top cpu 1} ${goto 220}${top mem 1} ${goto 270}${top pid 1} ${top name 2} ${goto 170}${top cpu 2} ${goto 220}${top mem 2} ${goto 270}${top pid 2} ${top name 3} ${goto 170}${top cpu 3} ${goto 220}${top mem 3} ${goto 270}${top pid 3}
Bookmarks