You are not logged in.
Hi all I think this may be a good place to post this, Ive been trying to make a conky config to show the current LTC and BTC price but having some problems. Anyone have a basic config to do this? Thanks!
You're asking for something specific not something that someone just might have laying around. But you're in luck - a bit ... someone one asked over on Ubuntu asked about BIT coins:
@Chrison999
Does this work.
Create a script to run the curl command. Enclose the https in double quotes.
curl-cavirtex.sh#!/bin/bash curl [color="#FF0000"]"[/color][url]https://cavirtex.com/api2/trades.json?currencypair=BTCCAD&days=1[/url][color="#FF0000"]"[/color] | cut -d " " -f 11,13,25 | sed -e 's/,//g' -e 's/ / /g' -e 's/}//g'
Conky line just using execi to call the script. (Use your path to script)
${execi 3600 /home/CantankRus/scripts/curl-cavirtex.sh}
So what exactly is the problem you ate having?
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
Offline
Yea, simple & simple ... I like the look...
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
@seraphtrend: love the Totorro wallpaper -- where did you find that?
Offline
Hi there, after much struggling, I'm afraid I have to ask you gurus here.
It just does not work.
$cpugraph should change color dependent on CPU load.
Whilst I could do this with built-in conky variables, I might need EIGHT nested end-ifs for the various intervals, since conky syntax does not support true "else if" (it's horrid).
${execpi 0.5 /home/serr/.conkyhelper_cpugraph.sh ${cpu}}
#!/bin/bash
# uses conky code; must be executed via execpi / texecpi ((t)execi won't parse)
# cval=$(echo "\${cpu}"
cval=$1
ccolor=""
# note the following case..esac block is heavily simplified, in reality it is way longer
case "$cval" in
100|[6-9][0-9]) # 60..100
ccolor="cc1f1f" ;;
[3-5][0-9]) # 30...59
ccolor="e9f500" ;;
*)
ccolor="1f2d8f" ;;
esac
echo "\${cpugraph 17, 0 b7b7b7 $ccolor}"
Unfortunately, it will always fall back into the default *) case.
Debugging revealed that it doesn't even get the parameter that I've passed over from my .conkyrc.
Tried with quotes, without quotes ... to no avail.
When Conky is running, I can see the value, but I cannot use it as criteria in my bash script.
Has anyone ever successfully managed this?
Script works on shell in dry-run, with cval set to $1.
Last edited by syntaxerror (2014-09-14 22:26:40)
Offline
^ ${execpi} only parses conky objects in the string returned by your script not in the command you execute so this will not work.
${execpi 0.5 /home/serr/.conkyhelper_cpugraph.sh ${cpu}}
This command is the equivalent of running
/home/serr/.conkyhelper_cpugraph.sh ${cpu}
in a terminal because of that.
You can do this with a Lua script that reads the ${cpu} value and calculates the color before passing it to something that draws the graph.
I don't know if you can call ${cpugraph} from a Lua script (I don't know if that would even work) or if you need to draw the graph with cairo in Lua for something this simple however?
I may not have time to look into that before Tuesday but someone else may already know and can help you before then.
Offline
@ syntaxerror
You could look at using Crinos512's colorize.sh script, it will colour three values. Assign color7, color8, and color9 to COOL, WARM, and HOT respectively oe Low, Med, High
@ arclance - yea, Ill bet LUA could do it, unfortunately I'm lua illiterate.
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
@ arclance - yea, Ill bet LUA could do it, unfortunately I'm lua illiterate.
Me too! I'd like to be able to change things around myself later, so this is why I'd like to do without LUA if possible.
Thanks so far, I've checked out Crinos' colorize script, but if I am permitted to say so, his explanation is horribly confusing and not sticking to facts. Plus, I don't see how he is passing ${...} values directly to a bash script from within Conky; the .sh is executed without parameters.
Last edited by syntaxerror (2014-09-14 23:50:23)
Offline
@ syntaxerror
I'll have an example for you shortly ....
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
Well...I'm further already!
Parameter passing works fine now ... just ... sh is still thwarting my plans, because it will always EXECUTE the line in question...
${execpi 0.5 $(echo '53' | xargs /home/serr/.conkyhelper_cpugraph.sh)}
(hardcoding value just to check if it jumps in correct case block)
Well, it worked! Color value is now known in my bash script.
But now SH stubbornly wants to execute my conky line as-is, as if it were a file:
echo "\${cpugraph 17, 0 b7b7b7 $ccolor}"
sh: 1: ${cpugraph: not found
Last edited by syntaxerror (2014-09-15 00:27:40)
Offline
Can't find it ... will look tomorrow.. sorry...
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
No probs
And I will keep on tinkering a bit here...
Offline
I've checked out Crinos' colorize script, but if I am permitted to say so, his explanation is horribly confusing and not sticking to facts. Plus, I don't see how he is passing ${...} values directly to a bash script from within Conky; the .sh is executed without parameters.
He is not passing values from conky directly to bash he is using things likes this
sensors | grep 'Core 0' | paste -s | cut -c15-18
to get the temperature of "Core 0" from the sensors program and then passes the result of that to his bash script with this part.
| xargs ~/.conky/conkyparts/colorize.sh
The script sends something determined by that value from sensors back to conky.
Offline
OK, you've won.
Yes I've now understood how he does it: he BYPASSES the internal conky parameter that calculates the cpu TEMP by using 'sensors' as an external tool to get the same result.
[edit] I GOT IT!!
Thanks for the help everyone, now that you had the will to bear with me, the profit will be on YOU!
The 7th (!) approach actually worked. I knew that ${eval} must be the key, just had to study several LUA calls to get the right idea how to pass the parameters to the bash script. Plus, it took so long because the lackluster kind of way that ${eval} is officially documented may almost be called a great impudence. Can't word it any differently, sorry.
${eval $${execpi 0.5 ~/.conkyhelper_cpugraph.sh ${cpu}}}
Now all I need to do is obtaining PERFECTLY smooth color gradient values for each single cpu usage percentage, and voila !!
So much for "you cannot pass parameters to bash, just vice-versa."
Case successfully closed.
Last edited by syntaxerror (2014-09-15 19:10:03)
Offline
Has anyone got/know how to make conky show time since the laptop was unplugged?
Showing the last, current, best, and average would be awsome, similar to what's available for phones....
Any pointers?
Offline
^ You might be able to get that information from upower, and run the scripts in conky. I don't know if it's installed by default with #!.
Last edited by PackRat (2014-09-15 20:07:08)
"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe
Offline
Now all I need to do is obtaining PERFECTLY smooth color gradient values for each single cpu usage percentage, and voila !!
I did not know about ${eval} because I do everything in lua, good research on that.
This is an example of how to calculate a gradient between two RGB colors in Lua.
function linear_gradient(Left_Color, Right_Color, Length, Position)
local positionPercent = Position/Length
local red = Right_Color[1] + (math.abs(Right_Color[1] - Left_Color[1]) * positionPercent)
local green = Right_Color[2] + (math.abs(Right_Color[2] - Left_Color[2]) * positionPercent)
local blue = Right_Color[3] + (math.abs(Right_Color[3] - Left_Color[3]) * positionPercent)
return red,green,blue
end --# function linear_gradient()
You would use the percentage a temperature was between two different reference temperatures (0 and 100 C for example) for positionPercent instead of what is used here.
Right_Color would be your low temperature color and Left_Color would be your high temperature color.
They are RBG triplets in an array like {255,255,255}.
math.abs returns the absolute value of the input value.
Conky wants color hexcodes so you would need to convert to that before you could use it.
This what I use to give the graphs in my conky a horizontal gradient.
I have no idea how you do math in a shell script though so I can't help with that.
Last edited by arclance (2014-09-16 02:04:13)
Offline
I have no idea how you do math in a shell script though so I can't help with that.
I've done the math in my head, which worked as well to some extent
Found this on wikimedia:
http://upload.wikimedia.org/wikipedia/c … GB.svg.png
First of all, I set a fixed width at 150, between 460 and 610 nanometers in spectral light, so each cpu percent will be 1.5 nanometers.
Then I turned on my "Rainbow" (Firefox add-on), selected "Color Inspector", used suitable steps (skipping a bit, since too narrow skip intervals won't occur as color change to the inert human eye), noted them down and built my array of 100 pretty homogenous values.
That was GOOD.
To get things to the 'VERY good' level, I would need one decimal of CPU usage (e. g. 57.3 percent) to create interim values. However, I haven't found any tool that can output realtime CPU usage in short intervals AND in high frequency.
'mpstat 2 1' takes up to 1 whole second to calculate, so I can't use that.
Last edited by syntaxerror (2014-09-16 03:42:07)
Offline
^ You might be able to get that information from upower, and run the scripts in conky. I don't know if it's installed by default with #!.
Thanks, but I can't see anything in there with regards to actual time, other than the time of the last update (ie every minute).
[21:08:49.159] device changed: /org/freedesktop/UPower/devices/battery_BAT1
native-path: /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT1
vendor: SANYO
model: NS3P3SZNJSWO
serial: 3695
power supply: yes
updated: Tue Sep 16 21:08:49 2014 (0 seconds ago)
has history: yes
has statistics: yes
battery
present: yes
rechargeable: yes
state: discharging
energy: 20.2451 Wh
energy-empty: 0 Wh
energy-full: 54.543 Wh
energy-full-design: 63.98 Wh
energy-rate: 9.63128 W
voltage: 11.218 V
time to empty: 2.1 hours
percentage: 37.1177%
capacity: 85.25%
technology: lithium-ion
History (charge):
1410898129 37.118 discharging
1410898098 37.306 discharging
1410898067 37.432 discharging
1410898036 37.620 discharging
History (rate):
1410898129 9.631 discharging
1410898098 10.317 discharging
1410898067 9.711 discharging
1410898036 10.694 discharging
Offline
battery
energy-empty: 0 Wh
Now that's what I call a marvellous bit of info! Probably the most essential line ever found in upower.
Thanks so much upower authors, without you I would never have learned about this most astonishing fact! ]:D
Last edited by syntaxerror (2014-09-18 18:35:53)
Offline
Hello all. I am relatively new to conky and have a minimal desktop system monitoring config that I am very happy with, but I have one annoying issue. The conky update seems to overwrite what is already on the screen so that I have both old and new information on the screen at the same time. The effect is that it gets blurry and unreadable over time. Any advice would be kindly appreciated. I have included my conkyrc below...
-Steve D
use_xft yes
xftfont Clear :pixelsize=12
xftalpha 0.8
update_interval 2.0
total_run_times 0
own_window_class conky
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders no
stippled_borders 0
#border_margin 4
border_width 0
default_color lightgrey
default_shade_color black
default_outline_color black
alignment top_right
gap_x 12
gap_y 32
no_buffers yes
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
use_spacer right
temperature_unit fahrenheit
TEXT
${alignr}$font
${alignr}$font «$sysname-$kernel» |
${alignr}$font |
${alignr}$font «${time %a %d. %b %k:%M}» |
${alignr}$font |
${alignr}$font «CPU» |
${alignr}$font ${exec cat /proc/cpuinfo | egrep -m 1 'model name' | sed -e 's/model name.*: //' | cut -c1-5} ${exec cat /proc/cpuinfo | egrep -m 1 'model name' | sed -e 's/model name.*: //' | cut -c10-13}-${exec cat /proc/cpuinfo | egrep -m 1 'model name' | sed -e 's/model name.*: //' | cut -c19-20} ${exec cat /proc/cpuinfo | egrep -m 1 'model name' | sed -e 's/model name.*: //' | cut -c32-37} Type --|
${alignr}$font ${freq_g (1)}GHz Freq --|
${alignr}$font $cpu% Load --|
${alignr}$font ${cpugraph 11,160} |
${alignr}$font Temp --|
${alignr}$font ${execi 1 sensors -f | grep "Core 0:" | cut -d+ -f2 | cut -c1-7}F Core --| |
${alignr}$font ${acpitemp}°F ACPI --' |
${alignr}$font Processes --|
${alignr}$font ${top name 1}${top cpu 1}% --| |
${alignr}$font ${top name 2}${top cpu 2}% --| |
${alignr}$font ${top name 3}${top cpu 3}% --| |
${alignr}$font ${top name 4}${top cpu 4}% --' |
${alignr}$font $processes Total --| |
${alignr}$font $running_processes Running --' |
${alignr}$font |
${alignr}$font «MEMORY» |
${alignr}$font $diskio_read Read --|
${alignr}$font $diskio_write Write --|
${alignr}$font Ram --|
${alignr}$font $memperc% Used --| |
${alignr}$font $mem/ $memmax --' | |
${alignr}$font ${top_mem name 1}${top mem 1}% --| |
${alignr}$font ${top_mem name 2}${top mem 2}% --| |
${alignr}$font ${top_mem name 3}${top mem 3}% --| |
${alignr}$font ${top_mem name 4}${top mem 4}% --' |
${alignr}$font ${fs_used} / ${fs_size} Hdd Root --|
${alignr}$font |
${alignr}$font «NETWORK» |
${alignr}$font ${downspeed wlan0} Down --|
${alignr}$font ${downspeedgraph wlan0 11,160 white fe8608} |
${alignr}$font ${upspeed wlan0} Up --|
${alignr}$font ${upspeedgraph wlan0 11,160 white fe8608} |
${alignr}$font ${tcp_portmon 1 65535 count} Total Connections --|
${alignr}$font ${tcp_portmon 1 32767 count} Incoming --|
${alignr}$font ${tcp_portmon 1 32767 rhost 0} ${tcp_portmon 1 32767 lservice 0} --| |
${alignr}$font ${tcp_portmon 1 32767 rhost 1} ${tcp_portmon 1 32767 lservice 1} --| |
${alignr}$font ${tcp_portmon 1 32767 rhost 2} ${tcp_portmon 1 32767 lservice 2} --' |
${alignr}$font ${tcp_portmon 32768 61000 count} Outgoing --|
${alignr}$font ${tcp_portmon 32768 61000 rhost 0} ${alignr} ${tcp_portmon 32768 61000 rservice 0} --| |
${alignr}$font ${tcp_portmon 32768 61000 rhost 1} ${alignr} ${tcp_portmon 32768 61000 rservice 1} --| |
${alignr}$font ${tcp_portmon 32768 61000 rhost 2} ${alignr} ${tcp_portmon 32768 61000 rservice 2} --' |
Offline
@valinote
I test your conky, and on my laptop it's work fine, datas are updated without overwrite.
Last edited by chepioq (2014-09-23 05:07:38)
Offline
Hey all. So, I'm new to linux, new to conky, new to it all. Been using windows forever, super comfortable with doing anything on windows.... And then my HDD in my laptop crashed, and I'm not in a place where I can buy a new one just yet. So I grabbed the 4gb spare flashdrive that I have sitting around, got on a friends PC and looked into which versions of Linux I could throw on it that were full functioning. For some insane reason I chose Crunchbang over the more GUI filled, user-friendly types like Linux Lite or some of the other, highly popular ones.
And I have fallen in love. There's a decent learning curve to someone that hasn't ever used an OS that's pretty terminal based, short of loading up games in the MS-Dos command line. But I must say, this is one OS that I have come to enjoy. I'm now using my mom's old dell desktop, that for some reason has a 750gb HDD inside it (apparently she upgraded a few years ago... not knowing that 750 was WAY more then she needed. Win! ) So now I'm sitting here playing around with Crunchbang with tons of space to play with, learning the ins and outs of this great OS.
To the point of this post. Over the past 3 days I've studied the coding that Tint2 and Conky use, respectively, and I've built what I can say is a rather appealing, yet simple, Conky. Here's my config and a screen
# conky configuration
#
# The list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.
#
# For ideas about how to modify conky, please see:
# http://crunchbanglinux.org/forums/topic/59/my-conky-config/
#
# For help with conky, please see:
# http://crunchbanglinux.org/forums/topic/2047/conky-help/
#
# Enjoy! :)
##############################################
# Settings
##############################################
text_buffer_size 512
background yes
use_xft yes
xftfont Liberation Sans:size=8
use_spacer left
pad_percents 2
xftalpha 1
update_interval .5
total_run_times 0
own_window yes
own_window_color green
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 500 500
maximum_width 225
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_color 68B5FF
default_shade_color 000000
default_outline_color 828282
alignment top_right
gap_x 6
gap_y 46
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no
short_units yes
##############################################
# Output
##############################################
TEXT
${font comic sans ms:bold:size:14}$alignc${color green}Steven's Pride$color
${color dark green} ${font conkysymbols:size=40}S$font$color
$alignc$uptime
${color 003F7C}${hr 4}$color
${color 008200}${font party time:size=17}${alignc}Computer Info$font$color
$alignc${cpugraph cpu1 49,220 B2FED7 009D0B -t -l}
${voffset -7}$alignc ${color orange} CPU Graph$color
${voffset 8}${alignc} ${color green}${freq_g 0}Ghz$color ${color light blue}$color@${color light blue}${cpu cpu0}% $color
${voffset -20}${font conkysymbols:size=20}f$font: ${cpubar cpu0}
${voffset 8}${alignc} ${color green}${freq_g 1}Ghz$color ${color light blue}$color@${color light blue}${cpu cpu1}% $color
${voffset -20}${font conkysymbols:size=20}F$font: ${cpubar cpu1}
${voffset 4}${alignc} ${color green}${mem}$color / ${color green}${memmax}$color
${voffset -16}${font conkysymbols:size=20}j$font: ${membar 7}
${voffset 5}${alignc} ${color green}${fs_used}$color / ${color green}${fs_size}$color
${voffset -18}${font conkysymbols:size=20}k$font: ${fs_bar}
${color 003F7C}${hr 4}$color
${color 008200}${font party time:size=18}$alignc Network Info$font$color
${font conkysymbols:size=20}g$font ${color orange}${wireless_essid wlan0}$color ${color green}${alignc}${wireless_bitrate wlan0} ${alignr}${wireless_link_qual_perc wlan0}%$color
${hr 1}
${voffset 5}${color green}${downspeedf wlan0} kb/s$color ${alignr}${color orange}TOTAL:$color${color light blue}${totaldown wlan0}$color
${voffset 5}${font conkysymbols:size=20}e$font${voffset -25}${alignc}${downspeedgraph wlan0 40,196 B2FED7 009D0B -t -l}
${voffset 5}${color green}${upspeedf wlan0} kb/s$color ${alignr}${color orange}TOTAL:$color${color light blue}${totalup wlan0}$color
${voffset 5}${font conkysymbols:size=20}d$font${voffset -25}${alignc}${upspeedgraph wlan0 40,196 B2FED7 009D0B -t -l}
${color 003F7C}${hr 4}$color
${color 008200}${font party time:size=18}${alignc}Processes$font$color
${voffset 5}${color orange}Process Name ${alignc} CPU Mem$color
${voffset -5}${hr 1}
${color light blue}${top name 1}$color${alignr}${color green}${top cpu 1}%${top mem 1}%$color
${color light blue}${top name 2}$color${alignr}${color green}${top cpu 2}%${top mem 2}%$color
${color light blue}${top name 3}$color${alignr}${color green}${top cpu 3}%${top mem 3}%$color
${color light blue}${top name 4}$color${alignr}${color green}${top cpu 4}%${top mem 4}%$color
${color light blue}${top name 5}$color${alignr}${color green}${top cpu 5}%${top mem 5}%$color
${color light blue}${top name 6}$color${alignr}${color green}${top cpu 6}%${top mem 6}%$color
${color light blue}${top name 7}$color${alignr}${color green}${top cpu 7}%${top mem 7}%$color
${color light blue}${top name 8}$color${alignr}${color green}${top cpu 8}%${top mem 8}%$color
Offline
@valinote: how are you starting conky?
Offline
Hi chepioq and head_on_a_stick. This is exactly what happens when people (me for instance) cut & paste things without really knowing what they are doing! I sat down and went through the conky parameters/values one by one and made sure that they were set correctly for what I was trying to accomplish. And also I found some redundancy and commands that were no longer supported. I should have done this before I posted in the forum. The end result is that now my system monitor is working correctly without the overwriting phenomenon. I appreciate your help and thank you for the quick replies. Kindest regards...8-]
-Steve D
Last edited by valinote (2014-09-23 18:27:42)
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat