LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 03-06-2011, 10:00 AM   #1
Ipozya
Member
 
Registered: Dec 2010
Distribution: Arch
Posts: 54

Rep: Reputation: 2
Conky Configuration


Hi I have two questions regarding conky:

1) On my bar, I include the following information about upload and download:

Code:
${color} Net: ${color e0e0e0}${font}${downspeed eth0}  ${totaldown eth0} ${color} downloaded ${color e0e0e0}  | ${color e0e0e0}${upspeed eth0} ${totalup eth0} ${color} uploaded
This works great but obviously does not display any information if I am using wireless (which I use about half the time). Is there anyway of coding it so that it checks if I am using eth0 or wlan0, instead of always eth0 (maybe look at ifconfig and see what's being used)?

2) My conky runs as a horizontal bar at the top of the screen. Sometimes the end of it gets cut off, however, even though it's only using 80% of screen width. Is there anyway to adjust this? Here is my entire .conkyrc

Code:
#avoid flicker
double_buffer yes

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

#borders
draw_borders no
#border_inner_margin
#border_outer_margin

#shades
draw_shades yes

# Stippled borders?
stippled_borders 8

# border width
border_width 1

#position
gap_x 0
gap_y 0
alignment top_middle

#behaviour
update_interval 1

#colour
default_color  8f8f8f

#default_shade_color 000000
own_window_colour 262626

#font
use_xft yes
xftalpha 0.8
xftfont bauhaus:pixelsize=10
override_utf8_locale yes

#to prevent window from moving
use_spacer right
minimum_size 1268 0

#mpd
mpd_host localhost
mpd_port 6600

TEXT
CPU: ${color e0e0e0}${font} ${freq}Mhz   ${cpu}% ${cpubar 7,50} ${color} ${color e0e0e0} ${execi 30 acpi -t | head -n 1 | cut -c 16-19}C | ${color} Mem: ${color e0e0e0}${font}${mem} ${membar 7,50}  |  ${color} Root: ${color e0e0e0}${font}${fs_free /} ${color} Home: ${color e0e0e0}${font}${fs_free /home} | ${color} Mpd:  ${color e0e0e0}${font}${mpd_smart} | ${color} Up: ${color e0e0e0}${font}${uptime} | ${color} Battery: ${color e0e0e0}${battery} | ${color} Net: ${color e0e0e0}${font}${downspeed eth0}  ${totaldown eth0} ${color} downloaded ${color e0e0e0}  | ${color e0e0e0}${upspeed eth0} ${totalup eth0} ${color} uploaded
Thank you in advance!
 
Old 03-06-2011, 01:25 PM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
Quote:
Originally Posted by Ipozya View Post
Hi I have two questions regarding conky:

1) On my bar, I include the following information about upload and download:

Code:
${color} Net: ${color e0e0e0}${font}${downspeed eth0}  ${totaldown eth0} ${color} downloaded ${color e0e0e0}  | ${color e0e0e0}${upspeed eth0} ${totalup eth0} ${color} uploaded
This works great but obviously does not display any information if I am using wireless (which I use about half the time). Is there anyway of coding it so that it checks if I am using eth0 or wlan0, instead of always eth0 (maybe look at ifconfig and see what's being used)?
Insert a conditional ${if_up eth0} code ${endif} then
add another line substituting wlan0 for eth0 with another conditional ${if_up wlan0} code ${endif}
Quote:
Originally Posted by Ipozya View Post
2) My conky runs as a horizontal bar at the top of the screen. Sometimes the end of it gets cut off, however, even though it's only using 80% of screen width. Is there anyway to adjust this?
How big is your screen?

Try adjusting
Code:
#to prevent window from moving
use_spacer right
minimum_size 1268 0
maybe you can add

Code:
maximum_width 1680
just below the above set to whatever your screen width is.
 
Old 03-06-2011, 09:12 PM   #3
Ipozya
Member
 
Registered: Dec 2010
Distribution: Arch
Posts: 54

Original Poster
Rep: Reputation: 2
Thank you for your response. I edited the config to read as follow:

.conkyrc
Code:
${color} Net: ${color e0e0e0}${font}${if_up eth0}${downspeed eth0}  ${totaldown eth0}${endif}${if_up wlan0}${downspeed wlan0}  ${totaldown wlan0}${endif} 
${color} downloaded ${color e0e0e0}  | ${color e0e0e0}${if_up eth0}${upspeed eth0} ${totalup eth0}${endif}${if_up wlan0}${upspeed wlan0} ${totalup wlan0}${endif} ${color} uploaded
The conky bar now has 4 numbers each for downloaded and uploaded (2 for wlan, 2 for eth0), instead of only displaying the relevant one.

Could this be because ifconfig still displays eth0, lo and wlan0, so it thinks that the interface does exist?

EDIT: Solved the wlan0/eth0 issue. I had to add a line to the file:
Code:
if_up_strictness address
This checks that an interface has an ip address before it is considered up.

I am still having issues with the length of conky across top. I added the maximum_width and it did nothing. Still cuts off and only uses ~80% of screen width

Last edited by Ipozya; 03-06-2011 at 10:08 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] conky configuration question Tux Rules Linux - Software 6 10-30-2010 02:01 PM
LXer: Conky Colors Makes Your Conky Beautiful In Seconds (Version 3.20 Released) LXer Syndicated Linux News 0 08-01-2010 11:21 AM
conky configuration jone kim Linux - General 12 05-30-2010 08:14 AM
Conky temp configuration Deonild Linux - Software 1 04-14-2009 04:59 PM
Conky on Suse 10.0 - *** buffer overflow detected *** conky terminated Slidex Linux - Software 1 03-17-2006 11:50 AM


All times are GMT -5. The time now is 01:23 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration