SEARCH

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

You are not logged in.

#1276 2012-05-17 19:02:38

ackernan
#! Junkie
Registered: 2011-01-10
Posts: 403

Re: The New Monster Conky Thread

ssrock64 wrote:
Sector11 wrote:
ssrock64 wrote:

Hello, everyone. I've been using a lot of conky/lua scripts from mrpeachy, and have never really had problems with any of them...until now. I used the Mayan calendar script, and it hasn't been functioning correctly. When the clock updates, the former image stays put and the new one is layered on top of it. After about 30 seconds, this happens:

Any ideas?

Welcome to CrunchBang.  I'm not a LUA expert but what is the 'update_interval' of the conky set to?

I honestly don't know. Where would I find and/or modify that?

The config section of your conky, area above 'TEXT'.

Offline

Help fund CrunchBang, donate to the project!

#1277 2012-05-17 19:15:05

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,419
Website

Re: The New Monster Conky Thread

^^^ Yup!

update_interval 1

Did you see the post by mrpeachy: the most recent version of the mayan calendar lua

Offline

#1278 2012-05-17 19:46:26

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,419
Website

Re: The New Monster Conky Thread

tedbell wrote:

Can anyone help me resize this weather script? I'm new to this conky stuff and tried to get the original stuff in conkyrc in the new conky with this script but it won't show up at all. Looking also to add a digital clock and sensors. smile

Hello again tedbell ....

How stuck are you on that conky script you have that uses jbaseb's script?

I can get you up an running with a Teo script, a digital clock and calendar and sensors no problem at all.

first if you don't have it: install 'lm-sensors' and run:

sudo sensors-detect

Use the default answers except for that last one - say YES!

Check for PM - upper right hand corner of the page: messages

Last edited by Sector11 (2012-05-18 13:47:26)

Offline

#1279 2012-05-18 10:27:39

finwin
#! CrunchBanger
Registered: 2011-01-08
Posts: 131

Re: The New Monster Conky Thread

PackRat wrote:
finwin wrote:
VastOne wrote:

Check out this thread finwin

Guy had the same issue, it is an Xorg issue...may have something to do with your video card??

I tried to downgrade my video card driver (intel - 2.19) but it didn't help. What should i do?

Are you using dwm as your window manager? If so, you have several errors in the .conkyrc you posted earlier - like using xft (dwm does not recognize xft fonts) and and out_to_console needs to be yes.

Take a look here:   https://wiki.archlinux.org/index.php/Dw … _statusbar

my dwm .conkyrc:

background no
out_to_x no
out_to_console yes
update_interval 1
total_run_times 0
use_spacer none

TEXT
<Add your stuff>

Started in the .xinitrc (or start up file if you're using gdm etc....)

conky -c .conkydwm | while read LINE; do xsetroot -name "$LINE"; done &

aajvN9tX.jpg

As far as I know, your original video driver was good; if you want color in the conky output, you'll have to pipe it through dzen2 and lay that over the dwm status bar.

If I use 'out_to_console yes' or I pipe it throung dzen I can't use cpu or membars.


ffwn

Offline

#1280 2012-05-18 13:11:15

ElderV.LaCoste
#! Die Hard
From: Equarico
Registered: 2010-07-15
Posts: 781

Re: The New Monster Conky Thread

Can anyone point me to how to get the wireless speed and wireless quality into a ring meter?  I found this:

${wireless_bitrate wlan0}
${wireless_link_qual_perc wlan0}%

but how to get them to show up in the ring meter has been confounding me.  I am messing around with Londonali's Conky Widgets and this is my complete ripoff version of her setup: 

2012_05_18_1337346552_1366x768_scrot.jpg

I would like to add a couple more rings showing the above mentioned items.  I might have to lose a couple of the FS rings.

Last edited by ElderV.LaCoste (2012-05-18 13:11:34)


Proceed with confidence!
http://eldervlacoste.deviantart.com/

Offline

#1281 2012-05-18 14:07:21

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,419
Website

Re: The New Monster Conky Thread

ElderV.LaCoste wrote:

I would like to add a couple more rings showing the above mentioned items.  I might have to lose a couple of the FS rings.

It should be a simple matter of adding two "1/2 circles" - if below it could be done like this.
aauGoEVp.jpg

Copy the code of the top two to the bottom of the code and change the "y" values to move them down to where they belong.

Then change the info for
${wireless_bitrate wlan0}
${wireless_link_qual_perc wlan0}%

If you show the LUA code it would be easier to help.

Offline

#1282 2012-05-18 14:15:49

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,419
Website

Re: The New Monster Conky Thread

@ tedbell - check your message (top right of page)

Not knowing exactly what you want (still working on the other code - it a huge job) I came up with this as a fill in...

aazaJywZ.jpg

Mind you it is set for my system that's why the message
The conky:

## killall conky && conky -c ~/AccuW_2/accuw.Toronto.conky &
# 1e_Accuweather_USA_Images script by TeoBigusGeekus
# http://crunchbanglinux.org/forums/post/212605/
###  Begin Window Settings  ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes

# Use the Xdbe extension? (eliminates flicker)
# It is highly recommended to use own window with this one
# so double buffer won't be so big.
double_buffer yes

own_window_type normal #override
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
# own_window_colour #4d4d4d
own_window_class Accuweather International
own_window_title Accuweather International

### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
### This option will not work as desired (in most cases) in conjunction with
### own_window_type override
# own_window_argb_visual yes

### When ARGB visuals are enabled, this use this to modify the alpha value
### Use: own_window_type normal
### Use: own_window_transparent no
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
#own_window_argb_value 150

minimum_size 310 0 ## width, height
maximum_width 310  ## width, usually a good idea to equal minimum width

gap_x 10 ### left &right
gap_y 10 ### up & down

alignment top_right
####################################################  End Window Settings  ###
###  Font Settings  ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Anonymous Pro:bold:size=9

# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 0
# Force UTF8? requires XFT ###
override_utf8_locale yes

draw_shades yes #no #### <<<--- To see it easier on light screens.
#default_shade_color black

draw_outline yes #no #### <<<--- Amplifies text if yes
default_outline_color black

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
default_shade_color gray
default_outline_color black

default_color DCDCDC #Gainsboro
color0 ffe595 #Teo Gold
color1 778899 #LightSlateGrey
color2 FF8C00 #Darkorange
color3 7FFF00 #Chartreuse
color4 FFA07A #LightSalmon
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 00FFFF #Cyan #48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red  #A52A2A #DarkRed
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 5
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################

# Boolean value, if true, Conky will be forked to background when started.
background no

# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer right

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 256

# Subtract (file system) buffers from used memory?
no_buffers yes

# change GiB to G and MiB to M
short_units yes

# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

#   Maximum size of user text buffer, i.e. layout below TEXT line in config file
#  (default is 16384 bytes)
# max_user_text 16384

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load ~/Conky/LUA/draw-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
#lua_load ~/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.5
#
#######################################################  End LUA Settings  ###

# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1

## ${image ~/Conky/images/red_1.png -p 0,15 -s 67x40}
## ${image ~/Conky/images/red_1.png -p 165,52 -s 125x75}
## $HOME/AccuW_2/Toronto/acc_int_images

default_bar_size 100 12

# stuff after 'TEXT' will be formatted on screen
TEXT
${color0}${time %d %b %Y} ${color1}--${color0} Toronto, ON ${color1}--${color0} ${time %T}${color}\
${texeci 500 bash $HOME/AccuW_2/Toronto/acc_int_images}\
${image $HOME/AccuW_2/Toronto/cc.png -p 200,15 -s 67x40}
${execpi 600 sed -n '1p' $HOME/AccuW_2/Toronto/messages}
${font Dumbledor 1 Cut Up:size=20} Now ${execpi 600 sed -n '29p' $HOME/AccuW_2/Toronto/curr_cond}${goto 120}FL ${execpi 600 sed -n '30p' $HOME/AccuW_2/Toronto/curr_cond}${font}

${color0}Wind:  ${color}${execpi 600 sed -n '31p' $HOME/AccuW_2/Toronto/curr_cond} ${execpi 600 sed -n '32p' $HOME/AccuW_2/Toronto/curr_cond}\
         ${color0}Today      Tonight${color}
${color0}Hum:   ${color}${execpi 600 sed -n '33p' $HOME/AccuW_2/Toronto/curr_cond}\
${goto 170}${color6}${execpi 600 sed -n '26p' $HOME/AccuW_2/Toronto/first_days}${color}\
${goto 210}${color9}${execpi 600 sed -n '27p' $HOME/AccuW_2/Toronto/first_days}${color}\
${goto 245}${color6}${execpi 600 sed -n '32p' $HOME/AccuW_2/Toronto/first_days}${color}\
${goto 290}${color9}${execpi 600 sed -n '31p' $HOME/AccuW_2/Toronto/first_days}${color}
${color0}Bar:   ${color}${execpi 600 sed -n '34p' $HOME/AccuW_2/Toronto/curr_cond}\
${image $HOME/AccuW_2/Toronto/tod.png -p 160,90 -s 67x40}\
${image $HOME/AccuW_2/Toronto/ton.png -p 240,90 -s 67x40}
${color0}Cloud: ${color}${execpi 600 sed -n '35p' $HOME/AccuW_2/Toronto/curr_cond}
${color0}UVI:   ${color}${execpi 600 sed -n '36p' $HOME/AccuW_2/Toronto/curr_cond}
${color0}Vis:   ${color}${execpi 600 sed -n '38p' $HOME/AccuW_2/Toronto/curr_cond}
${color0}DP:    ${color}${execpi 600 sed -n '37p' $HOME/AccuW_2/Toronto/curr_cond}°
 ${color0}Sunrise: ${color}${execpi 600 sed -n '39p' $HOME/AccuW_2/Toronto/curr_cond}\
${goto 160}${color0} Sunset: ${color}${execpi 600 sed -n '40p' $HOME/AccuW_2/Toronto/curr_cond}
${color0}Moonrise: ${color}${execpi 600 sed -n '41p' $HOME/AccuW_2/Toronto/curr_cond}\
${goto 160}${color0}Moonset: ${color}${execpi 600 sed -n '42p' $HOME/AccuW_2/Toronto/curr_cond}
   ${color1}${execpi 600 sed -n '5p' $HOME/AccuW_2/Toronto/first_days}\
            ${execpi 600 sed -n '10p' $HOME/AccuW_2/Toronto/first_days}\
            ${execpi 600 sed -n '15p' $HOME/AccuW_2/Toronto/first_days}${color}\
${image $HOME/AccuW_2/Toronto/6.png -p 0,200 -s 67x40}\
${image $HOME/AccuW_2/Toronto/11.png -p 105,200 -s 67x40}\
${image $HOME/AccuW_2/Toronto/16.png -p 205,200 -s 67x40}

          ${execpi 600 sed -n '8p' $HOME/AccuW_2/Toronto/first_days}°\
${goto 180}${execpi 600 sed -n '13p' $HOME/AccuW_2/Toronto/first_days}°\
${goto 283}${execpi 600 sed -n '18p' $HOME/AccuW_2/Toronto/first_days}°
          ${execpi 600 sed -n '9p' $HOME/AccuW_2/Toronto/first_days}°\
${goto 180}${execpi 600 sed -n '14p' $HOME/AccuW_2/Toronto/first_days}°\
${goto 283}${execpi 600 sed -n '19p' $HOME/AccuW_2/Toronto/first_days}°

   ${color1}${execpi 600 sed -n '20p' $HOME/AccuW_2/Toronto/first_days}\
            ${execpi 600 sed -n '1p' $HOME/AccuW_2/Toronto/last_days}\
            ${execpi 600 sed -n '6p' $HOME/AccuW_2/Toronto/last_days}${color}\
${image $HOME/AccuW_2/Toronto/21.png -p 0,265 -s 67x40}\
${image $HOME/AccuW_2/Toronto/last_2.png -p 105,265 -s 67x40}\
${image $HOME/AccuW_2/Toronto/last_7.png -p 205,265 -s 67x40}

          ${execpi 600 sed -n '23p' $HOME/AccuW_2/Toronto/first_days}°\
${goto 180}${execpi 600 sed -n '4p' $HOME/AccuW_2/Toronto/last_days}°\
${goto 283}${execpi 600 sed -n '9p' $HOME/AccuW_2/Toronto/last_days}°
          ${execpi 600 sed -n '24p' $HOME/AccuW_2/Toronto/first_days}°\
${goto 180}${execpi 600 sed -n '5p' $HOME/AccuW_2/Toronto/last_days}°\
${goto 283}${execpi 600 sed -n '10p' $HOME/AccuW_2/Toronto/last_days}°

   ${color1}${execpi 600 sed -n '11p' $HOME/AccuW_2/Toronto/last_days}\
            ${execpi 600 sed -n '16p' $HOME/AccuW_2/Toronto/last_days}\
            ${execpi 600 sed -n '21p' $HOME/AccuW_2/Toronto/last_days}${color}\
${image $HOME/AccuW_2/Toronto/last_12.png -p 0,330 -s 67x40}\
${image $HOME/AccuW_2/Toronto/last_17.png -p 105,330 -s 67x40}\
${image $HOME/AccuW_2/Toronto/last_22.png -p 205,330 -s 67x40}

          ${execpi 600 sed -n '14p' $HOME/AccuW_2/Toronto/last_days}°\
${goto 180}${execpi 600 sed -n '19p' $HOME/AccuW_2/Toronto/last_days}°\
${goto 283}${execpi 600 sed -n '24p' $HOME/AccuW_2/Toronto/last_days}°
          ${execpi 600 sed -n '15p' $HOME/AccuW_2/Toronto/last_days}°\
${goto 180}${execpi 600 sed -n '20p' $HOME/AccuW_2/Toronto/last_days}°\
${goto 283}${execpi 600 sed -n '25p' $HOME/AccuW_2/Toronto/last_days}°

 ${font WenQuanYi Micro Hei Mono:bold:size=8}${color0}STRESS TEST ${color1}${hr}${color}

  CPU0:${goto 70}${color1}${cpubar cpu0}${goto 70}${color8}${cpubar cpu4}${goto 80}${color0}${cpu cpu0}%${color}${goto 190}CPU: ${hwmon 1 temp 1}°
  CPU1:${goto 70}${color1}${cpubar cpu1}${goto 70}${color8}${cpubar cpu4}${goto 80}${color0}${cpu cpu1}%${color}${goto 190}HDD: ${execpi 15 hddtemp -n /dev/sda} °
  CPU2:${goto 70}${color1}${cpubar cpu2}${goto 70}${color8}${cpubar cpu4}${goto 80}${color0}${cpu cpu2}%${color}${goto 190}M/B: ${hwmon 2 temp 1}°
  CPU3:${goto 70}${color1}${cpubar cpu3}${goto 70}${color8}${cpubar cpu4}${goto 80}${color0}${cpu cpu3}%${color}${goto 190}GPU: ${nvidia temp}°
   RAM:${goto 70}${color1}${membar}${goto 70}${color8}${cpubar cpu4}${goto 80}${color0}${memperc} %${color}${goto 190}${memmax}
   Fan: ${hwmon 2 fan 1} rpm

 ${color0}DISK ${color1}${hr}${color}
   ${color0}SDA: ${color}Read: ${diskio_read /dev/sda}${goto 190}Write: ${diskio_write /dev/sda}

 /Root:${goto 70}${color1}${fs_bar /}${goto 70}${color8}${cpubar cpu4}${goto 80}${color0}${fs_used_perc /} %${color}\
 ${goto 190}${fs_size /}
 /Home:${goto 70}${color1}${fs_bar /home}${goto 70}${color8}${cpubar cpu4}${goto 80}${color0}${fs_used_perc /home} %${color}\
${goto 190}${fs_size /home}
   M/5:${goto 70}${color1}${fs_bar /media/5}${goto 70}${color8}${cpubar cpu4}${color}${goto 80}${color0}${fs_used_perc /media/5} %${color}\
${goto 190}${fs_size /media/5}
   M/8:${goto 70}${color1}${fs_bar /media/8}${goto 70}${color8}${cpubar cpu4}${color}${goto 80}${color0}${fs_used_perc /media/8} %${color}\
${goto 190}${fs_size /media/8}
  Swap:${goto 70}${color1}${swapbar}${goto 70}${color8}${cpubar cpu4}${goto 80}${color0}${swapperc} %${color}${goto 190}${swapmax}

 ${color0}NETWORK ${color1}${cpubar cpu0 0,65} ${color}Up:${goto 190}${upspeedf eth0}
         ${color1}${cpubar cpu0 0,65} ${color}Dn:${goto 190}${downspeedf eth0}
 ${color0}Transfer Totals${color}
 ${color8}rx${goto 110}tx${goto 200}Total
 ${color0}Today:${color}
 ${execi 300 vnstat | grep "today" | awk '{print $2 $3}'}\
${goto 110}${execi 300 vnstat | grep "today" | awk '{print $5 $6}'}\
${goto 200}${execi 300 vnstat | grep "today" | awk '{print $8 $9}'}
 ${color0}Yesterday:${color}
 ${execi 300 vnstat | grep "yesterday" | awk '{print $2 $3}'}\
${goto 110}${execi 300 vnstat | grep "yesterday" | awk '{print $5 $6}'}\
${goto 200}${execi 300 vnstat | grep "yesterday" | awk '{print $8 $9}'}
 ${color0}Last Week:${color}
 ${execi 300 vnstat -w | grep "current week" | awk '{print $3 $4}'}\
${goto 110}${execi 300 vnstat -w | grep "current week" | awk '{print $6 $7}'}\
${goto 200}${execi 300 vnstat -w | grep "current week" | awk '{print $9 $10}'}
 ${color0}${time %B}:${color}
 ${execi 300 vnstat -m | grep "`date +"%b '%y"`" | awk '{print $3 $4}'}\
${goto 110}${execi 300 vnstat -m | grep "`date +"%b '%y"`" | awk '{print $6 $7}'}\
${goto 200}${execi 300 vnstat -m | grep "`date +"%b '%y"`" | awk '{print $9 $10}'}

acc_int_image

#!/bin/bash
#
#function: test_image_day
test_image_day () {
    case $1 in
         su)
           echo 1su
         ;;
         msu)
           echo 2msu
         ;;
         psu)
           echo 3psu
         ;;
         ic)
           echo 4ic
         ;;
         h)
           echo 5h
         ;;
         mc)
           echo 6mc
         ;;
         c)
           echo 7c
         ;;
         d)
           echo 8d
         ;;
         f)
           echo 9f
         ;;
         s)
           echo 10s
         ;;
         mcs)
           echo 11mcs
         ;;
         psus)
           echo 12psus
         ;;
         t)
           echo 13t
         ;;
         mct)
           echo 14mct
         ;;
         psut)
           echo 15psut
         ;;
         r)
           echo 16r
         ;;
         fl)
           echo 17fl
         ;;
         mcfl)
           echo 18mcfl
         ;;
         psfl)
           echo 19psfl
         ;;
         sn)
           echo 20sn
         ;;
         mcsn)
           echo 21mcsn
         ;;
         i)
           echo 22i
         ;;
         sl)
           echo 23sl
         ;;
         fr)
           echo 24fr
         ;;
         rsn)
           echo 25rsn
         ;;
         w)
           echo 26w
         ;;
         ho)
           echo 27ho
         ;;
         co)
           echo 28co
         ;;
         cl)
           echo 29cl
         ;;
         mcl)
           echo 31mcl
         ;;
         pc)
           echo 32pc
         ;;
         pcs)
           echo 36pcs
         ;;
         pct)
           echo 38pct
         ;;
        esac
}

#function: test_image_night
test_image_night () {
    case $1 in
         su)
           echo 1su
         ;;
         msu)
           echo 2msu
         ;;
         psu)
           echo 3psu
         ;;
         c)
           echo 7c
         ;;
         d)
           echo 8d
         ;;
         f)
           echo 9f
         ;;
         s)
           echo 10s
         ;;
         psus)
           echo 12psus
         ;;
         t)
           echo 13t
         ;;
         psut)
           echo 15psut
         ;;
         r)
           echo 16r
         ;;
         fl)
           echo 17fl
         ;;
         psfl)
           echo 19psfl
         ;;
         sn)
           echo 20sn
         ;;
         i)
           echo 22i
         ;;
         sl)
           echo 23sl
         ;;
         fr)
           echo 24fr
         ;;
         rsn)
           echo 25rsn
         ;;
         ho)
           echo 27ho
         ;;
         co)
           echo 28co
         ;;
         cl)
           echo 29cl
         ;;
         w)
           echo 30w
         ;;
         mcl)
           echo 31mcl
         ;;
         pc)
           echo 32pc
         ;;
         ic)
           echo 33ic
         ;;
         h)
           echo 34h
         ;;
         mc)
           echo 35mc
         ;;
         pcs)
           echo 36pcs
         ;;
         mcs)
           echo 37mcs
         ;;
         pct)
           echo 38pct
         ;;
         mct)
           echo 39mct
         ;;
         mcfl)
           echo 40mcfl
         ;;
         mcsn)
           echo 41mcsn
         ;;
        esac
}


#put your Accuweather address here
 address="http://www.accuweather.com/en/ar/buenos-aires/7894/weather-forecast/7894"


loc_id=$(echo $address|sed 's/\/weather-forecast.*$//'|sed 's/^.*\///')
last_number=$(echo $address|sed 's/^.*\///')

curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$last_number"

addr1="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"
addr2="$addr1"?day=6

kill -STOP $(pidof conky)
killall wget

wget --save-cookies $HOME/AccuW_2/Toronto/cookie -O $HOME/AccuW_2/Toronto/curr_cond_raw $curr_addr
wget --load-cookies $HOME/AccuW_2/Toronto/cookie -O $HOME/AccuW_2/Toronto/first_days_raw $addr1
wget --load-cookies $HOME/AccuW_2/Toronto/cookie -O $HOME/AccuW_2/Toronto/last_days_raw $addr2

#Current Conditions - curr_cond file
if [[ -s $HOME/AccuW_2/Toronto/curr_cond_raw ]]; then

    egrep -i '"detail-tab-panel |>Today<\/a>|>Tonight<\/a>|>Early AM<\/a>|>Overnight<\/a>|>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|var d = '\''|var s = '\''|Humidity: |Pressure: |Cloud Cover: |UV Index: |Dew Point: |Precipitation(1 hr): |Visibility: |am<\/span>|pm<\/span>' $HOME/AccuW_2/Toronto/curr_cond_raw > $HOME/AccuW_2/Toronto/curr_cond
    sed -i -e 's/^[ \t]*//g' -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' -e 's/>Lo</\n/g' -e 's/RealFeel/\n/g' $HOME/AccuW_2/Toronto/curr_cond
    sed -i -e 's/^.*"#">//g' -e 's/^.*<strong class="temp"//g' -e 's/^>//g' -e 's/<span>&deg.*$//g' $HOME/AccuW_2/Toronto/curr_cond
    sed -i -e 's/<\/a>.*$//g' -e 's/\/span> //g' -e 's/var d = //g' -e 's/var s = //g' -e 's/"temp">/\n/g' $HOME/AccuW_2/Toronto/curr_cond
    sed -i -e 's/^.*"start">//g' -e 's/^.*"finish">//g' -e 's/<li>//g' -e 's/<strong>//g' -e 's/<<span.*$//g' $HOME/AccuW_2/Toronto/curr_cond
    sed -i -e 's/<\/span>//g' -e 's/<\/strong><\/li>//g' -e 's/ "><\/div>//g' -e 's/'\''//g' $HOME/AccuW_2/Toronto/curr_cond
    sed -i -e 's/"><\/div>//g' -e 's/^.*; //g' -e 's/&#.*$//g' -e 's/ i-alarm.*$//g' -e 's/;//g' $HOME/AccuW_2/Toronto/curr_cond
    sed -i -e 's/Humidity: //g' -e 's/Pressure: //g' -e 's/Cloud Cover: //g' -e 's/UV Index: //g' -e 's/Dew Point: //g' -e 's/Visibility: //g' $HOME/AccuW_2/Toronto/curr_cond
    sed -i -e 's/^.*detail-tab-panel //g' -e 's/">//g' -e 's/\r//g' -e 's/ *$//g' $HOME/AccuW_2/Toronto/curr_cond
    time=$(sed -n 1p $HOME/AccuW_2/Toronto/curr_cond)
    if [[ $time == Tonight || $time == Overnight || $time == "Early AM" ]]; then
        sed -i 3a- $HOME/AccuW_2/Toronto/curr_cond
    fi
    time=$(sed -n 26p $HOME/AccuW_2/Toronto/curr_cond)
    image=$(sed -n 27p $HOME/AccuW_2/Toronto/curr_cond)
    if [[ $time == day ]]; then
        sed -i 27s/$image/$(test_image_day $image)/ $HOME/AccuW_2/Toronto/curr_cond
    elif [[ $time == night ]]; then
        sed -i 27s/$image/$(test_image_night $image)/ $HOME/AccuW_2/Toronto/curr_cond
    fi
    cp $HOME/AccuW_2/Toronto/Forecast_Images/$(sed -n 27p $HOME/AccuW_2/Toronto/curr_cond).png $HOME/AccuW_2/Toronto/cc.png
fi


#First 5days - first_days file
if [[ -s $HOME/AccuW_2/Toronto/first_days_raw ]]; then

    egrep -i '>Today<|<p>[a-z]|>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|realfeel">RealFeel|realfeel">Precipitation' $HOME/AccuW_2/Toronto/first_days_raw > $HOME/AccuW_2/Toronto/first_days
    sed -i -e 's/^[ \t]*//g' -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' -e 's/>Lo</\n/g' $HOME/AccuW_2/Toronto/first_days
    sed -i -e 's/ "><\/div>//g' -e 's/"><\/div>//g' -e 's/^.*"temp">//g' -e 's/<span>&deg.*$//g' $HOME/AccuW_2/Toronto/first_days
    sed -i -e 's/<p>//g' -e 's/<\/p>//g' -e 's/^.*"#">//g' -e 's/\/span> //g' -e 's/^.*>Precipitation //g' -e 's/^.*; //g' $HOME/AccuW_2/Toronto/first_days
    sed -i -e 's/&#.*$//g' -e 's/<.*$//g' -e 's/ i-alarm.*$//g' -e 's/\r//g' -e 's/ *$//g' $HOME/AccuW_2/Toronto/first_days
    sed -i -e 's/Today/TODAY/' -e 's/Mon/Mon/' -e 's/Tue/Tue/' -e 's/Wed/Wed/' -e 's/Thu/Thu/' -e 's/Fri/Fri/' -e 's/Sat/Sat/' -e 's/Sun/Sun/' $HOME/AccuW_2/Toronto/first_days
    time=$(sed -n 1p $HOME/AccuW_2/Toronto/curr_cond)
    if [[ $time == Tonight || $time == Overnight || $time == "Early AM" ]]; then
        sed -i 2a- $HOME/AccuW_2/Toronto/first_days
    fi
    L1=$(sed -n 1p $HOME/AccuW_2/Toronto/first_days)
    if [[ $L1 == TODAY ]]; then
        sed -i 1d $HOME/AccuW_2/Toronto/first_days
    fi
    for (( i=6; i<=21; i+=5 ))
      do
          image_raw=$(sed -n "${i}"p $HOME/AccuW_2/Toronto/first_days)
          sed -i ${i}s/$image_raw/$(test_image_day $image_raw)/ $HOME/AccuW_2/Toronto/first_days
          cp $HOME/AccuW_2/Toronto/Forecast_Images/$(sed -n ${i}p $HOME/AccuW_2/Toronto/first_days).png $HOME/AccuW_2/Toronto/$i.png
      done
    image_raw=$(sed -n 25p $HOME/AccuW_2/Toronto/first_days)
    sed -i 25s/$image_raw/$(test_image_day $image_raw)/ $HOME/AccuW_2/Toronto/first_days
    cp $HOME/AccuW_2/Toronto/Forecast_Images/$(sed -n 25p $HOME/AccuW_2/Toronto/first_days).png $HOME/AccuW_2/Toronto/tod.png
    image_raw=$(sed -n 30p $HOME/AccuW_2/Toronto/first_days)
    sed -i 30s/$image_raw/$(test_image_day $image_raw)/ $HOME/AccuW_2/Toronto/first_days
    cp $HOME/AccuW_2/Toronto/Forecast_Images/$(sed -n 30p $HOME/AccuW_2/Toronto/first_days).png $HOME/AccuW_2/Toronto/ton.png

fi


#Last 5days - last_days file
if [[ -s $HOME/AccuW_2/Toronto/last_days_raw ]]; then

    egrep -i '>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|realfeel">RealFeel|realfeel">Precipitation' $HOME/AccuW_2/Toronto/last_days_raw > $HOME/AccuW_2/Toronto/last_days
    sed -i -e 's/^[ \t]*//g' -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' -e 's/>Lo</\n/g' $HOME/AccuW_2/Toronto/last_days
    sed -i -e 's/ "><\/div>//g' -e 's/"><\/div>//g' -e 's/^.*"temp">//g' -e 's/<span>&deg.*$//g' $HOME/AccuW_2/Toronto/last_days
    sed -i -e 's/^.*"#">//g' -e 's/\/span> //g' -e 's/^.*>Precipitation //g' -e 's/^.*; //g' $HOME/AccuW_2/Toronto/last_days
    sed -i -e 's/&#.*$//g' -e 's/<.*$//g' -e 's/ i-alarm.*$//g' -e 's/\r//g' -e 's/ *$//g' $HOME/AccuW_2/Toronto/last_days
    sed -i -e 's/Mon/Mon/' -e 's/Tue/Tue/' -e 's/Wed/Wed/' -e 's/Thu/Thu/' -e 's/Fri/Fri/' -e 's/Sat/Sat/' -e 's/Sun/Sun/' $HOME/AccuW_2/Toronto/last_days
    for (( i=2; i<=22; i+=5 ))
      do
          image_raw=$(sed -n "${i}"p $HOME/AccuW_2/Toronto/last_days)
          sed -i ${i}s/$image_raw/$(test_image_day $image_raw)/ $HOME/AccuW_2/Toronto/last_days
          cp $HOME/AccuW_2/Toronto/Forecast_Images/$(sed -n ${i}p $HOME/AccuW_2/Toronto/last_days).png $HOME/AccuW_2/Toronto/last_$i.png
      done

fi

#messages file
sed -n 28p $HOME/AccuW_2/Toronto/curr_cond | cut -c -20 > $HOME/AccuW_2/Toronto/messages
sed -n 29p $HOME/AccuW_2/Toronto/first_days | cut -c -20 >> $HOME/AccuW_2/Toronto/messages
sed -n 34p $HOME/AccuW_2/Toronto/first_days | cut -c -20 >> $HOME/AccuW_2/Toronto/messages
for (( i=7; i<=22; i+=5 ))
  do
      sed -n ${i}p $HOME/AccuW_2/Toronto/first_days | cut -c -20 >> $HOME/AccuW_2/Toronto/messages
  done
for (( i=3; i<=23; i+=5 ))
  do
      sed -n ${i}p $HOME/AccuW_2/Toronto/last_days | cut -c -20 >> $HOME/AccuW_2/Toronto/messages
  done

kill -CONT $(pidof conky)

Offline

#1283 2012-05-18 15:06:05

ElderV.LaCoste
#! Die Hard
From: Equarico
Registered: 2010-07-15
Posts: 781

Re: The New Monster Conky Thread

@ S11 - Thanks S11.  I tried that but somehow it didn't work.  I'll give it another try and post the Lua code.

[edit]  Ok, here is what it looks like now: 

2012_05_18_1337357395_204x677_scrot.jpg

and this is the Lua code:

function conky_widgets()
    if conky_window == nil then return end
    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    
--    cr = cairo_create(cs)
--    air_clock(cr, 120, 120, 200) -- options: xc, yc, size
--    cairo_destroy(cr)
    
    cr = cairo_create(cs)
    ring(cr, 'cpu', 'CPU0', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 200, 50, 10, 0, 180) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    cairo_destroy(cr)
    
    cr = cairo_create(cs)
    ring(cr, 'memperc', '', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 300, 50, 10, 180, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    cairo_destroy(cr)    
    
    cr = cairo_create(cs)
    ring(cr, 'fs_used_perc', '/', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 400, 50, 10, 0, 180) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    cairo_destroy(cr)
    
--    cr = cairo_create(cs)
--    ring(cr, 'battery_percent', 'BAT1', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 500, 50, 10, 180, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
--    cairo_destroy(cr)
    
    cr = cairo_create(cs)
    ring(cr, 'fs_used_perc', '/home', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 500, 50, 10, 180, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    cairo_destroy(cr)
    
    cr = cairo_create(cs)
    ring(cr, 'wireless_bitrate wlan0', ' ', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 600, 50, 10, 0, 180) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    cairo_destroy(cr)
    
    cr = cairo_create(cs)
    ring(cr, 'wireless_link_qual_perc wlan0', ' ', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 700, 50, 10, 180, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    cairo_destroy(cr)
end

Last edited by ElderV.LaCoste (2012-05-18 16:14:52)


Proceed with confidence!
http://eldervlacoste.deviantart.com/

Offline

#1284 2012-05-18 16:19:41

tedbell
#! Junkie
Registered: 2012-05-08
Posts: 311

Re: The New Monster Conky Thread

Sector11 wrote:
tedbell wrote:

Can anyone help me resize this weather script? I'm new to this conky stuff and tried to get the original stuff in conkyrc in the new conky with this script but it won't show up at all. Looking also to add a digital clock and sensors. smile

Hello again tedbell ....

How stuck are you on that conky script you have that uses jbaseb's script?

I can get you up an running with a Teo script, a digital clock and calendar and sensors no problem at all.

first if you don't have it: install 'lm-sensors' and run:

sudo sensors-detect

Use the default answers except for that last one - say YES!

Check for PM - upper right hand corner of the page: messages

Hi,
PM sent and I installed and ran the program.

Offline

#1285 2012-05-18 16:21:26

tedbell
#! Junkie
Registered: 2012-05-08
Posts: 311

Re: The New Monster Conky Thread

Sector11 wrote:

@ tedbell - check your message (top right of page)

Not knowing exactly what you want (still working on the other code - it a huge job) I came up with this as a fill in...

aazaJywZ.jpg

Mind you it is set for my system that's why the message
The conky:

## killall conky && conky -c ~/AccuW_2/accuw.Toronto.conky &
# 1e_Accuweather_USA_Images script by TeoBigusGeekus
# http://crunchbanglinux.org/forums/post/212605/
###  Begin Window Settings  ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes

# Use the Xdbe extension? (eliminates flicker)
# It is highly recommended to use own window with this one
# so double buffer won't be so big.
double_buffer yes

own_window_type normal #override
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
# own_window_colour #4d4d4d
own_window_class Accuweather International
own_window_title Accuweather International

### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
### This option will not work as desired (in most cases) in conjunction with
### own_window_type override
# own_window_argb_visual yes

### When ARGB visuals are enabled, this use this to modify the alpha value
### Use: own_window_type normal
### Use: own_window_transparent no
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
#own_window_argb_value 150

minimum_size 310 0 ## width, height
maximum_width 310  ## width, usually a good idea to equal minimum width

gap_x 10 ### left &right
gap_y 10 ### up & down

alignment top_right
####################################################  End Window Settings  ###
###  Font Settings  ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Anonymous Pro:bold:size=9

# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 0
# Force UTF8? requires XFT ###
override_utf8_locale yes

draw_shades yes #no #### <<<--- To see it easier on light screens.
#default_shade_color black

draw_outline yes #no #### <<<--- Amplifies text if yes
default_outline_color black

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
default_shade_color gray
default_outline_color black

default_color DCDCDC #Gainsboro
color0 ffe595 #Teo Gold
color1 778899 #LightSlateGrey
color2 FF8C00 #Darkorange
color3 7FFF00 #Chartreuse
color4 FFA07A #LightSalmon
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 00FFFF #Cyan #48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red  #A52A2A #DarkRed
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 5
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################

# Boolean value, if true, Conky will be forked to background when started.
background no

# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer right

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 256

# Subtract (file system) buffers from used memory?
no_buffers yes

# change GiB to G and MiB to M
short_units yes

# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

#   Maximum size of user text buffer, i.e. layout below TEXT line in config file
#  (default is 16384 bytes)
# max_user_text 16384

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load ~/Conky/LUA/draw-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
#lua_load ~/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.5
#
#######################################################  End LUA Settings  ###

# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1

## ${image ~/Conky/images/red_1.png -p 0,15 -s 67x40}
## ${image ~/Conky/images/red_1.png -p 165,52 -s 125x75}
## $HOME/AccuW_2/Toronto/acc_int_images

default_bar_size 100 12

# stuff after 'TEXT' will be formatted on screen
TEXT
${color0}${time %d %b %Y} ${color1}--${color0} Toronto, ON ${color1}--${color0} ${time %T}${color}\
${texeci 500 bash $HOME/AccuW_2/Toronto/acc_int_images}\
${image $HOME/AccuW_2/Toronto/cc.png -p 200,15 -s 67x40}
${execpi 600 sed -n '1p' $HOME/AccuW_2/Toronto/messages}
${font Dumbledor 1 Cut Up:size=20} Now ${execpi 600 sed -n '29p' $HOME/AccuW_2/Toronto/curr_cond}${goto 120}FL ${execpi 600 sed -n '30p' $HOME/AccuW_2/Toronto/curr_cond}${font}

${color0}Wind:  ${color}${execpi 600 sed -n '31p' $HOME/AccuW_2/Toronto/curr_cond} ${execpi 600 sed -n '32p' $HOME/AccuW_2/Toronto/curr_cond}\
         ${color0}Today      Tonight${color}
${color0}Hum:   ${color}${execpi 600 sed -n '33p' $HOME/AccuW_2/Toronto/curr_cond}\
${goto 170}${color6}${execpi 600 sed -n '26p' $HOME/AccuW_2/Toronto/first_days}${color}\
${goto 210}${color9}${execpi 600 sed -n '27p' $HOME/AccuW_2/Toronto/first_days}${color}\
${goto 245}${color6}${execpi 600 sed -n '32p' $HOME/AccuW_2/Toronto/first_days}${color}\
${goto 290}${color9}${execpi 600 sed -n '31p' $HOME/AccuW_2/Toronto/first_days}${color}
${color0}Bar:   ${color}${execpi 600 sed -n '34p' $HOME/AccuW_2/Toronto/curr_cond}\
${image $HOME/AccuW_2/Toronto/tod.png -p 160,90 -s 67x40}\
${image $HOME/AccuW_2/Toronto/ton.png -p 240,90 -s 67x40}
${color0}Cloud: ${color}${execpi 600 sed -n '35p' $HOME/AccuW_2/Toronto/curr_cond}
${color0}UVI:   ${color}${execpi 600 sed -n '36p' $HOME/AccuW_2/Toronto/curr_cond}
${color0}Vis:   ${color}${execpi 600 sed -n '38p' $HOME/AccuW_2/Toronto/curr_cond}
${color0}DP:    ${color}${execpi 600 sed -n '37p' $HOME/AccuW_2/Toronto/curr_cond}°
 ${color0}Sunrise: ${color}${execpi 600 sed -n '39p' $HOME/AccuW_2/Toronto/curr_cond}\
${goto 160}${color0} Sunset: ${color}${execpi 600 sed -n '40p' $HOME/AccuW_2/Toronto/curr_cond}
${color0}Moonrise: ${color}${execpi 600 sed -n '41p' $HOME/AccuW_2/Toronto/curr_cond}\
${goto 160}${color0}Moonset: ${color}${execpi 600 sed -n '42p' $HOME/AccuW_2/Toronto/curr_cond}
   ${color1}${execpi 600 sed -n '5p' $HOME/AccuW_2/Toronto/first_days}\
            ${execpi 600 sed -n '10p' $HOME/AccuW_2/Toronto/first_days}\
            ${execpi 600 sed -n '15p' $HOME/AccuW_2/Toronto/first_days}${color}\
${image $HOME/AccuW_2/Toronto/6.png -p 0,200 -s 67x40}\
${image $HOME/AccuW_2/Toronto/11.png -p 105,200 -s 67x40}\
${image $HOME/AccuW_2/Toronto/16.png -p 205,200 -s 67x40}

          ${execpi 600 sed -n '8p' $HOME/AccuW_2/Toronto/first_days}°\
${goto 180}${execpi 600 sed -n '13p' $HOME/AccuW_2/Toronto/first_days}°\
${goto 283}${execpi 600 sed -n '18p' $HOME/AccuW_2/Toronto/first_days}°
          ${execpi 600 sed -n '9p' $HOME/AccuW_2/Toronto/first_days}°\
${goto 180}${execpi 600 sed -n '14p' $HOME/AccuW_2/Toronto/first_days}°\
${goto 283}${execpi 600 sed -n '19p' $HOME/AccuW_2/Toronto/first_days}°

   ${color1}${execpi 600 sed -n '20p' $HOME/AccuW_2/Toronto/first_days}\
            ${execpi 600 sed -n '1p' $HOME/AccuW_2/Toronto/last_days}\
            ${execpi 600 sed -n '6p' $HOME/AccuW_2/Toronto/last_days}${color}\
${image $HOME/AccuW_2/Toronto/21.png -p 0,265 -s 67x40}\
${image $HOME/AccuW_2/Toronto/last_2.png -p 105,265 -s 67x40}\
${image $HOME/AccuW_2/Toronto/last_7.png -p 205,265 -s 67x40}

          ${execpi 600 sed -n '23p' $HOME/AccuW_2/Toronto/first_days}°\
${goto 180}${execpi 600 sed -n '4p' $HOME/AccuW_2/Toronto/last_days}°\
${goto 283}${execpi 600 sed -n '9p' $HOME/AccuW_2/Toronto/last_days}°
          ${execpi 600 sed -n '24p' $HOME/AccuW_2/Toronto/first_days}°\
${goto 180}${execpi 600 sed -n '5p' $HOME/AccuW_2/Toronto/last_days}°\
${goto 283}${execpi 600 sed -n '10p' $HOME/AccuW_2/Toronto/last_days}°

   ${color1}${execpi 600 sed -n '11p' $HOME/AccuW_2/Toronto/last_days}\
            ${execpi 600 sed -n '16p' $HOME/AccuW_2/Toronto/last_days}\
            ${execpi 600 sed -n '21p' $HOME/AccuW_2/Toronto/last_days}${color}\
${image $HOME/AccuW_2/Toronto/last_12.png -p 0,330 -s 67x40}\
${image $HOME/AccuW_2/Toronto/last_17.png -p 105,330 -s 67x40}\
${image $HOME/AccuW_2/Toronto/last_22.png -p 205,330 -s 67x40}

          ${execpi 600 sed -n '14p' $HOME/AccuW_2/Toronto/last_days}°\
${goto 180}${execpi 600 sed -n '19p' $HOME/AccuW_2/Toronto/last_days}°\
${goto 283}${execpi 600 sed -n '24p' $HOME/AccuW_2/Toronto/last_days}°
          ${execpi 600 sed -n '15p' $HOME/AccuW_2/Toronto/last_days}°\
${goto 180}${execpi 600 sed -n '20p' $HOME/AccuW_2/Toronto/last_days}°\
${goto 283}${execpi 600 sed -n '25p' $HOME/AccuW_2/Toronto/last_days}°

 ${font WenQuanYi Micro Hei Mono:bold:size=8}${color0}STRESS TEST ${color1}${hr}${color}

  CPU0:${goto 70}${color1}${cpubar cpu0}${goto 70}${color8}${cpubar cpu4}${goto 80}${color0}${cpu cpu0}%${color}${goto 190}CPU: ${hwmon 1 temp 1}°
  CPU1:${goto 70}${color1}${cpubar cpu1}${goto 70}${color8}${cpubar cpu4}${goto 80}${color0}${cpu cpu1}%${color}${goto 190}HDD: ${execpi 15 hddtemp -n /dev/sda} °
  CPU2:${goto 70}${color1}${cpubar cpu2}${goto 70}${color8}${cpubar cpu4}${goto 80}${color0}${cpu cpu2}%${color}${goto 190}M/B: ${hwmon 2 temp 1}°
  CPU3:${goto 70}${color1}${cpubar cpu3}${goto 70}${color8}${cpubar cpu4}${goto 80}${color0}${cpu cpu3}%${color}${goto 190}GPU: ${nvidia temp}°
   RAM:${goto 70}${color1}${membar}${goto 70}${color8}${cpubar cpu4}${goto 80}${color0}${memperc} %${color}${goto 190}${memmax}
   Fan: ${hwmon 2 fan 1} rpm

 ${color0}DISK ${color1}${hr}${color}
   ${color0}SDA: ${color}Read: ${diskio_read /dev/sda}${goto 190}Write: ${diskio_write /dev/sda}

 /Root:${goto 70}${color1}${fs_bar /}${goto 70}${color8}${cpubar cpu4}${goto 80}${color0}${fs_used_perc /} %${color}\
 ${goto 190}${fs_size /}
 /Home:${goto 70}${color1}${fs_bar /home}${goto 70}${color8}${cpubar cpu4}${goto 80}${color0}${fs_used_perc /home} %${color}\
${goto 190}${fs_size /home}
   M/5:${goto 70}${color1}${fs_bar /media/5}${goto 70}${color8}${cpubar cpu4}${color}${goto 80}${color0}${fs_used_perc /media/5} %${color}\
${goto 190}${fs_size /media/5}
   M/8:${goto 70}${color1}${fs_bar /media/8}${goto 70}${color8}${cpubar cpu4}${color}${goto 80}${color0}${fs_used_perc /media/8} %${color}\
${goto 190}${fs_size /media/8}
  Swap:${goto 70}${color1}${swapbar}${goto 70}${color8}${cpubar cpu4}${goto 80}${color0}${swapperc} %${color}${goto 190}${swapmax}

 ${color0}NETWORK ${color1}${cpubar cpu0 0,65} ${color}Up:${goto 190}${upspeedf eth0}
         ${color1}${cpubar cpu0 0,65} ${color}Dn:${goto 190}${downspeedf eth0}
 ${color0}Transfer Totals${color}
 ${color8}rx${goto 110}tx${goto 200}Total
 ${color0}Today:${color}
 ${execi 300 vnstat | grep "today" | awk '{print $2 $3}'}\
${goto 110}${execi 300 vnstat | grep "today" | awk '{print $5 $6}'}\
${goto 200}${execi 300 vnstat | grep "today" | awk '{print $8 $9}'}
 ${color0}Yesterday:${color}
 ${execi 300 vnstat | grep "yesterday" | awk '{print $2 $3}'}\
${goto 110}${execi 300 vnstat | grep "yesterday" | awk '{print $5 $6}'}\
${goto 200}${execi 300 vnstat | grep "yesterday" | awk '{print $8 $9}'}
 ${color0}Last Week:${color}
 ${execi 300 vnstat -w | grep "current week" | awk '{print $3 $4}'}\
${goto 110}${execi 300 vnstat -w | grep "current week" | awk '{print $6 $7}'}\
${goto 200}${execi 300 vnstat -w | grep "current week" | awk '{print $9 $10}'}
 ${color0}${time %B}:${color}
 ${execi 300 vnstat -m | grep "`date +"%b '%y"`" | awk '{print $3 $4}'}\
${goto 110}${execi 300 vnstat -m | grep "`date +"%b '%y"`" | awk '{print $6 $7}'}\
${goto 200}${execi 300 vnstat -m | grep "`date +"%b '%y"`" | awk '{print $9 $10}'}

acc_int_image

#!/bin/bash
#
#function: test_image_day
test_image_day () {
    case $1 in
         su)
           echo 1su
         ;;
         msu)
           echo 2msu
         ;;
         psu)
           echo 3psu
         ;;
         ic)
           echo 4ic
         ;;
         h)
           echo 5h
         ;;
         mc)
           echo 6mc
         ;;
         c)
           echo 7c
         ;;
         d)
           echo 8d
         ;;
         f)
           echo 9f
         ;;
         s)
           echo 10s
         ;;
         mcs)
           echo 11mcs
         ;;
         psus)
           echo 12psus
         ;;
         t)
           echo 13t
         ;;
         mct)
           echo 14mct
         ;;
         psut)
           echo 15psut
         ;;
         r)
           echo 16r
         ;;
         fl)
           echo 17fl
         ;;
         mcfl)
           echo 18mcfl
         ;;
         psfl)
           echo 19psfl
         ;;
         sn)
           echo 20sn
         ;;
         mcsn)
           echo 21mcsn
         ;;
         i)
           echo 22i
         ;;
         sl)
           echo 23sl
         ;;
         fr)
           echo 24fr
         ;;
         rsn)
           echo 25rsn
         ;;
         w)
           echo 26w
         ;;
         ho)
           echo 27ho
         ;;
         co)
           echo 28co
         ;;
         cl)
           echo 29cl
         ;;
         mcl)
           echo 31mcl
         ;;
         pc)
           echo 32pc
         ;;
         pcs)
           echo 36pcs
         ;;
         pct)
           echo 38pct
         ;;
        esac
}

#function: test_image_night
test_image_night () {
    case $1 in
         su)
           echo 1su
         ;;
         msu)
           echo 2msu
         ;;
         psu)
           echo 3psu
         ;;
         c)
           echo 7c
         ;;
         d)
           echo 8d
         ;;
         f)
           echo 9f
         ;;
         s)
           echo 10s
         ;;
         psus)
           echo 12psus
         ;;
         t)
           echo 13t
         ;;
         psut)
           echo 15psut
         ;;
         r)
           echo 16r
         ;;
         fl)
           echo 17fl
         ;;
         psfl)
           echo 19psfl
         ;;
         sn)
           echo 20sn
         ;;
         i)
           echo 22i
         ;;
         sl)
           echo 23sl
         ;;
         fr)
           echo 24fr
         ;;
         rsn)
           echo 25rsn
         ;;
         ho)
           echo 27ho
         ;;
         co)
           echo 28co
         ;;
         cl)
           echo 29cl
         ;;
         w)
           echo 30w
         ;;
         mcl)
           echo 31mcl
         ;;
         pc)
           echo 32pc
         ;;
         ic)
           echo 33ic
         ;;
         h)
           echo 34h
         ;;
         mc)
           echo 35mc
         ;;
         pcs)
           echo 36pcs
         ;;
         mcs)
           echo 37mcs
         ;;
         pct)
           echo 38pct
         ;;
         mct)
           echo 39mct
         ;;
         mcfl)
           echo 40mcfl
         ;;
         mcsn)
           echo 41mcsn
         ;;
        esac
}


#put your Accuweather address here
 address="http://www.accuweather.com/en/ar/buenos-aires/7894/weather-forecast/7894"


loc_id=$(echo $address|sed 's/\/weather-forecast.*$//'|sed 's/^.*\///')
last_number=$(echo $address|sed 's/^.*\///')

curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$last_number"

addr1="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"
addr2="$addr1"?day=6

kill -STOP $(pidof conky)
killall wget

wget --save-cookies $HOME/AccuW_2/Toronto/cookie -O $HOME/AccuW_2/Toronto/curr_cond_raw $curr_addr
wget --load-cookies $HOME/AccuW_2/Toronto/cookie -O $HOME/AccuW_2/Toronto/first_days_raw $addr1
wget --load-cookies $HOME/AccuW_2/Toronto/cookie -O $HOME/AccuW_2/Toronto/last_days_raw $addr2

#Current Conditions - curr_cond file
if [[ -s $HOME/AccuW_2/Toronto/curr_cond_raw ]]; then

    egrep -i '"detail-tab-panel |>Today<\/a>|>Tonight<\/a>|>Early AM<\/a>|>Overnight<\/a>|>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|var d = '\''|var s = '\''|Humidity: |Pressure: |Cloud Cover: |UV Index: |Dew Point: |Precipitation(1 hr): |Visibility: |am<\/span>|pm<\/span>' $HOME/AccuW_2/Toronto/curr_cond_raw > $HOME/AccuW_2/Toronto/curr_cond
    sed -i -e 's/^[ \t]*//g' -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' -e 's/>Lo</\n/g' -e 's/RealFeel/\n/g' $HOME/AccuW_2/Toronto/curr_cond
    sed -i -e 's/^.*"#">//g' -e 's/^.*<strong class="temp"//g' -e 's/^>//g' -e 's/<span>&deg.*$//g' $HOME/AccuW_2/Toronto/curr_cond
    sed -i -e 's/<\/a>.*$//g' -e 's/\/span> //g' -e 's/var d = //g' -e 's/var s = //g' -e 's/"temp">/\n/g' $HOME/AccuW_2/Toronto/curr_cond
    sed -i -e 's/^.*"start">//g' -e 's/^.*"finish">//g' -e 's/<li>//g' -e 's/<strong>//g' -e 's/<<span.*$//g' $HOME/AccuW_2/Toronto/curr_cond
    sed -i -e 's/<\/span>//g' -e 's/<\/strong><\/li>//g' -e 's/ "><\/div>//g' -e 's/'\''//g' $HOME/AccuW_2/Toronto/curr_cond
    sed -i -e 's/"><\/div>//g' -e 's/^.*; //g' -e 's/&#.*$//g' -e 's/ i-alarm.*$//g' -e 's/;//g' $HOME/AccuW_2/Toronto/curr_cond
    sed -i -e 's/Humidity: //g' -e 's/Pressure: //g' -e 's/Cloud Cover: //g' -e 's/UV Index: //g' -e 's/Dew Point: //g' -e 's/Visibility: //g' $HOME/AccuW_2/Toronto/curr_cond
    sed -i -e 's/^.*detail-tab-panel //g' -e 's/">//g' -e 's/\r//g' -e 's/ *$//g' $HOME/AccuW_2/Toronto/curr_cond
    time=$(sed -n 1p $HOME/AccuW_2/Toronto/curr_cond)
    if [[ $time == Tonight || $time == Overnight || $time == "Early AM" ]]; then
        sed -i 3a- $HOME/AccuW_2/Toronto/curr_cond
    fi
    time=$(sed -n 26p $HOME/AccuW_2/Toronto/curr_cond)
    image=$(sed -n 27p $HOME/AccuW_2/Toronto/curr_cond)
    if [[ $time == day ]]; then
        sed -i 27s/$image/$(test_image_day $image)/ $HOME/AccuW_2/Toronto/curr_cond
    elif [[ $time == night ]]; then
        sed -i 27s/$image/$(test_image_night $image)/ $HOME/AccuW_2/Toronto/curr_cond
    fi
    cp $HOME/AccuW_2/Toronto/Forecast_Images/$(sed -n 27p $HOME/AccuW_2/Toronto/curr_cond).png $HOME/AccuW_2/Toronto/cc.png
fi


#First 5days - first_days file
if [[ -s $HOME/AccuW_2/Toronto/first_days_raw ]]; then

    egrep -i '>Today<|<p>[a-z]|>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|realfeel">RealFeel|realfeel">Precipitation' $HOME/AccuW_2/Toronto/first_days_raw > $HOME/AccuW_2/Toronto/first_days
    sed -i -e 's/^[ \t]*//g' -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' -e 's/>Lo</\n/g' $HOME/AccuW_2/Toronto/first_days
    sed -i -e 's/ "><\/div>//g' -e 's/"><\/div>//g' -e 's/^.*"temp">//g' -e 's/<span>&deg.*$//g' $HOME/AccuW_2/Toronto/first_days
    sed -i -e 's/<p>//g' -e 's/<\/p>//g' -e 's/^.*"#">//g' -e 's/\/span> //g' -e 's/^.*>Precipitation //g' -e 's/^.*; //g' $HOME/AccuW_2/Toronto/first_days
    sed -i -e 's/&#.*$//g' -e 's/<.*$//g' -e 's/ i-alarm.*$//g' -e 's/\r//g' -e 's/ *$//g' $HOME/AccuW_2/Toronto/first_days
    sed -i -e 's/Today/TODAY/' -e 's/Mon/Mon/' -e 's/Tue/Tue/' -e 's/Wed/Wed/' -e 's/Thu/Thu/' -e 's/Fri/Fri/' -e 's/Sat/Sat/' -e 's/Sun/Sun/' $HOME/AccuW_2/Toronto/first_days
    time=$(sed -n 1p $HOME/AccuW_2/Toronto/curr_cond)
    if [[ $time == Tonight || $time == Overnight || $time == "Early AM" ]]; then
        sed -i 2a- $HOME/AccuW_2/Toronto/first_days
    fi
    L1=$(sed -n 1p $HOME/AccuW_2/Toronto/first_days)
    if [[ $L1 == TODAY ]]; then
        sed -i 1d $HOME/AccuW_2/Toronto/first_days
    fi
    for (( i=6; i<=21; i+=5 ))
      do
          image_raw=$(sed -n "${i}"p $HOME/AccuW_2/Toronto/first_days)
          sed -i ${i}s/$image_raw/$(test_image_day $image_raw)/ $HOME/AccuW_2/Toronto/first_days
          cp $HOME/AccuW_2/Toronto/Forecast_Images/$(sed -n ${i}p $HOME/AccuW_2/Toronto/first_days).png $HOME/AccuW_2/Toronto/$i.png
      done
    image_raw=$(sed -n 25p $HOME/AccuW_2/Toronto/first_days)
    sed -i 25s/$image_raw/$(test_image_day $image_raw)/ $HOME/AccuW_2/Toronto/first_days
    cp $HOME/AccuW_2/Toronto/Forecast_Images/$(sed -n 25p $HOME/AccuW_2/Toronto/first_days).png $HOME/AccuW_2/Toronto/tod.png
    image_raw=$(sed -n 30p $HOME/AccuW_2/Toronto/first_days)
    sed -i 30s/$image_raw/$(test_image_day $image_raw)/ $HOME/AccuW_2/Toronto/first_days
    cp $HOME/AccuW_2/Toronto/Forecast_Images/$(sed -n 30p $HOME/AccuW_2/Toronto/first_days).png $HOME/AccuW_2/Toronto/ton.png

fi


#Last 5days - last_days file
if [[ -s $HOME/AccuW_2/Toronto/last_days_raw ]]; then

    egrep -i '>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|realfeel">RealFeel|realfeel">Precipitation' $HOME/AccuW_2/Toronto/last_days_raw > $HOME/AccuW_2/Toronto/last_days
    sed -i -e 's/^[ \t]*//g' -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' -e 's/>Lo</\n/g' $HOME/AccuW_2/Toronto/last_days
    sed -i -e 's/ "><\/div>//g' -e 's/"><\/div>//g' -e 's/^.*"temp">//g' -e 's/<span>&deg.*$//g' $HOME/AccuW_2/Toronto/last_days
    sed -i -e 's/^.*"#">//g' -e 's/\/span> //g' -e 's/^.*>Precipitation //g' -e 's/^.*; //g' $HOME/AccuW_2/Toronto/last_days
    sed -i -e 's/&#.*$//g' -e 's/<.*$//g' -e 's/ i-alarm.*$//g' -e 's/\r//g' -e 's/ *$//g' $HOME/AccuW_2/Toronto/last_days
    sed -i -e 's/Mon/Mon/' -e 's/Tue/Tue/' -e 's/Wed/Wed/' -e 's/Thu/Thu/' -e 's/Fri/Fri/' -e 's/Sat/Sat/' -e 's/Sun/Sun/' $HOME/AccuW_2/Toronto/last_days
    for (( i=2; i<=22; i+=5 ))
      do
          image_raw=$(sed -n "${i}"p $HOME/AccuW_2/Toronto/last_days)
          sed -i ${i}s/$image_raw/$(test_image_day $image_raw)/ $HOME/AccuW_2/Toronto/last_days
          cp $HOME/AccuW_2/Toronto/Forecast_Images/$(sed -n ${i}p $HOME/AccuW_2/Toronto/last_days).png $HOME/AccuW_2/Toronto/last_$i.png
      done

fi

#messages file
sed -n 28p $HOME/AccuW_2/Toronto/curr_cond | cut -c -20 > $HOME/AccuW_2/Toronto/messages
sed -n 29p $HOME/AccuW_2/Toronto/first_days | cut -c -20 >> $HOME/AccuW_2/Toronto/messages
sed -n 34p $HOME/AccuW_2/Toronto/first_days | cut -c -20 >> $HOME/AccuW_2/Toronto/messages
for (( i=7; i<=22; i+=5 ))
  do
      sed -n ${i}p $HOME/AccuW_2/Toronto/first_days | cut -c -20 >> $HOME/AccuW_2/Toronto/messages
  done
for (( i=3; i<=23; i+=5 ))
  do
      sed -n ${i}p $HOME/AccuW_2/Toronto/last_days | cut -c -20 >> $HOME/AccuW_2/Toronto/messages
  done

kill -CONT $(pidof conky)

looks great! is there a way to get a huge desktop clock? also can I change to fonts? And excuse my ignorance but does the first part go into conkyrc? Which file does the second code go into?

Last edited by tedbell (2012-05-18 16:23:02)

Offline

#1286 2012-05-18 17:13:21

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 819

Re: The New Monster Conky Thread

ElderV.LaCoste wrote:

Can anyone point me to how to get the wireless speed and wireless quality into a ring meter?  I found this:

${wireless_bitrate wlan0}
${wireless_link_qual_perc wlan0}%

but how to get them to show up in the ring meter has been confounding me.  I am messing around with Londonali's Conky Widgets and this is my complete ripoff version of her setup: 

2012_05_18_1337346552_1366x768_scrot.jpg

I would like to add a couple more rings showing the above mentioned items.  I might have to lose a couple of the FS rings.

${wireless_bitrate wlan0} returns values like "54 Mb/s" not "54", you will need to strip off the " Mb/s" so the ring script can calculate how much of the ring should be filled in.
I don't know how to do that in lua, the bitrate changes value so you can't just take the first X characters of the output.
Maybe someone with more lua experience can help you.

Last edited by arclance (2012-05-18 17:22:24)

Offline

#1287 2012-05-18 17:18:56

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,419
Website

Re: The New Monster Conky Thread

tedbell wrote:

looks great! is there a way to get a huge desktop clock? also can I change to fonts? And excuse my ignorance but does the first part go into conkyrc? Which file does the second code go into?

That second file (also included in the attached archive) is used by the conky file, it is a separate file.

Download and extract this to you home directory: Toronto.tar.gz
- it will create ~/AccuW_2 and in there the file: accuw.Toronto.conky
- also included is a ZIP with the Anonymous Pro Font used in the conky.

Start the conky in a terminal, or add it to your autostart file:

conky -c ~/AccuW_2/accuw.Toronto.conky &

It is designed to use the fonts Anonymous Pro (included) and 'WenQuanYi Micro Hei Mono'
That font is in the repos: grab the two wqy fonts:

sudo apt-get install ttf-wqy*

They are really nice fonts.

BUT - yes you can change the fonts, you will have a problem with spacing though, especially in the weather.  And if you change the size to something larger might will run off the bottom of your screen

If you really want a font change tell me what you'd like.  Keep in mind spacing it critical and I 'suggest' a mono font.  I'll look at it.

Clock ... You want a digital clock like ackernan has a few pages back or an analog clock?

Easy to do either way.

Any questions I'm here.

OH You will get errors if:

1. you have less than 3 cores.
2. you do not have partitions: /media/5 and /media/8

I can send you a real 24 hour analog clock:
aaf0buG5.jpg

Last edited by Sector11 (2012-05-18 17:28:35)

Offline

#1288 2012-05-18 17:31:09

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,419
Website

Re: The New Monster Conky Thread

arclance wrote:

${wireless_bitrate wlan0} returns values like "54 Mb/s" not "54", you will need to strip off the " Mb/s" so the ring script can calculate how much of the ring should be filled in.
I don't know how to do that in lua, the bitrate changes value so you can't just take the first X characters of the output.
Maybe someone with more lua experience can help you.

OOPS! {face} Not knowing how wireless things work I never even though of that.

Thanks arclance

Offline

#1289 2012-05-18 17:43:21

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 819

Re: The New Monster Conky Thread

Sector11 wrote:
arclance wrote:

${wireless_bitrate wlan0} returns values like "54 Mb/s" not "54", you will need to strip off the " Mb/s" so the ring script can calculate how much of the ring should be filled in.
I don't know how to do that in lua, the bitrate changes value so you can't just take the first X characters of the output.
Maybe someone with more lua experience can help you.

OOPS! {face} Not knowing how wireless things work I never even though of that.

Thanks arclance

Your welcome, I wish I knew more about working with strings in lua so I could help more.

ElderV.LaCoste wrote:
ring(cr, 'wireless_bitrate wlan0', ' ', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 600, 50, 10, 0, 180) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle

You will also need to change the max value for the ring to the max speed of your wireless card since bitrate is not a percent value.

Offline

#1290 2012-05-18 17:52:27

ElderV.LaCoste
#! Die Hard
From: Equarico
Registered: 2010-07-15
Posts: 781

Re: The New Monster Conky Thread

@ Arclance - Thanks for that it makes perfect sense.  I searched to see if I could find another Conky that has incorporated this into the "rings" Lua and so far no success.  I don't know Lua but I can copy/paste.  lol

@ S11 -  Your face is pinkish but here's me:   {face}   Even if we don't come up with the answer right away you are always there giving it your best shot so thanks for that!

@Arclance - I am looking up my wireless card now to find the maximum speed:

lspci | grep Wireless
00:0b.0 Ethernet controller: Marvell Technology Group Ltd. 88w8335 [Libertas] 802.11b/g Wireless (rev 03)

Last edited by ElderV.LaCoste (2012-05-18 18:06:45)


Proceed with confidence!
http://eldervlacoste.deviantart.com/

Offline

#1291 2012-05-18 17:58:07

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 819

Re: The New Monster Conky Thread

ElderV.LaCoste wrote:

@ Arclance - Thanks for that it makes perfect sense.  I searched to see if I could find another Conky that has incorporated this into the "rings" Lua and so far no success.  I don't know Lua but I can copy/paste.  lol

I looked up how to work with strings in lua.
If you post the code that actually draws the ring I think I can modify it to work with ${wireless_bitrate}.

Offline

#1292 2012-05-18 18:14:33

ElderV.LaCoste
#! Die Hard
From: Equarico
Registered: 2010-07-15
Posts: 781

Re: The New Monster Conky Thread

@Arclance - Thanks for your help.  I am thinking that a lot of other people will appreciate this too.  By the way where did you read about working with strings in Lua?  I would like to take a look at it and who knows, maybe something will sink in.  Anyway here is the whole Lua script:

--[[
Conky Widgets by londonali1010 (2009)

This script is meant to be a "shell" to hold a suite of widgets for use in Conky.

To configure:
+ Copy the widget's code block (will be framed by --(( WIDGET NAME )) and --(( END WIDGET NAME )), with "[" instead of "(") somewhere between "require 'cairo'" and "function conky_widgets()", ensuring not to paste into another widget's code block
+ To call the widget, add the following just before the last "end" of the entire script:
    cr = cairo_create(cs)
    NAME_OF_FUNCTION(cr, OPTIONS)
    cairo_destroy(cr)
+ Replace OPTIONS with the options for your widget (should be specified in the widget's code block) 

Call this script in Conky using the following before TEXT (assuming you save this script to ~/scripts/conky_widgets.lua):
    lua_load ~/scripts/conky_widgets.lua
    lua_draw_hook_pre widgets
    
Changelog:
+ v1.0 -- Original release (17.10.2009)
]]

require 'cairo'

--[[ RING WIDGET ]]
--[[ Options (name, arg, max, bg_colour, bg_alpha, xc, yc, radius, thickness, start_angle, end_angle):
    "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
    "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
    "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
    "bg_colour" is the colour of the base ring.
    "bg_alpha" is the alpha value of the base ring.
    "fg_colour" is the colour of the indicator part of the ring.
    "fg_alpha" is the alpha value of the indicator part of the ring.
    "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
    "radius" is the radius of the ring.
    "thickness" is the thickness of the ring, centred around the radius.
    "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
    "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger (e.g. more clockwise) than start_angle. ]]

function ring(cr, name, arg, max, bgc, bga, fgc, fga, xc, yc, r, t, sa, ea)
    local function rgb_to_r_g_b(colour,alpha)
        return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end
    
    local function draw_ring(pct)
        local angle_0=sa*(2*math.pi/360)-math.pi/2
        local angle_f=ea*(2*math.pi/360)-math.pi/2
        local pct_arc=pct*(angle_f-angle_0)

        -- Draw background ring

        cairo_arc(cr,xc,yc,r,angle_0,angle_f)
        cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
        cairo_set_line_width(cr,t)
        cairo_stroke(cr)
    
        -- Draw indicator ring

        cairo_arc(cr,xc,yc,r,angle_0,angle_0+pct_arc)
        cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
        cairo_stroke(cr)
    end
    
    local function setup_ring()
        local str = ''
        local value = 0
        
        str = string.format('${%s %s}', name, arg)
        str = conky_parse(str)
        
        value = tonumber(str)
        if value == nil then value = 0 end
        pct = value/max
        
        draw_ring(pct)
    end    
    
    local updates=conky_parse('${updates}')
    update_num=tonumber(updates)
    
    if update_num>5 then setup_ring() end
end

--[[ END RING WIDGET ]]

function conky_widgets()
    if conky_window == nil then return end
    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    
--    cr = cairo_create(cs)
--    air_clock(cr, 120, 120, 200) -- options: xc, yc, size
--    cairo_destroy(cr)
    
    cr = cairo_create(cs)
    ring(cr, 'cpu', 'CPU0', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 200, 50, 10, 0, 180) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    cairo_destroy(cr)
    
    cr = cairo_create(cs)
    ring(cr, 'memperc', '', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 300, 50, 10, 180, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    cairo_destroy(cr)    
    
    cr = cairo_create(cs)
    ring(cr, 'fs_used_perc', '/', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 400, 50, 10, 0, 180) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    cairo_destroy(cr)
    
--    cr = cairo_create(cs)
--    ring(cr, 'battery_percent', 'BAT1', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 500, 50, 10, 180, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
--    cairo_destroy(cr)
    
    cr = cairo_create(cs)
    ring(cr, 'fs_used_perc', '/home', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 500, 50, 10, 180, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    cairo_destroy(cr)
    
    cr = cairo_create(cs)
    ring(cr, 'wireless_bitrate', 'wlan0', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 600, 50, 10, 0, 180) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    cairo_destroy(cr)
    
    cr = cairo_create(cs)
    ring(cr, 'wireless_link_qual_perc', 'net', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 700, 50, 10, 180, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    cairo_destroy(cr)
end



Here is the .conkyrc I am using:

# -- Conky settings -- #
background no
update_interval 1

cpu_avg_samples 2
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
imlib_cache_size 0

# -- Window specifications -- #

own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below

border_inner_margin 0
border_outer_margin 0

minimum_size 1000 800
maximum_width 1000

alignment tr
gap_x 5
gap_y -40

# -- Graphics settings -- #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

# -- Text settings -- #
use_xft yes
xftfont sans:size=12
xftalpha 0.8

uppercase no

default_color grey75

# -- Lua Load -- #
lua_load ~/.conky/air_clock/conky_widgets.lua
lua_draw_hook_pre widgets

TEXT

${goto 880}${voffset 170}CPU ${cpu}%
${alignr 28}${voffset 80}MEM ${memperc}%
${goto 868}${voffset 80}FS /R ${fs_used_perc /root}%
${alignr 30}${voffset 80}FS /H ${fs_used_perc /home}%
${goto 845}${voffset 80}Spd ${wireless_bitrate wlan0}
${alignr 30}${voffset 80}Qual ${wireless_link_qual_perc wlan0}%

Last edited by ElderV.LaCoste (2012-05-18 18:17:06)


Proceed with confidence!
http://eldervlacoste.deviantart.com/

Offline

#1293 2012-05-18 18:38:54

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 819

Re: The New Monster Conky Thread

ElderV.LaCoste wrote:

@Arclance - Thanks for your help.  I am thinking that a lot of other people will appreciate this too.  By the way where did you read about working with strings in Lua?  I would like to take a look at it and who knows, maybe something will sink in.  Anyway here is the whole Lua script:

I read about working with strings in lua here.
Here is the script you posted with the ring function modified to work with ${wireless_bitrate}

To configure:
+ Copy the widget's code block (will be framed by --(( WIDGET NAME )) and --(( END WIDGET NAME )), with "[" instead of "(") somewhere between "require 'cairo'" and "function conky_widgets()", ensuring not to paste into another widget's code block
+ To call the widget, add the following just before the last "end" of the entire script:
    cr = cairo_create(cs)
    NAME_OF_FUNCTION(cr, OPTIONS)
    cairo_destroy(cr)
+ Replace OPTIONS with the options for your widget (should be specified in the widget's code block) 

Call this script in Conky using the following before TEXT (assuming you save this script to ~/scripts/conky_widgets.lua):
    lua_load ~/scripts/conky_widgets.lua
    lua_draw_hook_pre widgets
    
Changelog:
+ v1.0 -- Original release (17.10.2009)
]]

require 'cairo'

--[[ RING WIDGET ]] -- added support for wireless_bitrate (arclance 2012-05-18)
--[[ Options (name, arg, max, bg_colour, bg_alpha, xc, yc, radius, thickness, start_angle, end_angle):
    "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
    "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
    "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
    "bg_colour" is the colour of the base ring.
    "bg_alpha" is the alpha value of the base ring.
    "fg_colour" is the colour of the indicator part of the ring.
    "fg_alpha" is the alpha value of the indicator part of the ring.
    "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
    "radius" is the radius of the ring.
    "thickness" is the thickness of the ring, centred around the radius.
    "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
    "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger (e.g. more clockwise) than start_angle. ]]

function ring(cr, name, arg, max, bgc, bga, fgc, fga, xc, yc, r, t, sa, ea)
    local function rgb_to_r_g_b(colour,alpha)
        return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end
    
    local function draw_ring(pct)
        local angle_0=sa*(2*math.pi/360)-math.pi/2
        local angle_f=ea*(2*math.pi/360)-math.pi/2
        local pct_arc=pct*(angle_f-angle_0)

        -- Draw background ring

        cairo_arc(cr,xc,yc,r,angle_0,angle_f)
        cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
        cairo_set_line_width(cr,t)
        cairo_stroke(cr)
    
        -- Draw indicator ring

        cairo_arc(cr,xc,yc,r,angle_0,angle_0+pct_arc)
        cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
        cairo_stroke(cr)
    end
    
    local function setup_ring()
        local str = ''
        local value = 0
        
        str = string.format('${%s %s}', name, arg)
        str = conky_parse(str)
        if name == "wireless_bitrate" then
            value = tonumber(string.sub(str,0,-6))
        else
            value = tonumber(str)
        end -- if name == "wireless_bitrate"
        
        if value == nil then value = 0 end
        pct = value/max
        
        draw_ring(pct)
    end    
    
    local updates=conky_parse('${updates}')
    update_num=tonumber(updates)
    
    if update_num>5 then setup_ring() end
end

--[[ END RING WIDGET ]]

function conky_widgets()
    if conky_window == nil then return end
    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
   
--    cr = cairo_create(cs)
--    air_clock(cr, 120, 120, 200) -- options: xc, yc, size
--    cairo_destroy(cr)
    
    cr = cairo_create(cs)
    ring(cr, 'cpu', 'CPU0', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 200, 50, 10, 0, 180) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    cairo_destroy(cr)
    
    cr = cairo_create(cs)
    ring(cr, 'memperc', '', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 300, 50, 10, 180, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    cairo_destroy(cr)    
    
    cr = cairo_create(cs)
    ring(cr, 'fs_used_perc', '/', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 400, 50, 10, 0, 180) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    cairo_destroy(cr)
    
--    cr = cairo_create(cs)
--    ring(cr, 'battery_percent', 'BAT1', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 500, 50, 10, 180, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
--    cairo_destroy(cr)
    
    cr = cairo_create(cs)
    ring(cr, 'fs_used_perc', '/home', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 500, 50, 10, 180, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    cairo_destroy(cr)

    cr = cairo_create(cs)
    ring(cr, 'wireless_bitrate', 'wlan0', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 600, 50, 10, 0, 180) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    cairo_destroy(cr)
   
    cr = cairo_create(cs)
    ring(cr, 'wireless_link_qual_perc', 'net', 100, 0xFFFFFF, 0.2, 0xFFFFFF, 0.8, 920, 700, 50, 10, 180, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    cairo_destroy(cr)

end

I changed

    local function setup_ring()
        local str = ''
        local value = 0
        
        str = string.format('${%s %s}', name, arg)
        str = conky_parse(str)

        value = tonumber(str)
        if value == nil then value = 0 end
        pct = value/max
        
        draw_ring(pct)
    end   

to

    local function setup_ring()
        local str = ''
        local value = 0
        
        str = string.format('${%s %s}', name, arg)
        str = conky_parse(str)
        if name == "wireless_bitrate" then
            value = tonumber(string.sub(str,0,-6))
        else
            value = tonumber(str)
        end -- if name == "wireless_bitrate"
        
        if value == nil then value = 0 end
        pct = value/max
        
        draw_ring(pct)
    end    

It works on my computer.
Just set the max value to the speed of your wireless card so the ring fills to the correct position.

Last edited by arclance (2012-05-18 18:48:31)

Offline

#1294 2012-05-18 18:52:13

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,419
Website

Re: The New Monster Conky Thread

arclance wrote:

It works on my computer.
Just set the max value to the speed of your wireless card so the ring fills to the correct position.

YES!!!!!!!!!!!!!
And another conky problem bites the dust!

There's soooooooo many things I can't test.  sad

Offline

#1295 2012-05-18 18:56:18

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,419
Website

Re: The New Monster Conky Thread

ElderV.LaCoste wrote:

@ S11 -  Your face is pinkish but here's me:   {face}   Even if we don't come up with the answer right away you are always there giving it your best shot so thanks for that!

@Arclance

I do my best - I didn't think about the added extra text.  Live and learn.
But now I have a working example to refer to thank's to you, for asking, and arclance for answering.

Hmmmmmmmmm Conky PitStop material?  Might do well there.

Offline

#1296 2012-05-18 19:06:07

ElderV.LaCoste
#! Die Hard
From: Equarico
Registered: 2010-07-15
Posts: 781

Re: The New Monster Conky Thread

Wow, that was fast!  It works on my computer too.  Thanks so much for doing that and for the link to the info on strings.  I will see if I can figure out the other one with this information.  smile


Proceed with confidence!
http://eldervlacoste.deviantart.com/

Offline

#1297 2012-05-18 19:07:07

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,419
Website

Re: The New Monster Conky Thread

arclance wrote:
Sector11 wrote:

Thanks arclance

Your welcome, I wish I knew more about working with strings in lua so I could help more.

Hey a 'tid-bit' here a 'tid-bit' there and before you know it the whole cake shows up.

Chocolate hopefully! lol

And you just gave Gentleman Elder a really HUGE slice!

Last edited by Sector11 (2012-05-18 19:08:10)

Offline

#1298 2012-05-18 19:12:10

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,419
Website

Re: The New Monster Conky Thread

@ Elder and arclance ... and all other interested parties

Let's not forget mrpeachys HOW TO : using lua scripts in conky

Last edited by Sector11 (2012-05-18 19:12:28)

Offline

#1299 2012-05-18 19:22:49

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 9,703
Website

Re: The New Monster Conky Thread

^ Right...

mrpeachy and wlourf are the lua gods whose creativity and wealth of knowledge is incredible


VSIDO
If you build it, they will come...
Words That Build Or Destroy

Offline

Be excellent to each other!

#1300 2012-05-18 19:32:18

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,419
Website

Re: The New Monster Conky Thread

VastOne wrote:

^ Right...

mrpeachy and wlourf are the lua gods whose creativity and wealth of knowledge is incredible

+1 and +1 on that!

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.

Debian Logo