Posts: 604
thriftee
Joined: 27 Feb 2009
#1
I did a bunch of tweaking to the conky and menus. Make sure your window is wide enough to see it. I let ther conky come up and if I get strapped for resources, I just turn it off. I'm pretty much a noob at linux, but I'll post the conky.rc anyway in case it might help some other noob. My code to get the weather does acrtually work, but is crappy hard code, because I don't understand things here, so I won't post it.


Code: Select all

text_buffer_size 6500
max_specials 700

# set to yes if you want Conky to be forked in the background
background yes

short_units yes

cpu_avg_samples 2
net_avg_samples 2

out_to_console no

# X font when Xft is disabled, you can pick one with program xfontsel
#font 7x12
#font 6x10
#font 7x13
 font 8x12
#font 7x12
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
#font -artwiz-snap-normal-r-normal-*-*-100-*-*-p-*-iso8859-1

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
xftfont gentium:size=10

# Create own window instead of using desktop (required in nautilus, pcmanfm and rox desktops)
own_window yes
own_window_transparent yes
own_window_hints undecorated,sticky,skip_taskbar

# Text alpha when using Xft
xftalpha 0.8

#on_bottom no

# mail spool
#rdc
#mail_spool $MAIL

# Update interval in seconds
#rdc
update_interval 15

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 425 750
maximum_width 525

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
#rdc
border_margin 10

# border width
border_width 2

color0 black
color1 red
color2 green
color3 yellow
color4 blue
color5 magenta
color6 cyan
color7 white
# hot pink
color8 #FF078B
# flourecent orange
color9 #FF9C07

# Default colors and also border colors
default_color white
default_shade_color white
default_outline_color white

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text

gap_x 1050
gap_y 10

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer right

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# boinc (seti) dir
# seti_dir /opt/seti

# Possible variables to be used:
#
#      Variable         Arguments                  Description                
#  acpiacadapter                     ACPI ac adapter state.                   
#  acpifan                           ACPI fan state                           
#  acpitemp                          ACPI temperature.                        
#  adt746xcpu                        CPU temperature from therm_adt746x       
#  adt746xfan                        Fan speed from therm_adt746x             
#  battery           (num)           Remaining capasity in ACPI or APM        
#                                    battery. ACPI battery number can be      
#                                    given as argument (default is BAT0).     
#  buffers                           Amount of memory buffered                
#  cached                            Amount of memory cached                  
#  color             (color)         Change drawing color to color            
#  cpu                               CPU usage in percents                    
#  cpubar            (height)        Bar that shows CPU usage, height is      
#                                    bar's height in pixels                   
#  downspeed         net             Download speed in kilobytes              
#  downspeedf        net             Download speed in kilobytes with one     
#                                    decimal                                  
#  exec              shell command   Executes a shell command and displays    
#                                    the output in torsmo. warning: this      
#                                    takes a lot more resources than other    
#                                    variables. I'd recommend coding wanted   
#                                    behaviour in C and posting a patch :-).  
#  execi             interval, shell Same as exec but with specific interval. 
#                    command         Interval can't be less than              
#                                    update_interval in configuration.        
#  fs_bar            (height), (fs)  Bar that shows how much space is used on 
#                                    a file system. height is the height in   
#                                    pixels. fs is any file on that file      
#                                    system.                                  
#  fs_free           (fs)            Free space on a file system available    
#                                    for users.                               
#  fs_free_perc      (fs)            Free percentage of space on a file       
#                                    system available for users.              
#  fs_size           (fs)            File system size                         
#  fs_used           (fs)            File system used space                   
#  hr                (height)        Horizontal line, height is the height in 
#                                    pixels                                   
#  i2c               (dev), type, n  I2C sensor from sysfs (Linux 2.6). dev   
#                                    may be omitted if you have only one I2C  
#                                    device. type is either in (or vol)       
#                                    meaning voltage, fan meaning fan or temp 
#                                    meaning temperature. n is number of the  
#                                    sensor. See /sys/bus/i2c/devices/ on     
#                                    your local computer.                     
#  kernel                            Kernel version                           
#  loadavg           (1), (2), (3)   System load average, 1 is for past 1     
#                                    minute, 2 for past 5 minutes and 3 for   
#                                    past 15 minutes.                         
#  machine                           Machine, i686 for example                
#  mails                             Mail count in mail spool. You can use    
#                                    program like fetchmail to get mails from 
#                                    some server using your favourite         
#                                    protocol. See also new_mails.            
#  mem                               Amount of memory in use                  
#  membar            (height)        Bar that shows amount of memory in use   
#  memmax                            Total amount of memory                   
#  memperc                           Percentage of memory in use              
#  new_mails                         Unread mail count in mail spool.         
#  nodename                          Hostname                                 
#  outlinecolor      (color)         Change outline color                     
#  pre_exec          shell command   Executes a shell command one time before 
#                                    torsmo displays anything and puts output 
#                                    as text.                                 
#  processes                         Total processes (sleeping and running)   
#  running_processes                 Running processes (not sleeping),        
#                                    requires Linux 2.6                       
#  shadecolor        (color)         Change shading color                     
#  stippled_hr       (space),        Stippled (dashed) horizontal line        
#                    (height)        
#  swapbar           (height)        Bar that shows amount of swap in use     
#  swap                              Amount of swap in use                    
#  swapmax                           Total amount of swap                     
#  swapperc                          Percentage of swap in use                
#  sysname                           System name, Linux for example           
#  time              (format)        Local time, see man strftime to get more 
#                                    information about format                 
#  totaldown         net             Total download, overflows at 4 GB on     
#                                    Linux with 32-bit arch and there doesn't 
#                                    seem to be a way to know how many times  
#                                    it has already done that before torsmo   
#                                    has started.                             
#  totalup           net             Total upload, this one too, may overflow 
#  updates                           Number of updates (for debugging)        
#  upspeed           net             Upload speed in kilobytes                
#  upspeedf          net             Upload speed in kilobytes with one       
#                                    decimal                                  
#  uptime                            Uptime                                   
#  uptime_short                      Uptime in a shorter format               
#
#  seti_prog                         Seti@home current progress
#  seti_progbar      (height)        Seti@home current progress bar
#  seti_credit                       Seti@hoome total user credit
## antiX additives examples. Add below Text##
##Battery examples##
##${color}battery: ${color}$acpiacadapter, ${battery_percent BAT1}% 
##${color}battery:${color} ${battery}
#${color}ACPI Battery: ${color}$battery
#${battery_bar 11,0}
##Wireless example##
#${color}Wireless:
#${color}essid: ${wireless_essid wlan0}
#${color}IP:${color} ${addr wlan0}
#${color}speed: ${color} ${wireless_bitrate wlan0}
#${color}link strength: ${color} ${wireless_link_bar 7,50 wlan0}

# stuff after 'TEXT' will be formatted on screen

TEXT
${font gentium:size=14}${color #FF078B}${nodename}
${font gentium:size=10}${color2}Desktop: ${color}${exec cat ~/.antix-session/desktop-code$DISPLAY}
${color}$sysname $kernel
${color2}Time: ${color}${time %a %d %b %k:%M}   ${color2}Uptime: ${color}$uptime     
${color2}Monitors:
${color2}cpu freq: ${color}${freq} mhz ${machine} ${color2}load: ${color}${cpu}%
     ${color3}${cpubar 11}
${color2}processes: ${color}$processes  ${color2}running: ${color}$running_processes
${color2}ram : ${color}$mem${color}/${color}$memmax ${color}- ${color}$memperc%
     ${color3}${membar 11}
${color2}swap: ${color}$swap${color}/${color}$swapmax ${color}- ${color}$swapperc%
     ${color3}${swapbar 11}
${color2}Root:${color} ${fs_free /} ${color}= ${fs_free_perc /}%
     ${color3}${fs_bar 11}
${font gentium:size=9}${color}${execi 900 /home/bobc/getweatherf.sh ORD}
Last edited by thriftee on 18 Apr 2014, 18:30, edited 1 time in total.
Posts: 667
jdmeaux1952
Joined: 01 Nov 2013
#2
Nice!
Posts: 765
rust collector
Joined: 27 Dec 2011
#3
cool stuff, can we see the getweather script too?
Posts: 604
thriftee
Joined: 27 Feb 2009
#4
Yes, but if you look at it, you need to help me make it"kosher" if you know how __{{emoticon}}__

My thoughts are that if possible I should have piped the output from one program to the next rather than writing to and from temp files.

Secondly, I shouldn't have hard coded the directory path, and if I was going to use temp files, they should have been stored in a more appropriate place, but I don't understand the security and script language well enough to write things properly.

So if anyone looking knows a way to do it better, please post so I can learn from it...

Code: Select all

# getweatherf.sh - uses weather command to get forecast
# requires weather-util and weather-util-data packages both be installed
# usage: getweatherf.sh ORD  
weather -f $1 > /home/bobc/getweatherfi.txt
sed -n '3,50 p' </home/bobc/getweatherfi.txt > /home/bobc/getweatherfo.txt
cat /home/bobc/getweatherfo.txt
Posts: 604
thriftee
Joined: 27 Feb 2009
#5
Here is a better version of the script

Code: Select all

# getweatherf.sh - uses weather command to get forecast
# requires weather-util and weather-util-data packages both be installed
# parm1 = METAR code, ORD = Chicago O'Hare
# usage: getweatherf.sh ORD  
weather -f $1 | sed -n '3,50 p'