SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#4976 2013-03-22 19:37:42

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Conky v1.9 Thread

chepioq wrote:

I have an other soluce, but I don't know if that work with conky.

Instead of

${fs_used /media/nili/Lacie Disk}

, try with

${fs_used /media/nili/"Lacie Disk"}

Hi again chepioq
unfortunately did not work with "" ${fs_used /media/nili/"Lacie Disk"}
thnx for your effort.

xaos52 wrote:

Or perhaps putting a \ before the space works? It does in bash/zsh scripting. Dunno about conky/lua - I don't use it.
Blimey, should not have said that in a thread dedicated to conky and reaching 200 pages...  smile

Thank you for your suggestion,
In fact, I've tried even before this opportunity but still not work with \
I've used in terminal this option "\" to delete things with space and works very well, I do not know why not work into Conky?
anyway thank you for your efforts guys, of course if you have any other suggestion Please tell me.


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

Be excellent to each other!

#4977 2013-03-23 06:27:36

chepioq
#! Member
Registered: 2013-01-09
Posts: 79

Re: Conky v1.9 Thread

May be that work with the uuid.

Fist you recover the uuid of your disk with the blkid command

[root@chepioq ~]# blkid
/dev/sda1: UUID="e8d3768e-98ac-4841-b5cc-da2b6cd0b27a" TYPE="ext4" 
/dev/sda2: UUID="b8ea9cad-a12b-4bda-915a-5ab6c3a62df1" TYPE="ext4" PTTYPE="dos" 
/dev/sda3: UUID="330fe383-bd40-4030-98cc-c3e9d196e854" TYPE="swap" 
/dev/sda5: UUID="2f2ca3de-01a3-4480-bf54-066622828a0e" TYPE="ext4" 
/dev/sda6: UUID="a029ad6d-70d0-4568-8615-e542dd1262aa" TYPE="ext4" 
/dev/sda7: UUID="1c497455-a973-475a-b397-f4de590a9c6c" TYPE="ext4" 
/dev/sda8: UUID="ca63b49f-8414-4f56-b468-a9f1004b80d7" TYPE="ext4" 
/dev/sdb1: UUID="7DCD-4F2C" TYPE="vfat" 
[root@chepioq ~]#

My DD ext is sdb1, UUID="7DCD-4F2C"

After try this code :
${fs_used /dev/disk/by-uuid/7DCD-4F2C}

with the uuid for your Lacie Disk

Offline

#4978 2013-03-23 06:46:08

chepioq
#! Member
Registered: 2013-01-09
Posts: 79

Re: Conky v1.9 Thread

Another solution is with the df command :
For me :

[dominique@chepioq ~]$ df -h
Sys. fich.     Taille Util. Dispo Uti% Monté sur
devtmpfs         2,9G     0  2,9G   0% /dev
tmpfs            3,0G   84K  3,0G   1% /dev/shm
tmpfs            3,0G  4,1M  3,0G   1% /run
tmpfs            3,0G     0  3,0G   0% /sys/fs/cgroup
/dev/sda5         15G   11G  2,7G  81% /
tmpfs            3,0G   36K  3,0G   1% /tmp
/dev/sda7         44G   11G   31G  27% /home
/dev/sda1        969M   95M  825M  11% /boot
/dev/sdb1        187G   43G  144G  24% /run/media/dominique/7DCD-4F2C

After, you just do a script with grep and awk, and use this script instead of fs_used conky command.

Offline

#4979 2013-03-23 08:43:34

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Conky v1.9 Thread

Sorry again does not work: (

so far have tried in these ways:

${if_mounted /run/media/nili/227CB65D7CB62B83}
${if_mounted /media/nili/227CB65D7CB62B83}
${if_mounted /dev/disk/by-uuid/227CB65D7CB62B83}

while when I do the command df-h

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       145G  132G  5.5G  97% /
udev            996M  8.0K  996M   1% /dev
tmpfs           402M  948K  401M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none           1004M  3.4M 1000M   1% /run/shm
none            100M   40K  100M   1% /run/user
/dev/sdd1       1.4T  1.4T   19G  99% /media/nili/Toshiba
/dev/sdb1       147G  129G   12G  92% /media/nili/iDisk
/dev/sde1       1.9T  1.8T   97G  95% /media/nili/Lacie Disk

Lacie Disk not showing as you with "/run/media..." but only "/media/nili..."
tell me if I've done anything wrong.

Thanks again for the effort chepioq


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

#4980 2013-03-23 09:33:07

chepioq
#! Member
Registered: 2013-01-09
Posts: 79

Re: Conky v1.9 Thread

Ok, you can do a script like this (name Lacie.sh) :

#!/bin/bash
df-h | grep Lacie

will return :

/dev/sde1       1.9T  1.8T   97G  95% /media/nili/Lacie Disk

Or another

#!/bin/bash
df-h | grep Lacie | awk '{print $2,$3,$4,$5}'

will return

1.9T 1.8T 97G 95%

But I think the better is do that :

#!/bin/bash
df-h | grep Lacie | awk '{print $2,$3,$4,$5}' > Lacie.txt

And after, in your conky :
${color 33001A}${font StyleBats:size=35}G${font} Lacie${color FFFFFF}
${if_mounted /media/nili/Lacie Disk}
${exec Lacie.sh}
${color 1C1C1C}Size: ${alignr}${cat Lacie.txt | awk '{print $1}'}

${color 1C1C1C}Free: ${alignc}${cat Lacie.txt | awk '{print $3}'}
${color 1C1C1C}Used: ${alignc}${cat Lacie.txt | awk '{print $2}'} ${alignr}${color 33001A}(${cat Lacie.txt | awk '{print $4}}')${color}
${else}${color 1C1C1C}Disk: Not mounted${color}
${endif}

I hope I don't take mistake...

==EDIT==

You must adapt the path of Lacie.sh and Lacie.txt

Last edited by chepioq (2013-03-23 09:43:16)

Offline

#4981 2013-03-23 11:01:50

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

do u have an idea why this wont work when i use the function display_system

out({x=conky_window.width,y=350+60,f="mono",c=dunkel,face="italic",shaded="yes",txt=display_system({variable="time %s:%M"}),hj="r"})

the function:

function display_system(cd)
-----------------------------
local conky_order=nil
local variable=nil
local device=nil
local del=nil
local cs = nil
local ms = nil
-----------------------------
variable=cd.variable
device=(cd.device or '')
del=(cd.del or '.')
-----------------------------
conky_order=conky_parse("${"..variable..' '..device.."}")
adv=chgDel(conky_order,del)
local value = conky_order:gsub(" ","") -- remove spaces

	---- short_units no ------------------------
	if ((string.find(value, "iB") == nil) and (string.find(value, "B") ~= nil)) then
		ms=(value:gsub("B",""))..' byte'	
	elseif string.find(value, 'KiB') ~= nil then
		ms=adv..' kb'
	elseif string.find(value, 'MiB') ~= nil then
		ms=adv..' mb'
	elseif string.find(value, 'GiB') ~= nil then
		ms=adv..' gb'
	elseif string.find(value, "TiB") ~= nil then
		ms=adv.." tb"	
	elseif ((string.find(variable, "perc") ~= nil) or (string.find(variable, "percent") ~= nil)) then
		ms=adv.." %"
	elseif ((string.find(variable,"freq") ~= nil) and (string.find(variable,"_g") == nil)) then
		ms=adv.." Mhz"
	elseif ((string.find(variable,"freq") ~= nil) and (string.find(variable,"_g") ~= nil)) then
		ms=conky_order.." Ghz"
	elseif ((string.find(variable,"downspeedf") ~= nil) or (string.find(variable,"upspeedf") ~= nil)) then
		ms=adv.." kb/s"
	elseif string.find(variable,"time") ~= nil then
		ms=value
	elseif string.find(variable,"cpu") ~= nil or string.find(variable,"wireless_link_qual") ~= nil then
		ms=adv.." %"
	---- short_units yes -----------------------
	elseif ((string.find(value, "iB") == nil) and (string.find(value, "B") ~= nil)) then
		ms=adv..' byte'
	elseif string.find(value, "K") ~= nil then
		ms=adv..' kb'
	elseif string.find(value, "M") ~= nil then
		ms=adv..' mb'
	elseif string.find(value, "G") ~= nil then
		ms=adv..' gb'
	elseif string.find(value, "T") ~= nil then
		ms=(value:gsub("T",""))..' tb'
	------------------------------------------------------

	------------------------------------------------------
	else ms=value:gsub(" ","") end
	------------------------------------------------------
	cs=string.gsub(tostring(ms),"%.",del) -- replace delimiter
	return cs
end -- of function

Offline

#4982 2013-03-23 12:22:03

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Conky v1.9 Thread

Still not work chepioq,
Again appear as Disk: Not mounted

I think that is not worth it to continue.
Better, to rename Lacie Disk to Only Lace to function OK but i'll do this in later time, becuase some application have this letter in use.

Thank you very very much for your contribution and the code you did made for me.
Thanks a lot!


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

#4983 2013-03-23 21:18:31

Dobbie03
Resident Metaller
From: New Zealand
Registered: 2009-08-15
Posts: 1,591

Re: Conky v1.9 Thread

I am trying to get conky to show how much space my Root and Home folders are using but for some reason the y are showing the exact same.  Is this correct?

Here is what I have in my config:

${font Open Sans Light:pixelsize=10}${color #ffffff}ROOT: ${fs_free_perc /}${color #FBAA35}%
${font Open Sans Light:pixelsize=10}${color #ffffff}HOME: ${fs_free_perc /home}${color #FBAA35}%

I am using Ubuntu 12.10, I am wondering if the the home folders is meant to be "/home/user?

Offline

#4984 2013-03-23 22:33:21

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,572

Re: Conky v1.9 Thread

@Dobbie03

Your code looks correct, but /home has to be it's own partition for it to work as intended. Did you set it up that way when you installed Ubuntu?

Are the values being shown correct for the / partition?

Last edited by PackRat (2013-03-23 22:35:49)


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#4985 2013-03-24 10:54:56

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

could u please help me to grab the actual distance of the space probe 'voyager2' (distance from earth)?
http://voyager.jpl.nasa.gov/where/index.html

i need this in lua.

btw: check this out when you need a cool weatherscript: click here

Last edited by lionhead (2013-03-24 11:07:54)

Offline

#4986 2013-03-24 15:28:48

chepioq
#! Member
Registered: 2013-01-09
Posts: 79

Re: Conky v1.9 Thread

lionhead wrote:

could u please help me to grab the actual distance of the space probe 'voyager2' (distance from earth)?
http://voyager.jpl.nasa.gov/where/index.html

i need this in lua.

btw: check this out when you need a cool weatherscript: click here

You can try this :
1°)

wget http://voyager.jpl.nasa.gov/where/index.html -O ~/voyager.html

2°)

cat voyager.html | grep "dist_0_v2 =" | awk '{print $4}'

Return valor : 15178364616.6584;

If you want just the decimal part :

cat voyager.html | grep "dist_0_v2 =" | awk '{print $4}' | awk 'sub("......$", "")'

Return valor : 15178364616

Offline

#4987 2013-03-24 20:32:18

Dobbie03
Resident Metaller
From: New Zealand
Registered: 2009-08-15
Posts: 1,591

Re: Conky v1.9 Thread

PackRat wrote:

@Dobbie03

Your code looks correct, but /home has to be it's own partition for it to work as intended. Did you set it up that way when you installed Ubuntu?

Are the values being shown correct for the / partition?

Ah! That's it, I never set the home folder up like that.  Cheers for the info.

Offline

#4988 2013-03-26 01:02:39

kroey
New Member
Registered: 2013-03-26
Posts: 1

Re: Conky v1.9 Thread

Here's my conky, it's quite basic, but more colorful:

# conky configuration
#
# The list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check [url]http://conky.sf.net[/url] for an up-to-date-list.
#
# For ideas about how to modify conky, please see:
# [url]http://crunchbanglinux.org/forums/topic/59/my-conky-config/[/url]
#
# For help with conky, please see:
# [url]http://crunchbanglinux.org/forums/topic/2047/conky-help/[/url]
#
# Enjoy! :)
##############################################
# Settings
##############################################
background no
use_xft yes
#xftfont Liberation Sans:size=9
xftfont no
${font sans-serif:size=8}
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent no
own_window_type desktop
own_window_argb_visual yes
## The following line gives a very light grey background. Increase the number to make it darker, Max Value 255
own_window_argb_value 25
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
## The following line gives you a window 280px wide and 900px long
minimum_size 280 900
maximum_width 280
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders no
default_color C0C0C0
default_shade_color 000000
default_outline_color 828282
default_graph_height 25
alignment top_right
gap_x 12
gap_y 40
no_buffers yes
uppercase no
cpu_avg_samples 2
top_cpu_separate no
override_utf8_locale no
##############################################
#  Output
##############################################
TEXT
${font sans-serif:bold:size=8:}${color orange}C R U N C H B A N G $alignr${time}${color gray}
Uptime:$alignr$uptime
${color orange}Network${hr 2}${font sans-serif:size=8}${color gray}
${alignc}Who am I?  - "${nodename}" @ ${addr eth0}
Inbound ${downspeed eth0} kb/s $alignr Total: ${totaldown eth0}
${color 009900}${downspeedgraph eth0}${color gray}
Outbound ${upspeed eth0} kb/s $alignr Total: ${totalup eth0}
${color 980000}${upspeedgraph eth0}${color gray}
${font sans-serif:bold:size=8}${color orange}Disks ${hr 2}${font sans-serif:size=8}${color gray}
Disk 0: ${fs_used_perc /}% $alignr${fs_bar 6,200 /}
## Add disks at their mountpoint in the followin 2 lines, copy for extra, uncomment them to have them appear in conky
##Disk 1: ${fs_used_perc /media/Videos}% $alignr${fs_bar 6,200 /media/Videos}
##Disk 2: ${fs_used_perc /media/77a1d542-f967-4379-8a53-098892a440fd}% $alignr${fs_bar 6,200 /media/77a1d542-f967-4379-8a53-098892a440fd}
SWAP: $alignc $swap / $swapmax $alignr $swapperc% ${swapbar 6,105}
${font sans-serif:bold:size=8}${color orange}Processors Core i5 @ 2.6Ghz ${hr 2}${font sans-serif:size=8}${color gray}
## CPU set for dual core. Copy for extra cores (CPU3, CPU4), use CPU0 for all in one, etc
CPU1: ${cpu cpu1}% $alignr${cpubar 6,200 cpu1}
${color 980000}${cpugraph cpu1}${color gray}
CPU2: ${cpu cpu2}% $alignr${cpubar 6,200 cpu2}
${color 980000}${cpugraph cpu2}${color gray}
CPU Temp:$alignr${hwmon 1 temp 2}
${font sans-serif:bold:size=8}${color orange}RAM: $mem / $memmax ${hr 2}${font sans-serif:size=8}${color gray}
$memperc% $alignr${membar 6,200}
Process $alignr PID    CPU
${top name 1} $alignr ${top pid 1} ${top cpu 1}
${top name 2} $alignr ${top pid 2} ${top cpu 2}
${top name 3} $alignr ${top pid 3} ${top cpu 3}
${top name 4} $alignr ${top pid 4} ${top cpu 4}
${top name 5} $alignr ${top pid 5} ${top cpu 5}
${top name 6} $alignr ${top pid 6} ${top cpu 6}
${top name 7} $alignr ${top pid 7} ${top cpu 7}
${top name 8} $alignr ${top pid 8} ${top cpu 8}
${font sans-serif:bold:size=8}${color orange}S H O R T C U T S ${hr 2}${font sans-serif:size=8}${color gray}
Alt+F2$alignr Run Dialog
Alt+F3$alignr Alt Menu
Super+Space$alignr Main Menu
Super+Tab$alignr Client Menu
Super+t$alignr Terminal
Super+f$alignr File Manager
Super+e$alignr Editor
Super+m$alignr Media Player
Super+w$alignr Web Browser
Super+h$alignr Task Manager
Super+l$alignr Lock Screen
Super+v$alignr Volume Control
Super+x$alignr Logout
PrtSc$alignr Screenshot
halevt$alignr Automount
qbittorent$alignr Torrent
google-earth$alignr Google Earth
${hr}
Conky Version: $alignr${conky_version}
## If you use google calendar you'll need to install 'gcalcli' from the package manager, then create a text file and edit it in your home directory called:
## 'gcalclirc' with the following 3 lines
## [gcalcli]
## user: (your username only - no '@gmail.com')
## pw: (your Account password in plain text)
## ${font sans-serif:bold:size=8}${color orange}Google Calendar ${hr 2}${color gray}
## ${font sans-serif:size=8}${execi 300 gcalcli --nc --cals owner agenda}

Conky Image

Offline

#4989 2013-03-26 16:28:14

Satoru
New Member
From: Toyama
Registered: 2013-03-23
Posts: 5
Website

Re: Conky v1.9 Thread

Anyone know of a script for conky that i can add onto my bar to show what cmus is playing in the top left of my conky?

Image of my current bar on top: http://i.imgur.com/04TmrA7.jpg

Here is my current conky:

#avoid flicker
double_buffer yes

#own window to run simultanious 2 or more conkys
own_window  yes
own_window_transparent no
own_window_type override
own_window_hints undecorate,sticky,skip_taskbar,skip_pager 

#borders
draw_borders yes
draw_graph_borders yes
border_width 1
border_margin 3

#shades
draw_shades no

#position
gap_x 0
gap_y 4
alignment top_left

#behaviour
update_interval 1

#colour
default_color 000000
#default_shade_color 000000
own_window_colour 000000
#font
use_xft yes
xftfont lime:size=7

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

#to prevent window from moving
use_spacer none
minimum_size 1280 0


TEXT
${alignr} ${color #9BBAF1}Kernel >> ${color ffffff}$kernel  ${color #9BBAF1}Up >> ${color #9BBAF1}${color #ffffff}${uptime_short} ${color #9BBAF1}| Cpu >> ${color #ffffff}${cpu}% ${color #ffffff} ${color #9BBAF1}Ram >> ${color #ffffff}${memperc}%  ${color #9BBAF1}Swap >> ${color ffffff}${swapperc}%  ${color #9BBAF1}Disk >> ${color ffffff}${fs_used_perc /}% ${color #9BBAF1}| ${color #9BBAF1}${time %d/%m/%y}${color #9BBAF1} ${time %I:%M}

Last edited by Satoru (2013-03-26 16:28:36)

Offline

#4990 2013-03-26 16:30:20

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

hello

i've tried this:

#! /bin/bash
wget http://voyager.jpl.nasa.gov/where/index.html -O ~/voyager.html  && 
dist=`cat voyager.html | grep "dist_0_v2 =" | awk '{print $4}' | awk 'sub("......$", "")'` 
echo $dist

and in lua:

conky_parse("${execi 12 ~/v9000/v2.sh}")

is it possible to display the distance (like on the webpage)?

Offline

#4991 2013-03-26 21:30:30

Naik
#! Die Hard
From: Leipzig
Registered: 2012-11-16
Posts: 595

Re: Conky v1.9 Thread

lionhead wrote:

hello

i've tried this:

#! /bin/bash
wget http://voyager.jpl.nasa.gov/where/index.html -O ~/voyager.html  && 
dist=`cat voyager.html | grep "dist_0_v2 =" | awk '{print $4}' | awk 'sub("......$", "")'` 
echo $dist

and in lua:

conky_parse("${execi 12 ~/v9000/v2.sh}")

is it possible to display the distance (like on the webpage)?

without lua it works great...

${scroll 35 'Voyager1 is now ${execi 60 ~/scripts/voyager.sh }km away from Earth!'}

and the script is basicaly the same as yours:

#! /bin/bash

wget http://voyager.jpl.nasa.gov/where/index.html -O ~/voyager.html >/dev/null 2>&1 &&  
dist=`awk  '/dist_0_v1 =/{gsub(/;$/,"",$4) ;print $4}' ~/voyager.html`
echo $dist

my only problem is: I always get the SAME Value! has the Voyager1 stopped?
UPDATE:
the Value represented is only a variable used by the distance.js to to calculate the distance!

distance.js

// JavaScript Document

/*
	Handles updating of Voyager Distances from Earth and the Sun
*/

/*var epoch_0 = 1301500800; //1281510000;
var epoch_1 = 1301587200; //1281596400;

var current_time = 1301523931;

var dist_0_v1 = 17396281625.1305;
var dist_1_v1 = 17395807835.8111;

var dist_0_v2 = 14227951893.7668;
var dist_1_v2 = 14227140609.8932;

var dist_0_v1s = 17445817009.5116;
var dist_1_v1s = 17447283910.3447;

var dist_0_v2s = 14204601577.2787;
var dist_1_v2s = 14205894342.6130;*/

var current_dist_km_v1 = 0;
var current_dist_au_v1 = 0;

var current_dist_km_v2 = 0;
var current_dist_au_v2 = 0;

var current_dist_km_v1s = 0;
var current_dist_au_v1s = 0;

var current_dist_km_v2s = 0;
var current_dist_au_v2s = 0;

var au_const = 149597870.691;

function dist_controller()
{
	
	current_dist_km_v1 = ( ( ( current_time - epoch_0 ) / ( epoch_1 - epoch_0 ) ) * ( dist_1_v1 - dist_0_v1 ) ) + dist_0_v1;
	current_dist_au_v1 = (current_dist_km_v1/au_const) + '';
	current_dist_au_v1 = current_dist_au_v1.split('.');
	current_dist_au_v1 = current_dist_au_v1[0] + '.' + current_dist_au_v1[1].substring(0,8);
		  
	current_dist_km_v2 = ( ( ( current_time - epoch_0 ) / ( epoch_1 - epoch_0 ) ) * ( dist_1_v2 - dist_0_v2 ) ) + dist_0_v2;
	current_dist_au_v2 = (current_dist_km_v2/au_const) + '';
	current_dist_au_v2 = current_dist_au_v2.split('.');
	current_dist_au_v2 = current_dist_au_v2[0] + '.' + current_dist_au_v2[1].substring(0,8);
				  
	current_dist_km_v1s = ( ( ( current_time - epoch_0 ) / ( epoch_1 - epoch_0 ) ) * ( dist_1_v1s - dist_0_v1s ) ) + dist_0_v1s;
	current_dist_au_v1s = (current_dist_km_v1s/au_const) + '';
	current_dist_au_v1s = current_dist_au_v1s.split('.');
	current_dist_au_v1s = current_dist_au_v1s[0] + '.' + current_dist_au_v1s[1].substring(0,8);

	current_dist_km_v2s = ( ( ( current_time - epoch_0 ) / ( epoch_1 - epoch_0 ) ) * ( dist_1_v2s - dist_0_v2s ) ) + dist_0_v2s;
	current_dist_au_v2s = (current_dist_km_v2s/au_const) + '';
	current_dist_au_v2s = current_dist_au_v2s.split('.');
	current_dist_au_v2s = current_dist_au_v2s[0] + '.' + current_dist_au_v2s[1].substring(0,8);
	
	current_dist_lt_v1 = current_dist_km_v1 * 2 / 299792.458;
	current_dist_lt_v2 = current_dist_km_v2 * 2 / 299792.458;

	document.getElementById('voy1_km').innerHTML = addCommas( Math.round(current_dist_km_v1) + " KM" );
	document.getElementById('voy1_au').innerHTML = addCommas( current_dist_au_v1 ) + " AU";
		   
	document.getElementById('voy2_km').innerHTML = addCommas( Math.round(current_dist_km_v2) + " KM" );
	document.getElementById('voy2_au').innerHTML = addCommas( current_dist_au_v2 ) + " AU";
				   
	document.getElementById('voy1_kms').innerHTML = addCommas( Math.round(current_dist_km_v1s) + " KM" );
	document.getElementById('voy1_aus').innerHTML = addCommas( current_dist_au_v1s ) + " AU";

	document.getElementById('voy2_kms').innerHTML = addCommas( Math.round(current_dist_km_v2s) + " KM");
	document.getElementById('voy2_aus').innerHTML = addCommas( current_dist_au_v2s ) + " AU";
	
	document.getElementById('voy1_lt').innerHTML = formatSeconds(current_dist_lt_v1);
	document.getElementById('voy2_lt').innerHTML = formatSeconds(current_dist_lt_v2);
	
	//alert("dist_controller.addCommas( Math.round(current_dist_km_v1) ): " + addCommas( Math.round(current_dist_km_v1) ));

	current_time += 0.5;
}
 
function addCommas(nStr)
{
	nStr += '';
	x = nStr.split('.');
  
		x1 = x[0];
		x2 = x.length > 1 ? '.' + x[1] : '';
  
		var rgx = /(\d+)(\d{3})/;
	 
		while ( rgx.test(x1) )
		{
			x1 = x1.replace(rgx, '$1' + ',' + '$2');
		}
		return x1 + x2;
}

function formatSeconds(num)
{
	var hours = Math.floor(num / 3600);
	
	num -= (hours * 3600);
	
	var minutes = Math.floor(num / 60);
	
	num -= (minutes * 60);
	
	var seconds = Math.floor(num);
	
	if ( hours < 10 )
		hours = "0" + hours;
	if ( minutes < 10 )
		minutes = "0" + minutes;
	if ( seconds < 10 )
		seconds = "0" + seconds;	
	
	return hours + ":" + minutes + ":" + seconds;
	
	
}

any idea how to get conky to run this script by itself?

Last edited by Naik (2013-03-26 22:08:45)


*kaum macht man es richtig, funktioniert es sofort*

Offline

#4992 2013-03-26 22:10:38

dk75
#! Junkie
Registered: 2012-06-14
Posts: 250

Re: Conky v1.9 Thread

Not.
They use JS to calculate actual distance on user side in a browser.
They provide date stamp and a distance at this stamp, then based on this data, JS provided, will calculate actual distance on the go on user side in browser.
So, this distance is not available to download from a server because it is not on a server.


Debian Sid (Minted) x86_64/3.12-10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Intel X3100
Lenovo T61, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
Linux user No.: 483055 | Conky Pitstop

Offline

#4993 2013-03-26 22:19:50

Naik
#! Die Hard
From: Leipzig
Registered: 2012-11-16
Posts: 595

Re: Conky v1.9 Thread

dk75 wrote:

...
So, this distance is not available to download from a server because it is not on a server.

I just realised this and thats why i`m asking:
If i got the values given and the current time (which they use) isn`t it possible to run the script not only on browser side but so to say on conky side?

i simply imagined something like ${exec js ~/voyager.js} but a brife search brought up nothing about javascript and conky... is this posible?
or btw. it seems to be more or less simple mathematics. shouldnt it be posible to transcript it to any other language?

I'll dream about this... gn8!
UPDATE:
i tried to get this to eork as a bash-script:

#! /bin/bash

epoch_0=1301500800 
epoch_1=1301587200 
current_time=`date +%s`
dist_0_v1=17396281625,1305
dist_1_v1=17395807835,8111

current_dist_km_v1=`( ( ( current_time - epoch_0 ) / ( epoch_1 - epoch_0 ) ) * ( dist_1_v1 - dist_0_v1 ) ) + dist_0_v1`

echo $current_dist_km_v1

(only for the voyager1 and only distancefrom earth)
but i get

terminator wrote:

v1.sh: 1: v1.sh: Syntax error: word unexpected (expecting ")")

that sucks! I just hoped to see some strange numbers appear, becaus my arithmetics were wrong, but this...


greetz! naik

Last edited by Naik (2013-03-27 09:18:57)


*kaum macht man es richtig, funktioniert es sofort*

Offline

#4994 2013-03-27 08:04:09

Naik
#! Die Hard
From: Leipzig
Registered: 2012-11-16
Posts: 595

Re: Conky v1.9 Thread

Satoru wrote:

Anyone know of a script for conky that i can add onto my bar to show what cmus is playing in the top left of my conky?

Image of my current bar on top: http://i.imgur.com/04TmrA7.jpg

i found a little script here:

#! /bin/bash

if [ ! -x /usr/bin/cmus-remote ];
then
echo "cmus is not installed."
exit
fi

ARTIST=$( cmus-remote -Q 2>/dev/null | grep artist | cut -d " " -f 3- )
TITLE=$( cmus-remote -Q 2>/dev/null | grep title | cut -d " " -f 3- )

if [ -z "$ARTIST" ];
then
echo "Nothing"
else
echo "$ARTIST - $TITLE"
fi

just call it with:

${execi 2 /path/to/script}

I am not able to test it since i don`t run cmus but i think you can remove the first function because i considre you have cmus installed and personaly i would replace "if [ -z "$ARTIST" ]; then echo "Nothing" else" (and the "fi") with with an appropriate ${if_running cmus}... in conky so there isn`t allways shown "Nothing" but simply nothing wink

UPDATE:
i tested it and it works for me!
interesting player though, i think i`ll stick to it for a while to see what it can do..
thanks!

I hope this helped.

greetz -naik

Last edited by Naik (2013-03-27 08:41:30)


*kaum macht man es richtig, funktioniert es sofort*

Offline

#4995 2013-03-28 19:17:33

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 886
Website

Re: Conky v1.9 Thread

My new (revised) one....

screenshot-03282013-115611am.png

The config can be found here

Offline

#4996 2013-03-28 20:48:44

ansem_of_nexus
#! CrunchBanger
Registered: 2012-09-19
Posts: 234

Re: Conky v1.9 Thread

Taking a break from my interface project so I thought I would post some updated pictures of it, now that I have added some interactive features. (interactive code from launcher.lua and my tweaked version of clicky.lua)

collapsed
Screenshot_03282013.png
infterface only
2013_03_28_1364504079_2720x1024_scrot.png
interface, launcher, and cpu popped out
2013_03_28_1364504154_2720x1024_scrot.png


You can find my work here

Make everything ok button

Offline

#4997 2013-03-29 01:58:15

ichase
#! CrunchBanger
Registered: 2011-03-16
Posts: 146

Re: Conky v1.9 Thread

Been a couple of weeks since I have had time to make it in here.  I see the AMAZING creations continue.  ansem_of_nexus, that is absolulte awesome!!!!

Wanted to ask a question that I apologize because I am sure it has been answered already, but has any other font package taken over the symbols that were found in openfonts.ttl?  At least in Arch Linux, since the Fontconfig package was updated September of last year, openfonts no longer works.  I used to use this for my Arch Linux symbol but now looking next to my kernel section, everything used from the openfonts comes out as a box.  I'm almost not feeling worthy of posting this with the amazing conky's I see on this page alone.  smile

b2835d245844849.jpg

Offline

#4998 2013-03-29 02:24:57

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Hi ichase - nothing wrong with your conky.  KISS is good, I'm back there myself.

Above TEXT do you have these set:

use_xft yes
xftfont some_font_name:size=10

# Force UTF8? requires XFT ###
override_utf8_locale yes

TEXT

Sometimes that's the fix to that problem.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#4999 2013-03-29 10:14:26

ichase
#! CrunchBanger
Registered: 2011-03-16
Posts: 146

Re: Conky v1.9 Thread

Sector 11, thanks for the reply,
Had all of those settings except for adding xftfont in front of the font name.  It is documented that the upgrade last September to the Fontconfig package rendered OpenLogos useless in Arch.  Not sure if it is effected in other OS's.  smile

Also, adding xftfont in front of the font name changed the symbol from a box to the actual letter corresponding with that symbol.  In this case a captital letter A.

Last edited by ichase (2013-03-29 10:19:15)

Offline

Help fund CrunchBang, donate to the project!

#5000 2013-03-29 11:07:14

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

i do not know what's wrong. but i have always the same value:

#! /bin/bash
wget http://voyager.jpl.nasa.gov/where/index.html -O ~/voyager.html  && 
dist=`cat voyager.html | grep "dist_0_v1 =" | awk '{print $4}' | awk 'sub("......$", "")'` 
echo $dist

do u have an idea why?

Offline

Board footer

Powered by FluxBB

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

Debian Logo