SEARCH

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

You are not logged in.

#5676 2013-07-07 10:47:43

Rutz
#! Member
Registered: 2012-12-26
Posts: 87

Re: Conky v1.9 Thread

pvsage wrote:
Rutz wrote:

Hey Guys.

I have some problems with the alignment. Just look:

Solution #1: Just give gap_x and gap_y other values

So...did "Solution #1" work, or was that the first thing you tried, and it didn't help?


Yeah it worked. You just have to play around a bit with the figures.


while :; do eject -T; sleep 5; done
Unreliable Cup Holder

Offline

Help fund CrunchBang, donate to the project!

#5677 2013-07-07 13:14:35

micq
New Member
From: Serbia
Registered: 2013-07-06
Posts: 7

Re: Conky v1.9 Thread

Simple conky script...
du3p.th.png
Code:

# conky configuration
#
# The list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.
#
# For ideas about how to modify conky, please see:
# http://crunchbanglinux.org/forums/topic/59/my-conky-config/
#
# For help with conky, please see:
# http://crunchbanglinux.org/forums/topic/2047/conky-help/
#
# Enjoy! :)
##############################################
# Settings
##############################################
background yes
use_xft yes
xftfont Liberation Sans:size=9
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type desktop
#own_window_argb_visual yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 200 600
maximum_width 240
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color 656667
default_shade_color 000000
default_outline_color 828282
alignment top_right
gap_x 12
gap_y 56
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no
##############################################
#  Output
##############################################
TEXT

S Y S T E M    I N F O
${hr}
Date:$alignr${time %a,} ${time %e %B %G}
Host:$alignr$nodename - $machine
Kern:$alignr$sysname - $kernel
Uptime:$alignr$uptime
Battery:$alignr${battery}

C P U    &    M E M O R Y
${hr}
RAM:$alignr$mem/$memmax
Swap usage:$alignr$swap/$swapmax
Disk usage:$alignr${fs_used /}/${fs_size /}
CPU usage:$alignr${cpu cpu0}%
CPU temperature:$alignr${acpitemp}C
CPU frequency:$alignr$freq MHz

N E T W O R K
${hr}
WiFi Addres:$alignr${addr wlan0}
SSID:$alignr${wireless_essid wlan0}
Signal Strength:$alignr${wireless_link_qual wlan0}%
Up Speed:$alignr${upspeedf wlan0}KB/s
Total Upload:$alignr${totalup wlan0}
Down Speed:$alignr${downspeedf wlan0}KB/s
Total Download:$alignr${totaldown wlan0}

S H O R T C U T    K E Y S
${hr}
Alt+F2$alignr Run Dialog
Alt+F3$alignr Alt Menu
Super+Space$alignr Main Menu
Super+Tab$alignr Client Menu
Super+m$alignr Media Player
Super+h$alignr Task Manager
Super+l$alignr Lock Screen
Super+v$alignr Volume Control
Super+x$alignr Logout
PrtSc$alignr Screenshot

Nothing is what it seems...

Offline

#5678 2013-07-07 14:17:39

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

Re: Conky v1.9 Thread

Rutz wrote:
Sector11 wrote:
Rutz wrote:

Hey Guys.

I have some problems with the alignment. Just look:

Solution #1: Just give gap_x and gap_y other values

At a loss here, can you post the entire conky please.

Pasted it in


OK,,, I'm off for most of the day,  a locro family day, Inodoro Pereyra will know what that is.

Took a quick look and you have errors above TEXT - some conflicting lines repeated  ...  and it crashed here once so I used one of my old conkys (above TEXT) with what seemed to be the settings you wanted and cleaned up some stuff below TEXT.

This works as advertised, no errors at all.:

# killall conky && conky -c /media/5/conky/Rutz.conky &
# conky configuration
#
# The list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.
#
# For ideas about how to modify conky, please see:
# http://crunchbanglinux.org/forums/topic/59/my-conky-config/
#
# For help with conky, please see:
# http://crunchbanglinux.org/forums/topic/2047/conky-help/
#
# Enjoy! :)
##############################################
# Settings
## Conky
background no

# Window
own_window yes
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_class Conky
own_window_title Rutz

# Graphics
double_buffer yes
use_spacer right # yes is NOT an option - left right or none
override_utf8_locale yes
use_xft yes
xftfont Liberation Mono:style=Bold:size=10
xftalpha 1.0
update_interval 1
uppercase no  # set to yes if you want all text to be in uppercase
stippled_borders 0
border_inner_margin 0
border_width 0

default_color ffffff
default_shade_color 000000
default_outline_color 828282
draw_borders no
draw_graph_borders no
draw_outline no  # amplifies text if yes
draw_shades no  # shadecolor black

# Colors
#default_color DCDCDC #Gainsboro
default_color ffffff
color0 FFFFF0 #Ivory
color1 FFA07A #LightSalmon
color2 FF8C00 #Darkorange
color3 7FFF00 #Chartreuse
color4 778899 #LightSlateGrey
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
#	colours below used by colorize script
color7 48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red

#text_buffer_size 256 # is minimum
no_buffers yes  # Subtract file system buffers from used memory?
short_units yes
pad_percents 2

# Layout
alignment mr  # Aligned position on screen: tl, tr, tm, bl, br, bm, ml, mr
gap_x 10 # l|r
gap_y 00 # u|d

#imlib_cache_size 0
minimum_size 185 0
maximum_width 185


TEXT

${voffset 2}${color 33B22B}${font}SYSTEM ${hr 1}
${color acacac}Date:${color 757575}${alignr}${time %b %d %Y}
${color acacac}Uptime:${color 757575}${alignr}${uptime}

${color acacac}CPU:${color 757575}${alignr}${cpu}%
${color 0FFF00}${alignc}${cpubar 3,120}

${color acacac}Ram:${color 757575}${alignr}${mem}
${color 0FFF00}${alignc}${membar 3,120}

${color 33B22B}NETWORK ${hr 1}
${color acacac}Up:${color 757575}${alignr}${upspeed eth0}
${color acacac}Total: ${color 757575}${alignr}${totalup eth0}

${color acacac}Down:${color 757575}${alignr}${downspeed eth0}
${color acacac}Total: ${color 757575}${alignr}${totaldown eth0}

${color acacac}Local IP:${color 757575}${alignr}${addr}
${color acacac}Public IP: ${color 757575}${alignr}${execi 1800 /etc/conky/publicip.sh}

${color 33B22B}DISK ${hr 1}
${color acacac}Disk Usage:${color 757575}
${color 0FFF00}${alignc}${fs_bar 3,120}
${color acacac}Total:     ${color 757575}${alignr}${fs_size /}
${color acacac}Used:      ${color 757575}${alignr}${fs_free /home}
${color acacac}Free:      ${color 757575}${alignr}${fs_used /home}

${color acacac}Swap:    ${color 757575}${alignr}${swap}
${color 0FFF00}${alignc}${swapbar 3,120}

2013_07_07_11_07_43_1920x1080_Sector11.jpg


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

Offline

#5679 2013-07-07 14:58:03

Inodoro Pereyra
#! Die Hard
From: Back in Buenos Aires
Registered: 2013-07-01
Posts: 844

Re: Conky v1.9 Thread

Thank you Dk75 for the reply. smile

dk75 wrote:

Dunno.
Show result of

cat /etc/default/hddtemp

bernardo@Bernardo:~$ cat /etc/default/hddtemp
# Defaults for hddtemp initscript (/etc/init.d/hddtemp)
# This is a POSIX shell fragment

# [automatically edited by postinst, do not change line format ]

# hddtemp network daemon switch. If set to true, hddtemp will listen
# for incoming connections.
RUN_DAEMON="true"

# List of devices you want to use with hddtemp. If none specified,
# hddtemp will probe standard devices.
#DISKS="/dev/hda"

# List of devices you want to use with hddtemp, but that would not be
# probed for a working sensor.
DISKS_NOPROBE=""

# IP address of the interface on which you want hddtemp to be bound
# on. If none specified, goes to 127.0.0.1. Use 0.0.0.0 to bind hddtemp
# on all interfaces.
INTERFACE="127.0.0.1"

# Port number on which you want hddtemp to listen on. If none specified,
# the port 7634 is used.
PORT="7634"

# Database file to use. If none specified, /etc/hddtemp.db is used.
#DATABASE="/etc/hddtemp.db"

# Separator to use between fields. The default separator is '|'.
#SEPARATOR="|"

# Logging period (in seconds) for the temperatures. If set to a value
# different than 0, hddtemp will run as a daemon periodically logging
# the temperatures through syslog
RUN_SYSLOG="0"

# Other options to pass to hddtemp
OPTIONS=""
bernardo@Bernardo:~$ 

I see that under "List of devices you want to use", it says "/dev/hda", instead of "/dev/sda". Is that the problem?

dk75 wrote:

None.
You just parse data fetched from either Conky or shell.

Thanks. Will look it up. smile

dk75 wrote:

What system we talking about?
Is it laptop maybe? If yes, what manufacturer?

Also, show output of shell command

sensors

and

ls -lAh /sys/class/hwmon/*/

PS: Crunchnbang forum is a nighmare for a post formatting and editing

Sorry. Yes, it's a laptop. Acer Aspire 5733-6800.

Here's sensors:

bernardo@Bernardo:~$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +46.0°C  (high = +80.0°C, crit = +90.0°C)
Core 2:       +44.0°C  (high = +80.0°C, crit = +90.0°C)

bernardo@Bernardo:~$ 

...and ls -lAh /sys/class/hwmon/*/:

bernardo@Bernardo:~$ ls -lAh /sys/class/hwmon/*/
total 0
lrwxrwxrwx 1 root root    0 Jul  7 11:33 device -> ../../../coretemp.0
drwxr-xr-x 2 root root    0 Jul  7 11:49 power
lrwxrwxrwx 1 root root    0 Jul  7 11:49 subsystem -> ../../../../../class/hwmon
-rw-r--r-- 1 root root 4.0K Jul  7 11:49 uevent
bernardo@Bernardo:~$ 

Offline

#5680 2013-07-07 15:26:29

Rutz
#! Member
Registered: 2012-12-26
Posts: 87

Re: Conky v1.9 Thread

@Sector11

This works. Thank you very much!


while :; do eject -T; sleep 5; done
Unreliable Cup Holder

Offline

#5681 2013-07-07 15:37:30

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

Re: Conky v1.9 Thread

@inodoro

try -

sensors | awk '/Core 0/ {gsub(/\+/,"",$3); gsub(/\..+/,"",$3); print $3}'

to get the temperature for your cpu's

and I also have the N/A issue with hddtemp; to solve it, I usually have to call the hddtemp binary with the full path and not use the conky internal hddtemp-

${execpi 60 /usr/bin/hddtemp -n /dev/sda}

Last edited by PackRat (2013-07-07 15:38:06)


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

Offline

#5682 2013-07-07 15:59:38

Inodoro Pereyra
#! Die Hard
From: Back in Buenos Aires
Registered: 2013-07-01
Posts: 844

Re: Conky v1.9 Thread

PackRat wrote:

@inodoro

try -

sensors | awk '/Core 0/ {gsub(/\+/,"",$3); gsub(/\..+/,"",$3); print $3}'

to get the temperature for your cpu's

Thank you PackRat. smile
I already have that in my conky. That's working perfectly.
My problem is with lua. I'm using wlourf's bargraph lua to get bars for the cpu and hdd temps. How do I call the cpu temps in lua, for the bars to work?

PackRat wrote:

and I also have the N/A issue with hddtemp; to solve it, I usually have to call the hddtemp binary with the full path and not use the conky internal hddtemp-

${execpi 60 /usr/bin/hddtemp -n /dev/sda}

Thank you. That solved the N/A issue for the temp number. Now, the bargraph keeps going up and down. Any idea how to fix that?

Offline

#5683 2013-07-07 19:17:43

joshuar9476
Member
Registered: 2013-06-23
Posts: 35

Re: Conky v1.9 Thread

@dk75

since you simplified (at least length wise  big_smile ) the first line of my weather conky, would you mind fixing the rest of the weather lines?

here is what i have

${goto 40}${font CaviarDreams:size=50}${texeci 600 grep "yweather:condition" ~/.cache/conky/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°${font}${voffset -35}
${texeci 600 cp -f ~/.config/conky/conky-google-now/$(grep "yweather:condition" ~/.cache/conky/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*").png ~/.cache/conky/weather.png}${image ~/.cache/conky/weather.png -p 165,65 -s 60x60}${voffset 20}
${image ~/.config/conky/conky-google-now/wind.png -p 20,127 -s 15x15}${voffset 3}${goto 55}${texeci 600 grep "yweather:wind" ~/.cache/conky/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} ${texeci 600 grep "yweather:units" ~/.cache/conky/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} ${image ~/.config/conky/conky-google-now/humidity.png -p 190,130 -s 15x15}${voffset 3}${goto 220}${texeci 600 grep "yweather:atmosphere" ~/.cache/conky/weather.xml | grep -o "humidity=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} %${voffset 6}
${goto 25}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1' | tr '[a-z]' '[A-Z]'}${goto 75}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'}${goto 125}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3' | tr '[a-z]' '[A-Z]'}${goto 175}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4' | tr '[a-z]' '[A-Z]'}${goto 225}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5' | tr '[a-z]' '[A-Z]'}
${texeci 600 cp -f ~/.config/conky/conky-google-now/$(grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1').png ~/.cache/conky/weather-1.png}${image ~/.cache/conky/weather-1.png -p 15,168 -s 30x30}${texeci 600 cp -f ~/.config/conky/conky-google-now/$(grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png ~/.cache/conky/weather-2.png}${image ~/.cache/conky/weather-2.png -p 65,168 -s 30x30}${texeci 600 cp -f ~/.config/conky/conky-google-now/$(grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png ~/.cache/conky/weather-3.png}${image ~/.cache/conky/weather-3.png -p 115,168 -s 30x30}${texeci 600 cp -f ~/.config/conky/conky-google-now/$(grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4').png ~/.cache/conky/weather-4.png}${image ~/.cache/conky/weather-4.png -p 165,168 -s 30x30}${texeci 600 cp -f ~/.config/conky/conky-google-now/$(grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5').png ~/.cache/conky/weather-5.png}${image ~/.cache/conky/weather-5.png -p 215,168 -s 30x30}${voffset 20}
${goto 25}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${goto 75}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${goto 125}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${goto 175}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°${goto 225}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°
${goto 25}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${goto 75}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${goto 125}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${goto 175}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°${goto 225}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°

as i said, it works, but it might load quicker with less code.


Individuality: Always remember that you are unique. Just like everybody else.

Offline

#5684 2013-07-07 20:50:04

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

Re: Conky v1.9 Thread

Rutz wrote:

@Sector11

This works. Thank you very much!

You're welcome


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

Offline

#5685 2013-07-07 22:00:38

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

Re: Conky v1.9 Thread

joshuar9476 wrote:

@dk75

since you simplified (at least length wise  big_smile ) the first line of my weather conky, would you mind fixing the rest of the weather lines?

here is what i have

${goto 40}${font CaviarDreams:size=50}${texeci 600 grep "yweather:condition" ~/.cache/conky/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°${font}${voffset -35}
${texeci 600 cp -f ~/.config/conky/conky-google-now/$(grep "yweather:condition" ~/.cache/conky/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*").png ~/.cache/conky/weather.png}${image ~/.cache/conky/weather.png -p 165,65 -s 60x60}${voffset 20}
${image ~/.config/conky/conky-google-now/wind.png -p 20,127 -s 15x15}${voffset 3}${goto 55}${texeci 600 grep "yweather:wind" ~/.cache/conky/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} ${texeci 600 grep "yweather:units" ~/.cache/conky/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} ${image ~/.config/conky/conky-google-now/humidity.png -p 190,130 -s 15x15}${voffset 3}${goto 220}${texeci 600 grep "yweather:atmosphere" ~/.cache/conky/weather.xml | grep -o "humidity=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} %${voffset 6}
${goto 25}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1' | tr '[a-z]' '[A-Z]'}${goto 75}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'}${goto 125}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3' | tr '[a-z]' '[A-Z]'}${goto 175}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4' | tr '[a-z]' '[A-Z]'}${goto 225}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5' | tr '[a-z]' '[A-Z]'}
${texeci 600 cp -f ~/.config/conky/conky-google-now/$(grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1').png ~/.cache/conky/weather-1.png}${image ~/.cache/conky/weather-1.png -p 15,168 -s 30x30}${texeci 600 cp -f ~/.config/conky/conky-google-now/$(grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png ~/.cache/conky/weather-2.png}${image ~/.cache/conky/weather-2.png -p 65,168 -s 30x30}${texeci 600 cp -f ~/.config/conky/conky-google-now/$(grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png ~/.cache/conky/weather-3.png}${image ~/.cache/conky/weather-3.png -p 115,168 -s 30x30}${texeci 600 cp -f ~/.config/conky/conky-google-now/$(grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4').png ~/.cache/conky/weather-4.png}${image ~/.cache/conky/weather-4.png -p 165,168 -s 30x30}${texeci 600 cp -f ~/.config/conky/conky-google-now/$(grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5').png ~/.cache/conky/weather-5.png}${image ~/.cache/conky/weather-5.png -p 215,168 -s 30x30}${voffset 20}
${goto 25}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${goto 75}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${goto 125}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${goto 175}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°${goto 225}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°
${goto 25}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${goto 75}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${goto 125}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${goto 175}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°${goto 225}${texeci 600 grep "yweather:forecast" ~/.cache/conky/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°

as i said, it works, but it might load quicker with less code.

here you have
MAWK program (I've saved it to ~/.conky/conkyparts/weather.mawk and made it executable)

#!/usr/bin/mawk -f

BEGIN	\
{
	FS="\""
}



/yweather:location/	\
{
	location=$2
	region=$4
	country=$6
}

/yweather:condition/	\
{	
	condition=$2
	code=$4
	temp=$6
}

/yweather:wind/	\
{
	chill=$2
	direction=$4
	speed=$6
}

/yweather:units/	\
{
	tempU=$2
	distU=$4
	pressureU=$6
	speedU=$8
}

/yweather:atmosphere/	\
{
	humidity=$2
	visibility=$4
	pressure=$6
	rising=$8
}

/yweather:astronomy/	\
{
	sunrise=$2
	sunset=$4
}

/yweather:forecast/	\
{
	i++
	Fday[i]=$2
	Fdate[i]=$4
	Flow[i]=$6
	Fhigh[i]=$8
	Ftext[i]=$10
	Fcode[i]=$12
}



END	\
{	
	print "${alignc}${font CaviarDreams:style=Bold:size=12}"location" - "condition"${font}"
	print "${goto 40}${font CaviarDreams:size=50}"temp"°"tempU"${font}${voffset -35}"
	print "${image ~/.config/conky/conky-google-now/"code".png -p 165,65 -s 60x60}${voffset 20}"
	print "${image ~/.config/conky/conky-google-now/wind.png -p 20,127 -s 15x15}"\
		"${voffset 3}${goto 55}"speed" "speedU\
		" ${image ~/.config/conky/conky-google-now/humidity.png -p 190,130 -s 15x15}${voffset 3}${goto 220}"\
		humidity"%${voffset 6}"
	print "${goto 25}"Fday[1]\
		"${goto 75}"Fday[2]\
		"${goto 125}"Fday[3]\
		"${goto 175}"Fday[4]\
		"${goto 225}"Fday[5]
	print "${image ~/.config/conky/conky-google-now/"Fcode[1]".png -p 15,168 -s 30x30}"\
		"${image ~/.config/conky/conky-google-now/"Fcode[2]".png -p 65,168 -s 30x30}"\
		"${image ~/.config/conky/conky-google-now/"Fcode[3]".png -p 115,168 -s 30x30}"\
		"${image ~/.config/conky/conky-google-now/"Fcode[4]".png -p 165,168 -s 30x30}"\
		"${image ~/.config/conky/conky-google-now/"Fcode[5]".png -p 215,168 -s 30x30}"\
		"${voffset 20}"
	print "${goto 25}"Fhigh[1]"°"tempU\
		"${goto 75}"Fhigh[2]"°"tempU\
		"${goto 125}"Fhigh[3]"°"tempU\
		"${goto 175}"Fhigh[4]"°"tempU\
		"${goto 225}"Fhigh[5]"°"tempU
	print "${goto 25}"Flow[1]"°"tempU\
		"${goto 75}"Flow[2]"°"tempU\
		"${goto 125}"Flow[3]"°"tempU\
		"${goto 175}"Flow[4]"°"tempU\
		"${goto 225}"Flow[5]"°"tempU
}

and there is a Conky code to use

${texecpi 600 curl -s "http://weather.yahooapis.com/forecastrss?w=2414495&u=f" | ~/.conky/conkyparts/weather.mawk}

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

Offline

#5686 2013-07-07 22:38:20

Inodoro Pereyra
#! Die Hard
From: Back in Buenos Aires
Registered: 2013-07-01
Posts: 844

Re: Conky v1.9 Thread

Ok, after reading a little on conky_parse (thank you Dk75, and, once again, thanks a LOT Sector11, for all your help, not only with the parse stuff), I finally got the hddtemp bargraph to work. But the cpu temp bars are still eluding me.
This is the code, as it appears in my conky:

${goto 136}${font Ubuntu:bold:size=10}${execi 10 sensors | awk '/Core 0/ {gsub(/\+/,"",$3); gsub(/\..+/,"",$3); print $3}'}°C${goto 180}${font Ubuntu:bold:size=10}${execi 10 sensors | awk '/Core 2/ {gsub(/\+/,"",$3); gsub(/\..+/,"",$3); print $3}'}°C

And this is the relevant part of lua:

{
			
			arg=conky_parse("${execi 10 sensors | awk '/Core 0/'}"),
			max=100,
			alarm=80,
			bg_colour={0x00ff00,0},
			fg_colour={0xff0000,1},
			x=157,y=190,
			blocks=100,
			height=1.3,width=10,
			angle=0,
			cap="b",
			space=0,
			skew_y=0,
			mid_colour={{0.5,0xff0000,1}}
		},
{
			
			arg=conky_parse("${execi 10 sensors | awk '/Core 2/'}"),
			max=100,
			alarm=80,
			bg_colour={0x00ff00,0},
			fg_colour={0xff0000,1},
			x=184,y=190,
			blocks=100,
			height=1.3,width=10,
			angle=0,
			cap="b",
			space=0,
			skew_y=0,
			mid_colour={{0.5,0xff0000,1}}
		},
		{
			arg=conky_parse("${execi 20 /usr/bin/hddtemp -n /dev/sda}"),
			max=100,
			alarm=80,
			bg_colour={0xff0000,0},
			fg_colour={0xff0000,1},
			x=325,y=510,
			blocks=100,
			height=1,width=10,
			angle=0,
			cap="b",
			space=0,
			skew_y=0,
			mid_colour={{0.5,0xff0000,1}}
		},

Now, I run that conky on my terminal, and don't get any error whatsoever. The hddtemp bar works beautifully, but the cpu temp bars don't. I know the bars are there, because I can see them if I set the bg_colour's alpha to "1" (which I used to align them properly), but once I set the alpha value to "0", nothing. sad
I'm sure there's something wrong with my conky_parse lines, but I don't have a clue what it is.
What am I doing wrong?

BTW: if I put the whole equation in the conky_parse line, it gives me an error on the terminal, and doesn't run.

Last edited by Inodoro Pereyra (2013-07-07 23:54:23)

Offline

#5687 2013-07-07 22:41:39

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

Re: Conky v1.9 Thread

@dk75

your weather.mawk sounds great, but all i can get trying to use it is this
2013-07-08--1373238393_208x61_scrot_zps6bab3d27.png
in conky:

Wetter:
jetzt:$alignr${texeci 600  curl -s "http://weather.yahooapis.com/forecastrss?w=20065495&u=c" |mawk -F"\"" '/yweather:condition/ {temprature=$6} /yweather:condition/ {condition=$2} END{print temprature,"°C -", condition}'}
${texecpi 600 curl -s "http://weather.yahooapis.com/forecastrss?w=20065495&u=c" | ~/scripts/yweather.mawk}

only edited last part of the script:

END	\
{	

	print 
		Fday[2]": $alignr"Flow[2]"-"Fhigh[2]"°"tempU"${image ~/.config/conky/conky-google-now/"Fcode[2]".png -s 13x13}"\
		Fday[3]": $alignr"Flow[3]"-"Fhigh[3]"°"tempU"${image ~/.config/conky/conky-google-now/"Fcode[3]".png -s 13x13}"\
		Fday[4]": $alignr"Flow[4]"-"Fhigh[4]"°"tempU"${image ~/.config/conky/conky-google-now/"Fcode[4]".png -s 13x13}"\
		Fday[5]": $alignr"Flow[5]"-"Fhigh[5]"°"tempU"${image ~/.config/conky/conky-google-now/"Fcode[5]".png -s 13x13}"

}

do you see what possibly went wrong with it?

greetz -naik

Last edited by Naik (2013-07-07 23:11:05)


*kaum macht man es richtig, funktioniert es sofort*

Offline

#5688 2013-07-08 02:16:44

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

Re: Conky v1.9 Thread

@inodoro

I thought the conky_parse line had to be the entire line - like you have done for hddtemp - so your cpu temp line is cut short. I haven't used the wlourf bar graphs in a year or two though, so I'm kind of picking my old brain here.


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

Offline

#5689 2013-07-08 02:29:41

Inodoro Pereyra
#! Die Hard
From: Back in Buenos Aires
Registered: 2013-07-01
Posts: 844

Re: Conky v1.9 Thread

PackRat wrote:

@inodoro

I thought the conky_parse line had to be the entire line - like you have done for hddtemp - so your cpu temp line is cut short. I haven't used the wlourf bar graphs in a year or two though, so I'm kind of picking my old brain here.

That's what I thought from reading MrPeachy's how to. But when I use the whole line, I get this in the terminal:

bernardo@Bernardo:~$ killall conky && conky -c /home/bernardo/.conky/System_conky/systemps.conky &
[1] 25483
bernardo@Bernardo:~$ Conky: llua_load: /home/bernardo/.conky/System_conky/bargraph_small.lua:96: ')' expected near '",$3); gsub(/..+/,"'
Conky: forked to background, pid is 25487

Conky: desktop window (ac) is root window
Conky: window type - normal
Conky: drawing to created window (0x1a00002)
Conky: drawing to double buffer
Conky: llua_do_call: function conky_main_bars execution failed: attempt to call a nil value
Conky: llua_do_call: function conky_main_bars execution failed: attempt to call a nil value
Conky: llua_do_call: function conky_main_bars execution failed: attempt to call a nil value

... the last line keeps repeating ad aeternum, and nothing happens. At least, with the temp lines cut short, I have no errors, and the hddtemp displays properly... sad

Offline

#5690 2013-07-08 07:19:09

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

Re: Conky v1.9 Thread

Naik wrote:

@dk75

your weather.mawk sounds great, but all i can get trying to use it is this
http://i846.photobucket.com/albums/ab27 … ab3d27.png
in conky:

Wetter:
jetzt:$alignr${texeci 600  curl -s "http://weather.yahooapis.com/forecastrss?w=20065495&u=c" |mawk -F"\"" '/yweather:condition/ {temprature=$6} /yweather:condition/ {condition=$2} END{print temprature,"°C -", condition}'}
${texecpi 600 curl -s "http://weather.yahooapis.com/forecastrss?w=20065495&u=c" | ~/scripts/yweather.mawk}

only edited last part of the script:

END	\
{	

	print 
		Fday[2]": $alignr"Flow[2]"-"Fhigh[2]"°"tempU"${image ~/.config/conky/conky-google-now/"Fcode[2]".png -s 13x13}"\
		Fday[3]": $alignr"Flow[3]"-"Fhigh[3]"°"tempU"${image ~/.config/conky/conky-google-now/"Fcode[3]".png -s 13x13}"\
		Fday[4]": $alignr"Flow[4]"-"Fhigh[4]"°"tempU"${image ~/.config/conky/conky-google-now/"Fcode[4]".png -s 13x13}"\
		Fday[5]": $alignr"Flow[5]"-"Fhigh[5]"°"tempU"${image ~/.config/conky/conky-google-now/"Fcode[5]".png -s 13x13}"

}

do you see what possibly went wrong with it?

greetz -naik

check if your conky have '${texecpi}' function

man conky |grep texecp

if it have, play with 'text_buffer_size' - default is 256, which is way too low for parsing such big text from MAWK (try 1024).


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

Offline

#5691 2013-07-08 07:46:26

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

Re: Conky v1.9 Thread

dk75 wrote:

check if your conky have '${texecpi}' function

man conky |grep texecp

if it have, play with 'text_buffer_size' - default is 256, which is way too low for parsing such big text from MAWK (try 1024).

no i don`t have... and i cant figure out how to get it...


*kaum macht man es richtig, funktioniert es sofort*

Offline

#5692 2013-07-08 08:48:33

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

Re: Conky v1.9 Thread

Compile your own Conky 2.0 beta from GIT source.
Or try DEB I've provided earlier.

Or save weather.xml to /var/tmp directory (it should preserve during reboot), and then parse it with MAWK (MAWK is lighter and faster than AWK, but don't have some more sophisticated functions, which aren't used here) in '${execi}' variable (you don't need threaded variable of '${texeci}' for text manipulation of this size, it's only needed for data net fetching, which could be longer than a Conky loop):

${texeci 600  curl -s "http://weather.yahooapis.com/forecastrss?w=20065495&u=c" -o /var/tmp/yweather.xml}${alignr}${execi 600 mawk -F"\"" '/yweather:condition/ {temprature=$6} /yweather:condition/ {condition=$2} END{print temprature,"°C -", condition}' /var/tmp/yweather.xml}
${execpi 5 ~/scripts/yweather.mawk /var/tmp/yweather.xml}

PS: fetching same weather XML over and over for every single data that you need to display in one go might result in blacklisting by Yahoo of your entire provider domain (every people in your town).

Last edited by dk75 (2013-07-08 08:50:24)


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

Offline

#5693 2013-07-09 06:37:22

jed
#! CrunchBanger
From: Detachment 7
Registered: 2012-08-28
Posts: 200
Website

Re: Conky v1.9 Thread

Did I ever mention that I love Conky?  Changed it again.

latest.png

All the Conky's and scripts can be had herehttp://vsido.org/index.php/topic,18.msg … ml#msg5205

Last edited by jed (2013-07-12 04:48:19)


Proud user of VSDIO: Jedi!  You can download it from here...  I'm on  the web at NixNut.com!

Offline

#5694 2013-07-09 10:32:34

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

Re: Conky v1.9 Thread

i have an error message but i do not see that there is an error within my function. maybe i'm blind but i do not see somethin wrong.

function display_perc(value,dev,number,txt,tt,mt)

ms,text=nil,nil

if string.find(dev,"fs") ~= nil then -----------------------------------

	if number == "yes" then  text=n2w4d(value).." "..e12 else text=value.." "..e6  end 
 	ms=conky_parse("${if_mounted "..dev.."}"..text.."${else}"..nomt(mt,t3).."${endif}")
------------------------------------------------------------------------
elseif string.find(dev,"wlan") ~= nil or string.find(dev,"eth") ~= nil then
		
	print("mt: "..mt)
	if number == "yes" then  text=n2w4d(value).." "..e12 else text=value.." "..e6  end 
 	ms=conky_parse("${if_up "..dev.."}"..text.."${else}"..nomt(mt,t3).."${endif}")

	else ---------------------------------------------------------------

	if number == "yes" then  ms=n2w4d(value).." "..e12 else ms=value.." "..e6  end 

end --------------------------------------------------------------------

return ms
end

this is the error message:

Conky: llua_do_call: function conky_weather execution failed: /home/alexander/v9000/v9000.lua:1685: attempt to concatenate local 'mt' (a nil value)

Offline

#5695 2013-07-09 13:17:41

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

Re: Conky v1.9 Thread

So, which line is 1685? 'print("mt: "..mt)'?  tongue


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

Offline

#5696 2013-07-09 14:42:58

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

Re: Conky v1.9 Thread

jed wrote:

Did I ever mention that I love Conky?  Changed it again.

http://en.zimagez.com/miniature/latest.png

Oh I don't know ... maybe 3 or 4ty times. Looks good there jed


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

Offline

#5697 2013-07-09 17:30:52

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

Re: Conky v1.9 Thread

dk75 wrote:

So, which line is 1685? 'print("mt: "..mt)'?  tongue

yepp

Offline

#5698 2013-07-09 17:59:16

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

Re: Conky v1.9 Thread

That means, that you feed null value to the function. Function itself is ok.


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

Offline

#5699 2013-07-09 18:16:47

joshuar9476
Member
Registered: 2013-06-23
Posts: 35

Re: Conky v1.9 Thread

yweather saves the wind direction as a degree ...

from my xml ...

<yweather:wind chill="86"   direction="230"   speed="10" />

any way to convert that to Cardinal in my conky script?


also, is my conky constantly pinging yahoo for weather? If so, is there a way to just have my weather part ping it like every 60 or 30 minutes?


Individuality: Always remember that you are unique. Just like everybody else.

Offline

Be excellent to each other!

#5700 2013-07-09 18:28:26

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

Re: Conky v1.9 Thread

dk75 wrote:

That means, that you feed null value to the function. Function itself is ok.

i found the error. it looks better now. smile

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo