You are not logged in.
the best way to combat memory leaks is to localize as many of your variables as possible
just remember that local variables cant be "seen" outside of the function that they are in OR outside of the loop or if statement they are in
Ok I wondered about that.
In your example you call an if statement a loop, is that just the way they lump them together in lua?
if string1==100 then
print (string1) --> string 1 is visible anywhere inside the function so "100" is printed
....
print (string3) --> string 3 is only visible in the loop so "300" is printed
end
I would not call an if statement a loop since it does not repeat the command multiple times.
Just to be sure, you only have to use "local" when you create the variable not when you assign a new value to it correct?
So in this example the first "print" would print "1" the second would print "2" and the third would cause a nil value error.
function test()
local a = 1
print(a)
a = 2
print(a)
end
print(a)
Offline
mrpeachy wrote:the best way to combat memory leaks is to localize as many of your variables as possible
just remember that local variables cant be "seen" outside of the function that they are in OR outside of the loop or if statement they are inI would not call an if statement a loop since it does not repeat the command multiple times.
Just to be sure, you only have to use "local" when you create the variable not when you assign a new value to it correct?
So in this example the first "print" would print "1" the second would print "2" and the third would cause a nil value error.
function test() local a = 1 print(a) a = 2 print(a) end print(a)
i would differentiate ifs and loops also
in the code example above you would need to localize both instances as the second instance of "a" will overwrite the first, but will be a global variable
edit - to answer your question more specifically... the print command outside of the function would print "2" , the value of the string "a" as set in the second instance
Last edited by mrpeachy (2012-06-30 01:36:23)
Offline
@ ackernan
That is the .conkyrc for the system info conky
#==============================================================================
# conkyrc
#
# author : se7en
# orginal : CAYMUS
# license : Distributed under the terms of GNU GPL version 2 or later
#==============================================================================
background yes
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
temperature_unit celsius
double_buffer yes
no_buffers yes
text_buffer_size 2048
gap_x 10
gap_y 30
minimum_size 285 600
#maximum_width 190
own_window yes
own_window_type conky
own_window_transparent yes
#own_window_argb_visual
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
border_inner_margin 0
border_outer_margin 0
alignment tr
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
override_utf8_locale yes
use_xft yes
xftfont 6x10:size=8
xftalpha 0.5
uppercase no
default_color 666666
color1 888888
color2 AAAAAA
color3 DDDDDD
color4 CC3333
TEXT
${voffset 0}
${goto 0}${color1}${font 6x10:size=10,weight:bold}$nodename - $sysname $kernel
$HR
${voffset 5}
${goto 0}${color1}${font 6x10:size=8,weight:bold}Computer Info
${goto 5}${color}${font 6x10:size=8,weight:normal}${execi 1000 cat /sys/class/dmi/id/sys_vendor} ${execi 1000 cat /sys/class/dmi/id/product_name}
${voffset 5}
${goto 0}${color1}${font 6x10:size=8,weight:bold}Bios Info
${goto 5}${color}${font 6x10:size=8,weight:normal}${execi 1000 cat /sys/class/dmi/id/bios_vendor} ${execi 1000 cat /sys/class/dmi/id/bios_version} ${execi 1000 cat /sys/class/dmi/id/bios_date}
${voffset 5}
${goto 0}${color1}${font 6x10:size=8,weight:bold}Motherboard Info
${goto 5}${color}${font 6x10:size=8,weight:normal}${execi 1000 cat /sys/class/dmi/id/board_vendor} ${execi 1000 cat /sys/class/dmi/id/board_name}
${voffset 5}
${goto 0}${color1}${font 6x10:size=8,weight:bold}CPU Info
${goto 5}${color}${font 6x10:size=8,weight:normal}${execi 1000 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //' | sort -u | cut -c1-60}
${voffset 5}
${goto 0}${color1}${font 6x10:size=8,weight:bold}Memory Info
${goto 5}${color}${font 6x10:size=8,weight:normal}Total:${execi 1000 free -tm | grep -i mem |gawk '{ print $2}'}MB - Used: $mem - Free: $memfree
${voffset 5}
${goto 0}${color1}${font 6x10:size=8,weight:bold}Graphic Card
${goto 5}${color}${font 6x10:size=8,weight:normal}${execi 1000 lspci |grep -i vga |gawk -F: '{ print $3 }'}
${voffset 5}
${goto 0}${color1}${font 6x10:size=8,weight:bold}Audio Card
${goto 5}${color}${font 6x10:size=8,weight:normal}${execi 1000 lspci |grep -i audio |gawk -F: '{ print $3 }'}
${voffset 5}
${goto 0}${color1}${font 6x10:size=8,weight:bold}Ethernet Card
${goto 5}${color}${font 6x10:size=8,weight:normal}${execi 1000 lspci |grep -i ethernet |gawk -F: '{ print $3 }'}
${voffset 5}
${goto 0}${color1}${font 6x10:size=8,weight:bold}Wifi Card
${goto 5}${color}${font 6x10:size=8,weight:normal}${execi 1000 lspci |grep -i wifi |gawk -F: '{ print $3 }'}
${voffset 5}
${goto 0}${color1}${font 6x10:size=8,weight:bold}Drive Info
${goto 0}${color}${font 6x10:size=8,weight:normal}${execi 1000 df -h | sort -nk 6 | grep -i /dev/ | gawk '{ print "Size "$2"\t* Free "$4"\t* Feached "$5"\t* Mounted on "$6"" }'}
${goto 5}${font 6x10:size=8,weight:normal}${color}/rootfs used${goto 100}${fs_used /home}
${goto 5}${font 6x10:size=8,weight:normal}${color}/rootfs free${goto 100}${fs_free /}
${goto 5}${diskiograph 10,80 AAAAAA AAAAAA}
${voffset 5}
${goto 0}${color1}${font 6x10:size=10,weight:bold}${if_existing /proc/net/route eth0}eth0 ${addr eth0}
${goto 5}${color}${font 6x10:size=8,weight:normal}Down Speed: ${downspeed eth0}${goto 210}${color}${font 6x10:size=8,weight:normal}Up Speed: ${upspeed eth0}
${goto 5}Total Down: ${totaldown eth0}${goto 210}Total Up: ${totalup eth0}
${voffset 5}
${goto 0}${color1}${font 6x10:size=8,weight:bold}${else}${if_existing /proc/net/route wlan0}wifi ${addr wlan0}
${goto 5}${color}${font 6x10:size=8,weight:normal}AP: ${wireless_essid wlan0} ${goto 210}Speed: ${wireless_bitrate wlan0}
${goto 5}Mode: ${wireless_mode wlan0} ${goto 210}Quality: ${wireless_link_qual_perc wlan0}%
${goto 5}Down: ${downspeed wlan0} ${goto 210}Up: ${upspeed wlan0}
${goto 5}Total Down: ${totaldown wlan0}${goto 210}Total Up: ${totalup wlan0}
${else} ${goto 150}"Network Unavailable"
${endif} ${endif}
${voffset 5}
${goto 0}${font Digital Readout Thick Upright:size=15}Time:${time %k}:${time %M}${goto 200} Uptime:$uptime_short}
Offline
I changed to alignment bottom_right but it made no difference - conky still fixed top right. Picture of my Desktop and conkyrc script below.
As you can see it is right up against my top panel. Ideally I would like it half way between the top panel and the bottom of the screen.
#### ## Minimum size of the text area. ## Syntax: minimum_size [width] [height] # minimum_size 260 1294
You know... I wonder... how it's possible, that conkyrc with size encoded as 1294px high produces screenshot 1087px high with system panel and some free space under a Conky window included.
How it's possible?
One explanation is that... you're trying to edit different conkyrc that's displayed in your system
So if you edit conkyrc that's not displayed anywhere then it have no effect whatever you do to it.
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
@ ackernan
That is the .conkyrc for the system info conky
..... ${voffset 5} ${goto 0}${color1}${font 6x10:size=8,weight:bold}Memory Info ${goto 5}${color}${font 6x10:size=8,weight:normal}Total:${execi 1000 free -tm | grep -i mem |gawk '{ print $2}'}MB - Used: $mem - Free: $memfree ${voffset 5} ....
Thanks. Why are you using free instead of memmax which is part of conky?
memmax Total amount of memory
Offline
@ ackernan that's much easier
I was in a execi, grep gawk rush
Offline
Thanks Mr Peachy Worked a Charm! Added this to Write ">>> CPU" just under the bar. Also extended Length2 to equal 200
--CPU Text
local text_y=start_y-20--pixels above start_y
local text_x=start_x+length1+length2--pixels right from start_x
local text_x2=start_x+30+length1+length2--pixels right from start_x
cairo_set_source_rgba (cr, 1,1,0,1);
cairo_move_to (cr, text_x, text_y);
cairo_show_text (cr, ">>>");
cairo_set_source_rgba (cr, 1,1,1,1);
cairo_move_to (cr, text_x2, text_y);
cairo_show_text (cr, "CPU");
Offline
hi,
after sharing my new wallpaper (here), now I'll go ahead and also share my multi-conky setup (realized thanks to this guide ).
It look like this: and the three conky files are:
conkyrc_left
background yes
use_xft yes
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
## no compositor
own_window_type override
own_window_argb_visual no
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
default_shade_color 000000
draw_outline no
default_outline_color 828282
draw_borders yes
border_width 2
border_margin 0
default_color ffffff
stippled_borders 0
draw_graph_borders no
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no
default_bar_size 85 4
use_spacer no
xftfont Terminus:size=9
minimum_size 250 28
maximum_width 250
draw_shades yes
gap_x 10
gap_y 5
alignment bottom_left
TEXT
${color ffffff}Top CPU:${color de122b} ${top name 1} ${alignr}${color de4112}${top name 2}
${color ffffff}Top MEM:${color dde108} ${top_mem name 1} ${alignr}${color #ddaa00}${top_mem name 2}
conkyrc_center
background yes
use_xft yes
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
## no compositor
own_window_type override
own_window_argb_visual no
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
default_shade_color 000000
draw_outline no
default_outline_color 828282
draw_borders yes
border_width 2
border_margin 0
default_color ffffff
stippled_borders 0
draw_graph_borders no
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no
default_bar_size 85 4
use_spacer no
xftfont Terminus:size=7
minimum_size 840 28
maximum_width 840
draw_shades yes
gap_x -60
gap_y 5
alignment bottom_middle
TEXT
${color 08c2e1}CPU1 load ${cpubar cpu1 4,100}${offset 10}temp ${execbar sensors|grep 'Core 0:'|cut -f2 -d '+'|cut -f1 -d'.'}${offset 15}${color dde108}RAM ${offset 8}${membar 4,100}${offset 15}${color e17708}ROOT (${fs_size /})${offset 3}${fs_bar 4,100 /}${offset 15}HOME (${fs_size /home})${offset 3}${fs_bar 4,100 /home}
${color 08e135}CPU2 load ${cpubar cpu2 4,100}${offset 10}temp ${execbar sensors|grep 'Core 1:'|cut -f2 -d '+'|cut -f1 -d'.'}${offset 15}${color dde108}SWAP ${offset 2}${swapbar 4,100}${offset 15}${color e17708}USR (${fs_size /usr/})${offset 3}${fs_bar 4,100 /usr/}${offset 15}DATA (${fs_size /media/Data})${offset 3}${fs_bar 4,100 /media/Data}
for the cpu temperature the module coretemp needs to be loaded, otherwise use I shall use "temp1, temp2" instead of "Core 0, Core 1"
conkyrc_right
background yes
use_xft yes
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
## no compositor
own_window_type override
own_window_argb_visual no
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
default_shade_color 000000
draw_outline no
default_outline_color 828282
draw_borders yes
border_width 2
border_margin 0
default_color ffffff
stippled_borders 0
draw_graph_borders no
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no
default_bar_size 85 4
use_spacer no
xftfont Terminus:size=9
minimum_size 130 28
maximum_width 130
draw_shades yes
gap_x 10
gap_y 5
alignment bottom_right
TEXT
Host: $nodename
Uptime: $uptime
It is actually rather simple, but effective..any comment, suggestion, critic is mostly welcome..
Last edited by VDP76 (2012-10-29 15:29:50)
#!#!#! Forum etiquette #!#!#!
Are you a new member!? Have you introduced yourself?!
CLI basics | LVM | smxi | chrooting | multiarch
Offline
It is actually rather simple, but effective..any comment, suggestion, critic is mostly welcome..
why have this in 3 different conkies? I think it would be relatively easy to use ${goto} and combine it into one
Offline
why have this in 3 different conkies? I think it would be relatively easy to use ${goto} and combine it into one
well, just because I did not know that command..
also, I was curious to try the multi-conky and I must say that I like the actual 3 box configuration.
anyway thanks for the hint, I will already implement that command so it is easier to align vertically the different bars...
#!#!#! Forum etiquette #!#!#!
Are you a new member!? Have you introduced yourself?!
CLI basics | LVM | smxi | chrooting | multiarch
Offline
I'm a newbie at this so I apologise for any frustration I'm causing. I think I can see where I may have a problem, changes to my draw_bg.lua file - taking my changeable parameters back to the original VinDSL script the following code gives me this picture on my screen.
-- (Silver Shading Example)
local bg_colour = 0xc0c0c0
local bg_alpha = 0.05
-- Tweaks the height of your background, in pixels. If you don't need to adjust the height, use 0.
-- (Default Setting)
-- local vindsl_hack_height = 0
local vindsl_hack_height = -2
pic1
I preferred a dark blue colour so I changed this code to give pic2
-- (Silver Shading Example)
local bg_colour = 0x00008B
local bg_alpha = 0.85
-- Tweaks the height of your background, in pixels. If you don't need to adjust the height, use 0.
-- (Default Setting)
-- local vindsl_hack_height = 0
local vindsl_hack_height = -2
pic2
There is a lot of wasted space at the bottom of the conky window so I reduced the height by this change
-- (Silver Shading Example)
local bg_colour = 0x00008B
local bg_alpha = 0.85
-- Tweaks the height of your background, in pixels. If you don't need to adjust the height, use 0.
-- (Default Setting)
-- local vindsl_hack_height = 0
local vindsl_hack_height = -150
The screen is too narrow because it should say ubunu 12.04 so I increase the width by changing conkyrc
####
## Text alignment.
#
alignment top_right
####
## Minimum size of the text area.
## Syntax: minimum_size [width] [height]
#goodc minimum_size 230 1294
minimum_size 300 915
####
## Maximum width of the text area.
## Syntax: maximum_width [width]
#goodc maximum_width 260
maximum_width 260
####
## Gap between text and screen borders.
#
#goodc gap_x 30 ## Left / Right
#goodc gap_y 60 ## Top / Bottom
gap_x 30 ## Left / Right
gap_y 72 ## Top / Bottom
My last task, which I cannot do is to position my conky window mid way down my screen on the right that is as per pic4 but have similar (approx) gap top and bottom. At the moment all the gap/empty space is at the bottom. A clue to what is wrong is if I drag an icon into the empty space below the conky window and release the mouse the icon it does not stay there but goes back to where it was. Although it looks empty it obviously isn't - I suspect conk is there but is transparent. How can I move, what I see in pic4, down?
Offline
hey guys,
I've been using linux (mint 13) for a week now, so I'm totally new to this. I was setting up my conkyrc and ran out of space (height) to place more features (torrents in the transmission script). I tried to rescale width, but conky only gets larger, it does not align that aditional information to its right or left side. Some people suggested working around this running multiple conkies, but I really want to figure out how to do it with just one conkyrc. I've plans to include rss and stock tickers as well.
Help would be much appreciated
#################
# - Lua Files - #
#################
lua_load ~/.conkytransmission/conkytransmission.lua
######################
# - Conky settings - #
######################
update_interval 1
total_run_times 0
net_avg_samples 1
cpu_avg_samples 1
imlib_cache_size 0
double_buffer yes
no_buffers yes
format_human_readable
if_up_strictness address
#####################
# - Text settings - #
#####################
use_xft yes
xftfont Ubuntu:size=8
override_utf8_locale yes
text_buffer_size 2048
#############################
# - Window specifications - #
#############################
own_window_class Conky
own_window yes
own_window_type normal
own_window_argb_visual yes
own_window_argb_value 180
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
alignment top_right
gap_x 25
gap_y 40
minimum_size 182 600
maximum_width 182
default_bar_size 60 8
#########################
# - Graphics settings - #
#########################
draw_shades no
default_color 2B2B2B
color0 1E1C1A
color1 7296BB
color2 1E1C1A
color3 7296BB
TEXT
${font Ubuntu:style=Bold:size=8}SYSTEM $stippled_hr${font}
##############
# - SYSTEM - #
##############
${color0}${voffset 6}${font OpenLogos:size=19}u${font}${color}${goto 32}${voffset -14}Kernel: ${alignr}${color2}${kernel}${color}
${goto 32}Uptime: ${alignr}${color2}${uptime}${color}
# |--UPDATES
${goto 32}Updates: ${alignr}${font Ubuntu:style=Bold:size=8}${color1}${execi 360 aptitude search "~U" | wc -l | tail}${color}${font} ${color2}Packages${color}
# |--GMAIL
${goto 32}Gmail: ${alignr}${font Ubuntu:style=Bold:size=8}${color0}${execpi 3600 /usr/share/conkycolors/bin/conkyEmail -m IMAP -s imap.googlemail.com -u leotavaresbrown -p rcclyxtartaruga --ssl}${color}${font} New email(s)
# |--CPU
${offset 1}${color0}${font Poky:size=16}P${font}${offset -19}${voffset 9}${cpubar cpu0 4,18}${color}${voffset -16}${goto 32}CPU1: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu1}%${font} ${alignr}${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core 0' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font} ${color2}${cpugraph cpu1 10,50 000000 000000}${color}
${goto 32}CPU2: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu2}%${font} ${alignr}${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core 1' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font} ${color2}${cpugraph cpu2 10,50 000000 000000}${color}
${goto 32}CPU3: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu3}%${font} ${alignr}${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core 2' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font} ${color2}${cpugraph cpu3 10,50 000000 000000}${color}
${goto 32}CPU4: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu4}%${font} ${alignr}${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core 3' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font} ${color2}${cpugraph cpu4 10,50 000000 000000}${color}
# |--MEM
${color0}${font Poky:size=16}M${font}${color}${goto 32}${voffset -7}RAM: ${font Ubuntu:style=Bold:size=8}${color1}$memperc%${color}${font}
${offset 1}${voffset 2}${color0}${membar 4,18}${color}${goto 32}${voffset -2}F: ${font Ubuntu:style=Bold:size=8}${color2}${memeasyfree}${color}${font} U: ${font Ubuntu:style=Bold:size=8}${color2}${mem}${color}${font}
# |--SWAP
${voffset 2}${color0}${font Poky:size=14}s${font}${color}${voffset -8}${goto 32}SWAP: ${font Ubuntu:style=Bold:size=8}${color1}${swapperc}%${color}${font}
${voffset 4}${offset 1}${color0}${swapbar 4,18}${color}${voffset -4}${goto 32}F: ${font Ubuntu:style=Bold:size=8}${color2}$swapmax${color}${font} U: ${font Ubuntu:style=Bold:size=8}${color2}$swap${color}${font}
# |--PROC
${voffset 2}${color0}${font Poky:size=15}a${font}${color}${goto 32}${voffset -10}Processes: ${color2}${alignr 13}CPU${alignr}RAM${color}
${voffset -1}${goto 42}${color2}${top name 1}${color}${font Ubuntu:style=Bold:size=8}${color1} ${goto 126}${top cpu 1}${alignr }${top mem 1}${color}${font}
${voffset -1}${goto 42}${color2}${top name 2}${color}${font Ubuntu:style=Bold:size=8}${color1} ${goto 126}${top cpu 2}${alignr }${top mem 2}${color}${font}
${voffset -1}${goto 42}${color2}${top name 3}${color}${font Ubuntu:style=Bold:size=8}${color1} ${goto 126}${top cpu 3}${alignr }${top mem 3}${color}${font}
${voffset -1}${goto 42}${color2}${top name 4}${color}${font Ubuntu:style=Bold:size=8}${color1} ${goto 126}${top cpu 4}${alignr }${top mem 4}${color}${font}
${voffset -1}${goto 42}${color2}${top name 5}${color}${font Ubuntu:style=Bold:size=8}${color1} ${goto 126}${top cpu 5}${alignr }${top mem 5}${color}${font}
#############
# - CLOCK - #
#############
${voffset 4}${font Ubuntu:style=Bold:size=8}DATE $stippled_hr${font}
${font Digital Readout Thick Upright:size=40}${goto 22}${color2}${time %k}${voffset -9}:${voffset 9}${time %M}${goto 130}${color2}${voffset -14}${font Digital Readout Thick Upright:size=24}${goto 130}${color2}${time %d}${font Digital Readout Thick Upright:size=12}${voffset 14}${goto 130}${color2}${time %m}${goto 144}${color2}${time %y}${font}
################
# - CALENDAR - #
################
${voffset -2}${color0}${font Poky:size=16}D${font}${voffset -8}${font Ubuntu:style=Bold:size=7}${offset -17}${voffset 4}${time %d}${font}${color}${voffset -1}${font Monospace:size=7}${execpi 300 DJS=`date +%_d`; cal -h |sed '2,8!d'| sed '/./!d' | sed 's/^/${goto 42} /'| sed 's/$/ /' | sed 's/^/ /' | sed /" $DJS "/s/" $DJS "/" "'${font Arial:style=Bold:size=8}${voffset -2}${offset -4}${color1} '"$DJS"'${color}${font Monospace:size=7}'" "/}${voffset -1}
${voffset -22}
##########
# - HD - #
##########
${voffset 4}${font Ubuntu:style=Bold:size=8}HD $stippled_hr${font}
# |--HDTEMP1
${voffset 4}${color0}${font Weather:size=15}y${font}${color}${voffset -3}${goto 32}Temperature: ${font Ubuntu:style=Bold:size=8}${color1}${execi 120 hddtemp /dev/sda -n --unit=C}°C${color}${font}${alignr}${color2}/dev/sda${color}
${execpi 30 /usr/share/conkycolors/bin/conkyHD3}
###############
# - NETWORK - #
###############
${voffset 4}${font Ubuntu:style=Bold:size=8}NETWORK $stippled_hr${font}
# |--WLAN0
${if_up wlan0}
${voffset -13}${color0}${font VariShapes Solid:size=14}q${font}${color}${goto 32}${voffset -6}Up: ${font Ubuntu:style=Bold:size=8}${color1}${upspeed wlan0}${color}${font} ${alignr}${color2}${upspeedgraph wlan0 8,60 7296BB 7296BB}${color}
${goto 32}Total: ${font Ubuntu:style=Bold:size=8}${color2}${totalup wlan0}${color}${font}
${voffset -2}${color0}${font VariShapes Solid:size=14}Q${font}${color}${goto 32}${voffset -6}Down: ${font Ubuntu:style=Bold:size=8}${color1}${downspeed wlan0}${color}${font} ${alignr}${color2}${downspeedgraph wlan0 8,60 7296BB 7296BB}${color}
${goto 32}Total: ${font Ubuntu:style=Bold:size=8}${color2}${totaldown wlan0}${color}${font}
${voffset -2}${color0}${font Poky:size=14}Y${font}${color}${goto 32}${voffset -2}Signal: ${font Ubuntu:style=Bold:size=8}${color1}${wireless_link_qual_perc wlan0}%${color}${font} ${alignr}${color2}${wireless_link_bar 8,60 wlan0}${color}
${voffset 4}${color0}${font Poky:size=13}w${font}${color}${goto 32}${voffset -8}Local IP: ${alignr}${color2}${addr wlan0}${color}
${goto 32}Public IP: ${alignr}${color2}${execi 10800 /usr/share/conkycolors/bin/conkyIp}${color}
# |--ETH0
${else}${if_up eth0}
${voffset -13}${color0}${font VariShapes Solid:size=14}q${font}${color}${goto 32}${voffset -6}Up: ${font Ubuntu:style=Bold:size=8}${color1}${upspeed eth0}${color}${font} ${alignr}${color2}${upspeedgraph eth0 12,75 000000 000000}${color}
${goto 32}Total: ${font Ubuntu:style=Bold:size=8}${color2}${totalup eth0}${color}${font}
${voffset -2}${color0}${font VariShapes Solid:size=14}Q${font}${color}${goto 32}${voffset -6}Down: ${font Ubuntu:style=Bold:size=8}${color1}${downspeed eth0}${color}${font} ${alignr}${color2}${downspeedgraph eth0 12,75 000000 000000}${color}
${goto 32}Total: ${font Ubuntu:style=Bold:size=8}${color2}${totaldown eth0}${color}${font}
${voffset -2}${color0}${font Poky:size=13}w${font}${color}${goto 32}${voffset -4}Local IP: ${alignr}${color2}${addr eth0}${color}
${goto 32}Public IP: ${alignr}${color2}${execi 10800 /usr/share/conkycolors/bin/conkyIp}${color}
# |--PPP0
${else}${if_up ppp0}
${voffset -13}${color0}${font VariShapes Solid:size=14}q${font}${color}${goto 32}${voffset -6}Up: ${font Ubuntu:style=Bold:size=8}${color1}${upspeed ppp0}${color}${font} ${alignr}${color2}${upspeedgraph ppp0 8,60 7296BB 7296BB}${color}
${goto 32}Total: ${font Ubuntu:style=Bold:size=8}${color2}${totalup ppp0}${color}${font}
${voffset -2}${color0}${font VariShapes Solid:size=14}Q${font}${color}${goto 32}${voffset -6}Down: ${font Ubuntu:style=Bold:size=8}${color1}${downspeed ppp0}${color}${font} ${alignr}${color2}${downspeedgraph ppp0 8,60 7296BB 7296BB}${color}
${goto 32}Total: ${font Ubuntu:style=Bold:size=8}${color2}${totaldown ppp0}${color}${font}
${voffset -2}${color0}${font Poky:size=13}w${font}${color}${goto 32}${voffset -4}Local IP: ${alignr}${color2}${addr ppp0}${color}
${else}${voffset 4}${color0}${font PizzaDude Bullets:size=12}4${font}${color}${goto 32}Network Unavailable${voffset 14}${endif}${endif}${endif}
################
# - TORRENTS - #
################
${execpi 3 ~/.conkytransmission/conkytransmission.py}
Offline
I think I have solved it - sorry to take up space on tis thread. It seems to be having a negative value - see bottom line below. This has moved the whole thing down.
####
## Minimum size of the text area.
## Syntax: minimum_size [width] [height]
#goodc minimum_size 230 1294
minimum_size 300 915
####
## Maximum width of the text area.
## Syntax: maximum_width [width]
#goodc maximum_width 260
maximum_width 260
####
## Gap between text and screen borders.
#
#goodc gap_x 30 ## Left / Right
#goodc gap_y 60 ## Top / Bottom
gap_x 50 ## Left / Right
gap_y -98 ## Top / Bottom
Offline
actually I'm tweaking with ${goto} and ${voffset} and it's working out, thanks anyway
Last edited by rcc (2012-06-30 19:47:35)
Offline
actually I'm tweaking with ${goto} and ${voffset} and it's working out, thanks anyway
Glad you figured it out. Share a snapshot when you get it set up.
Offline
-- Tweaks the height of your background, in pixels. If you don't need to adjust the height, use 0. -- (Default Setting) -- local vindsl_hack_height = 0 local vindsl_hack_height = -150
My last task, which I cannot do is to position my conky window mid way down my screen on the right that is as per pic4 but have similar (approx) gap top and bottom. At the moment all the gap/empty space is at the bottom. A clue to what is wrong is if I drag an icon into the empty space below the conky window and release the mouse the icon it does not stay there but goes back to where it was. Although it looks empty it obviously isn't - I suspect conk is there but is transparent. How can I move, what I see in pic4, down?
I think you misunderstand something.
Height hack in LUA code drawing background don't change Conky window height, it changes background height only. Sometimes it's preferred (like, if you put something at the bottom of Conky window and don't like it to interfere with LUA bacground, eg. weather radar or something that display other kind of pictures).
But then, if you try to position Conky window, if it's height is bigger or equal to your screen size then it will block any vertical movement.
So, if you don't need empty space at the end of Conky window without background then leave LUA draw background height hack at "0" value. That way background will be drawn under whole Conky window (it can't be drawn outside of Conky window, only inside of Conky window, so it will never be larger than Conky window).
After that, check out how many free space Conky window have at the bottom and lower value of minimal window height in conkyrc instead.
PS: if your screen height is 1080px, Conky window is 915px and default panel height i 24px then 1080-915=105 - that's maximum value of the gap_y that you could use, but remember, that Conky don't see your system panel as any obstacle and measure screen height in full and position to that, so if you use "gap_y 24" with "alignment top_right" then Conky window will be right under upper system panel. If you use negative value for gap then it try to move outside of screen, but there is another screen, so it will be drawn here, and as Conky is drawn at all screen the same then it will be drawn in primary screen form which it moved out at mirrored position. Like when aligned to top then it will be aligned to bottom after that.
Last edited by dk75 (2012-06-30 23:27:11)
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
Need some help after looking through million of conky pages ...
Does somebody know where to find the conkyrc for this setup?
http://ompldr.org/vNzBheQ
The thread I found it in is:
http://crunchbanglinux.org/forums/topic … community/
Sadly the dropbox link doen't work. A pm to the author got no reply.
Thanks se7en
Offline
^ Looks like that was posted by Rooster, who is still fairly active here. Why not PM him?
Offline
rcc wrote:actually I'm tweaking with ${goto} and ${voffset} and it's working out, thanks anyway
Glad you figured it out. Share a snapshot when you get it set up.
Thanks! Looks default-ish but I'm having fun. Here it goes
There, right at the bottom is the problem, actually. I want to place the "Torrents" section to fit in the left side, so I can push it up and arrange it properly, but I don't know which variable does that.
Any help?
update: this is more or less what I want to do: http://didi79.deviantart.com/art/conky-config-127651851 but he runs two conkyrc files simutaneously instead.
Last edited by rcc (2012-07-01 04:56:17)
Offline
Need some help after looking through million of conky pages ...
Does somebody know where to find the conkyrc for this setup?
http://ompldr.org/vNzBheQThe thread I found it in is:
http://crunchbanglinux.org/forums/topic … community/Sadly the dropbox link doen't work. A pm to the author got no reply.
Thanks se7en
that conky is one of mine, all done in a lua script... ill see if i can dig it out
@rcc that postimage link is no good
when you upload to postimage you should get this
click the copy to clipboard button and past it directly into your post
Last edited by mrpeachy (2012-07-01 04:49:05)
Offline
@mrpeachy
nice hope you find it.
Offline
@mrpeachy
nice hope you find it.
here it is
http://crunchbanglinux.org/forums/post/101949/#p101949
and there are some more bits and pieces in the next couple of pages in the thread
@rcc - i would say that 2 conkies would be the way to go here
could get confusing trying to position all that in one the way you want it.
Last edited by mrpeachy (2012-07-01 05:02:25)
Offline
thanks
Offline
How do you create a background color for conky?
I've looked numerous places on and off the forums and the best I could find was this #! post
However, "own_window_color" does not work.
Ideas?
Here is my current base conky without the color line:
# 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/204http://crunchbanglinux.org/forums/topic/8709/solved-placing-conky-next-to-tint2/7/conky-help/
#
# Enjoy! :)
##############################################
# Settings
##############################################
background no
use_xft yes
xftfont sans: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
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 370 20
maximum_width 850
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color ffffff
default_shade_color 000000
default_outline_color 828282
alignment top_right
gap_x 190
gap_y 00
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no
##############################################
# Output
##############################################
TEXT
ULS:${upspeed wlan0}kb/s total: ${totalup wlan0} | DLS:${downspeed wlan0}kb/s total: ${totaldown wlan0}
RAM: $mem/$memmax | Swap:$swap/$swapmax | CPU:${cpu cpu0}%
Thank you for your assistance.
To say that any people are not fit for freedom, is to make poverty their choice, and to say they had rather be loaded with taxes than not. - Thomas Paine
Offline
How do you create a background color for conky?
Have you tried draw_bg.lua?
draw_bg.lua
--[[Background originally by londonali1010 (2009)
ability to set any size for background mrpeachy 2011
ability to set variables for bg in conkyrc dk75
the change is that if you set width and/or height to 0
then it assumes the width and/or height of the conky window
so:
lua_load ~/Conky/LUA/draw_bg.lua
TEXT
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.4}
See below: 1 2 3 4 5 6 7
${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
covers the whole window and will change if you change the minimum_size setting
1 = 20 corner_radius
2 = 0 x_position
3 = 0 y_position
3 = 0 width
5 = 0 height
6 = 0x000000 color
7 = 0.4 alpha
or both above TEXT
lua_load ~/Conky/LUA/draw_bg.lua
lua_draw_hook_pre draw_bg 0 0 0 0 0 0x000000 0.4
TEXT
]]
require 'cairo'
local cs, cr = nil
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg(r,x,y,w,h,color,alpha)
if conky_window == nil then return end
if cs == nil then cairo_surface_destroy(cs) end
if cr == nil then cairo_destroy(cr) end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
w=w
h=h
if w=="0" then w=tonumber(conky_window.width) end
if h=="0" then h=tonumber(conky_window.height) end
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
-----------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
------------------------------------------------------------
cairo_surface_destroy(cs)
cairo_destroy(cr)
return ""
end
@rcc - Looks good. More then defaultish.
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