SEARCH

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

You are not logged in.

#7851 2014-09-24 15:34:32

AnonFriendly
Member
Registered: 2014-09-19
Posts: 34

Re: Conky v1.9 Thread

screenshot.png

My conky setup. pretty happy with it. but you know you cant stop messing with it lol. im not sure what i wanna add next. maybe some lau scripting or something for extra effects.

########################################################################
# 
# Config for Conky
#
########################################################################

########################################################################
# Global Options

# Size and orientation
alignment top_left
gap_x 1930
gap_y 10
maximum_width 320
minimum_size 1280 50

# General
update_interval 2.0
double_buffer yes
draw_outline no
border_width 0
default_bar_size 0 5

# Window
own_window yes
own_window_type normal
own_window_argb_visual yes
own_window_colour 000000
own_window_transparent yes
own_window_hints undecorated below sticky skip_taskbar skip_pager

# Specific settings
cpu_avg_samples 2
net_avg_samples 2
no_buffers yes

# Output
use_spacer none
use_xft yes
xftfont Terminus:pixelsize=12
draw_shades no
uppercase no

# Colors (1 = Text; 2 = Data; 3 = heading)
color1 AAAAAA
color2 FFFFFF
color3 999999
color4 1793D0
color5 0050BF

# Templates (1 = Simple; 3 = Filesystem; 4 = Filesystem 2; 5 = Heading; 6 = Core temperature; 7 = Cpu load)
template1 ${color1}\1 ${color2}\2
template2 ${color1}\1 ${color2}\2/\3 (\4%)
template3 ${color1}\1: ${color2}${fs_used \1}/${fs_size \1} (${fs_used_perc \1}%) ${fs_bar \1}
template4 ${color1}\1: ${color2}$alignr${fs_free \1} ${fs_bar 5,120 \1}
template5 ${font Neuropolitical:bold:size=8}${color4}\1 ${font}${hr 2}
#template6 (core max_temp) e.g. (${template6 'Core\ 0' 60}
template6 ${execi 2 sensors | grep -A 0 \1 | cut -c18-19}${goto 100}${if_match ${execi 2 sensors | grep -A 0 \1 | cut -c18-21}<\2}${color}${execibar 2 sensors | grep -A 0 \1 | cut -c18-19}${endif}${if_match ${execi 2 sensors | grep -A 0 \1 | cut -c18-21}>=\2}${color red}${execibar 2 sensors | grep -A 0 \1 | cut -c18-19}${color}${endif}${goto 96}${color white} ${execbar echo 0}${color}
#template7 (cpu_no max_temp) e.g. (${template6 cpu1 60}
template7 ${cpu \1}${goto 100}${if_match ${cpu \1}<\2}${cpubar \1}${endif}${if_match ${cpu \1}>=\2}${color5}${cpubar \1}${color}${endif}${color}${goto 1}${color white}${goto 100}${execbar echo 0}${color}


########################################################################
# Output
TEXT
${image /home/kira/images/laughingman.gif -s 100x100} 




${font Neuropolitical:pixelsize=25}${alignr}L4GH1NG${color #1793d0}M4N
${template5 CPU\ AND\ PROCESSES}
${color1}Usage: ${color2}${cpu}% \
 | ${color1}Freq: ${color2}$freq_g GHz \
| ${color1}Load: ${color2}$loadavg
Cpu  1(%): ${template7 cpu1 99}
Cpu  2(%): ${template7 cpu2 99}

${color1}Processes: ${color2}$processes \
 | ${color1}Running: ${color2}$running_processes
${color white}NAME${alignr}${offset -70}PID${alignr}${offset -38}CPU${alignr}MEM
${color #FFFFFF}${top name 1}${alignr}${offset -40}${top pid 1}${alignr}${offset -20}${top cpu 1}  ${alignr}${top mem 1}
${color #EFEFEF}${top name 2}${alignr}${offset -40}${top pid 2}${alignr}${offset -20}${top cpu 2}  ${alignr}${top mem 2}
${color #DFDFDF}${top name 3}${alignr}${offset -40}${top pid 3}${alignr}${offset -20}${top cpu 3}  ${alignr}${top mem 3}
${color #CFCFCF}${top name 4}${alignr}${offset -40}${top pid 4}${alignr}${offset -20}${top cpu 4}  ${alignr}${top mem 4}
${color #BFBFBF}${top name 5}${alignr}${offset -40}${top pid 5}${alignr}${offset -20}${top cpu 5}  ${alignr}${top mem 5}

${template5 MEMORY\ AND\ SWAP}
${color1}RAM:  ${color2}$mem/$memmax ($memperc%)
${if_match $memperc <85}${goto 5}${membar 5}${endif}${if_match $memperc >=85}${goto 5}${color red}${membar 5}${color}${endif}${goto 5}${execbar echo 0}
${color1}SWAP: ${color2}$swap/$swapmax ($swapperc%)
${swapbar 5}

${template5 NETWORK}
${if_gw}\
${template1 Network: Online}
${template1 DGW: $gw_ip\ ($gw_iface)} \
| ${template1 Nameserver: $nameserver}
\
${if_up usb0}
${color1}Interface:${color2} usb0 \
| ${color1}IP-Address:${color2} ${addr usb0}
${color1}Speed:${color2} Down: ${downspeedf usb0} / Up: ${upspeedf usb0}
${downspeedgraph usb0 20,150 000000 FFFFFF} ${alignr}${color #CFCFCF}\
${upspeedgraph usb0 20,150 000000 CFCFCF}
${endif}\
\
${if_up br0}
${color1}Interface:${color2} br0 \
| ${color1}IP-Address:${color2} ${addr br0}
${color1}Speed:${color2} Down: ${downspeedf br0} / Up: ${upspeedf br0}
${downspeedgraph br0 20,150 000000 FFFFFF} ${alignr}${color #CFCFCF}\
${upspeedgraph br0 20,150 000000 CFCFCF}
${endif}\
\
${if_up wlan0}
${template1 Interface: wlan0} \
| ${color1}IP-Address:${color2} ${addr wlan0}
${color1}ESSID:${color2} ${wireless_essid wlan0} \
| ${color1}Quality:${color2} ${wireless_link_qual_perc wlan0}%
${color1}Speed:${color2} Down: ${downspeedf wlan0} / Up: ${upspeedf wlan0}
${downspeedgraph wlan0 20,150 000000 FFFFFF} ${alignr}${color #CFCFCF}\
${upspeedgraph wlan0 20,150 000000 CFCFCF}
${endif} \
${else}\
${template1 Network: Offline}
${endif}
${color #1793d0}Battery: ${color2}${battery_percent BAT0}% ${alignc}${battery_bar BAT0}

${template5 FILESYSTEMS}
${template4 /}

${if_running banshee}
${color #1793d0}NOW PLAYING ${hr 2}
${color white}
# ARTIST
${alignc}${execi 10 banshee --no-present --query-artist|cut -c8-}
# SONG TITLE
${alignc}"${execi 10 banshee --no-present --query-title|cut -c8-}"
# ALBUM
${alignc}${execi 10 banshee --no-present --query-album|cut -c8-}
# POSITION / DURATION
${execibar 10 pos=`banshee --no-present --query-position| sed s/position:\ //| sed s/,.*//`; dur=`banshee --no-present --query-duration| sed s/duration:\ //| sed s/,.*//`;echo "$pos / $dur * 100" | bc -l}
$endif

Offline

Help fund CrunchBang, donate to the project!

#7852 2014-09-24 16:35:53

easysid
#! CrunchBanger
From: India
Registered: 2013-01-25
Posts: 150

Re: Conky v1.9 Thread

AnonFriendly wrote:

im not sure what i wanna add next. maybe some lau scripting or something for extra effects.

Yes, I have heard lau scripting really works wonders. big_smile big_smile

Offline

#7853 2014-09-24 17:39:37

AnonFriendly
Member
Registered: 2014-09-19
Posts: 34

Re: Conky v1.9 Thread

i havent tried it yet. quite a scripting noob. but ive seen a few lau scripts for conky which show 3d-type effects. #! is forcing me to learn programming. i love it smile

Offline

#7854 2014-09-24 17:57:10

Alad
Software Satan
Registered: 2014-02-20
Posts: 1,512

Re: Conky v1.9 Thread

^ lua* tongue

Offline

#7855 2014-09-24 18:05:04

AnonFriendly
Member
Registered: 2014-09-19
Posts: 34

Re: Conky v1.9 Thread

oh wow thanks XD LUA** LUA** LUA** i feel like a dumbass

Offline

#7856 2014-09-24 19:18:43

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

Re: Conky v1.9 Thread

AnonFriendly wrote:

http://s30.postimg.org/8orr95wy9/screenshot.png

My conky setup. pretty happy with it. but you know you cant stop messing with it lol. im not sure what i wanna add next. maybe some lau scripting or something for extra effects.

Nice looking conky from what I can see of it.  I must learn to use templates.  wink
Well done!

lua is more than good ... check out the 16 links in my sig, there are a few lua threads there.

Also: Would you be so kind as to a proper thumbnail as per our screenshot threads:

Please use thumbnails (please try to avoid the large thumbnail imgur.com code) linking to the larger image to help those of us with slow connections. An example of the code needed is below. Most image hosting sites will automatically generate this for you as well. Users have been using www.postimage.org lately which does a nice job.  Multi-lingual as well.

[url=http://link.to.your.fullsized.image][img]http://link.to.your.thumbnail.image[/img][/url]

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

Offline

#7857 2014-09-24 23:55:07

AnonFriendly
Member
Registered: 2014-09-19
Posts: 34

Re: Conky v1.9 Thread

sorry sector 11, i was too excited to look at some of the other conkys i must have passed page 1. by thumbnail do you mean a smaller image size or simply use a link?

Offline

#7858 2014-09-25 00:32:19

AnonFriendly
Member
Registered: 2014-09-19
Posts: 34

Re: Conky v1.9 Thread

oh and one question guys. i am trying to add a border to my conky. so i removed the section that stated "undecorated". and it added the border. but also showed the menu (close. maxamize etc). so i changed the window section to desktop. and it removed it. any help?

Offline

#7859 2014-09-25 00:55:51

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

Re: Conky v1.9 Thread

AnonFriendly wrote:

sorry sector 11, i was too excited to look at some of the other conkys i must have passed page 1. by thumbnail do you mean a smaller image size or simply use a link?

A smaller image that links to a larger image like this:
2014_07_30_15_25_43_1920x1080_Sector11.jpg


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

Offline

#7860 2014-09-25 01:06:48

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

Re: Conky v1.9 Thread

AnonFriendly wrote:

oh and one question guys. i am trying to add a border to my conky. so i removed the section that stated "undecorated". and it added the border. but also showed the menu (close. maxamize etc). so i changed the window section to desktop. and it removed it. any help?

Put it back to own_window_type normal

And look at this:

###  Borders Section  ###
draw_borders yes #no
# Stippled borders?
#stippled_borders 5
# border margins
border_inner_margin 5
border_outer_margin 0
# border width
border_width 5
# graph borders
draw_graph_borders yes #no
#default_graph_size 15 40
###  End Borders Secton  ###

2014_09_24_22_04_09_421x467_Sector11.jpg

The colour will be whatever you define as the default colour:

default_color DCDCDC #220 220 220	Gainsboro

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

Offline

#7861 2014-09-25 05:51:33

easysid
#! CrunchBanger
From: India
Registered: 2013-01-25
Posts: 150

Re: Conky v1.9 Thread

Sector11 wrote:

A smaller image that links to a larger image like this:
http://s20.postimg.org/9juhccyo9/2014_07_30_15_25_43_1920x1080_Sector11.jpg

That wallpaper is just screaming for some fancy lua. The compass even guides us as to where to put it  tongue  tongue

Offline

#7862 2014-09-25 12:45:14

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

Re: Conky v1.9 Thread

^ well if it's screaming for fancy lua it must be screaming else where because I don't hear it.

Have at it .... looking forward to seeing what you do with it: Old_World_Map.png


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

Offline

#7863 2014-09-25 16:06:41

easysid
#! CrunchBanger
From: India
Registered: 2013-01-25
Posts: 150

Re: Conky v1.9 Thread

^ nope....  Sorry, not doing anything with it this time. It would require some gimping skills to get a good result though.

To start with, Clock and current weather go where the compass is. Some info (forecast?) goes at the location (lol Canada). A copy of the compass at the top with dials for sysinfo. Lots of space on the map for processes, mail etc. That is the general idea.

Last edited by easysid (2014-09-25 16:14:18)

Offline

#7864 2014-09-25 18:36:42

AnonFriendly
Member
Registered: 2014-09-19
Posts: 34

Re: Conky v1.9 Thread

so much for a "general idea" lol. and will remember that for next time sector 11. thanks for the help. im about to try it now.

Offline

#7865 2014-09-25 18:42:14

syntaxerror
Member
Registered: 2014-09-08
Posts: 30

Re: Conky v1.9 Thread

Hey folks, I need a pro here (or else I will file a bug report, for this behavior simply can't be as one would expect)

This is meant to be used with deadbeef or mplayer.

double_buffer yes
own_window yes
own_window_class Conky
own_window_hints undecorated,sticky # ,skip_taskbar  (note: commented out; got to be able to restore conky window after showing desktop)
own_window_transparent yes

background yes
short_units yes
max_user_text 24576
no_buffers yes
text_buffer_size 3072

total_run_times 0 
update_interval 0.55

use_xft yes
xftfont Bitstream Vera Sans:size=7
xftalpha 0.85
override_utf8_locale yes 

minimum_size 225

TEXT
Audio ${hr 1}${color fbf790}
${if_running deadbeef-gtkui}\
${if_match "${texeci 1 /usr/bin/deadbeef --nowplaying "%a - %t" 2>/dev/null | sed 's/\!//g'}" == "nothing"}\
${voffset +6}deadbeef: ${color0}not playing back anything${color}\
${else}\
${voffset +5}${offset +7}${font WenQuanYi Micro Hei Mono:size=7}\
${if_match "${texeci 5 /usr/bin/deadbeef --nowplaying "%y" 2>/dev/null}" == ""}\
${scroll 20 1 ${execi 16 /usr/bin/deadbeef --nowplaying "%a - %t" 2>/dev/null}}\
$else ${if_match "${texeci 5 /usr/bin/deadbeef --nowplaying "%y" 2>/dev/null}" == "0"}\
${scroll 20 1 ${execi 16 /usr/bin/deadbeef --nowplaying "%a - %t" 2>/dev/null}}\
$else ${scroll 20 1 ${execi 16 /usr/bin/deadbeef --nowplaying "%a - %t (%y)" 2>/dev/null}}${endif}\
${endif}\
${font WenQuanYi Micro Hei Mono:size=7:style:bold}$alignr\
${texeci 0.75 /usr/bin/deadbeef --nowplaying "%e / %l" 2>/dev/null}${endif}${font}
${else}${voffset +6}deadbeef: ${color}not launched\
${endif}
${voffset -2}${color fbf790}\
${if_running mplayer}\
mplayer: ${color} ${scroll 20 1 playing back file ${font WenQuanYi Micro Hei Mono:size=7}\
${execp basename "$(readlink $(find /proc/$(pidof mplayer)/fd/ -xtype f))"}}\
${font}${endif}

Albeit looking rather tiny, it does work. You had better copy-paste this stuff to a separate file and start conky with the -c option.

However, something is not right when you play some audio file with its ID3 in foreign characters, e. g. Korean, Japanese, Cyrillic...
Text will scroll but it will always "blink", e. g. once it hits a foreign character on the left border of the scrolling area, the WHOLE text will disappear and not reappear again until that one character has finished scrolling to the left.

Is there any reason why this happens?
Or is it simply a bug?

Last edited by syntaxerror (2014-09-25 21:08:01)

Offline

#7866 2014-09-25 18:46:50

AnonFriendly
Member
Registered: 2014-09-19
Posts: 34

Re: Conky v1.9 Thread

http://s1.postimg.org/hssq24cwr/2014_09 … _scrot.png

here it is now. all thanks to sector 11, what a pro.

########################################################################
# 
# Config for Conky
#
########################################################################

########################################################################
# Global Options

# Size and orientation
alignment top_left
gap_x 1930
gap_y 10
maximum_width 320
minimum_size 1280 50

# General
update_interval 2.0
double_buffer yes
draw_outline no
draw_borders yes
border_width 5
default_bar_size 0 5
default_color 5200FF 100

# Window
own_window yes
own_window_type normal
own_window_argb_visual no
own_window_colour 000000
own_window_transparent no
own_window_hints undecorated below sticky skip_taskbar skip_pager

# Specific settings
cpu_avg_samples 2
net_avg_samples 2
no_buffers yes

# Output
use_spacer none
use_xft yes
xftfont Terminus:pixelsize=12
draw_shades no
uppercase no

# Colors (1 = Text; 2 = Data; 3 = heading)
color1 AAAAAA
color2 FFFFFF
color3 999999
color4 5200FF
color5 0050BF

# Templates (1 = Simple; 3 = Filesystem; 4 = Filesystem 2; 5 = Heading; 6 = Core temperature; 7 = Cpu load)
template1 ${color1}\1 ${color2}\2
template2 ${color1}\1 ${color2}\2/\3 (\4%)
template3 ${color1}\1: ${color2}${fs_used \1}/${fs_size \1} (${fs_used_perc \1}%) ${fs_bar \1}
template4 ${color1}\1: ${color2}$alignr${fs_free \1} ${fs_bar 5,120 \1}
template5 ${font Neuropolitical:bold:size=8}${color4}\1 ${font}${hr 2}
#template6 (core max_temp) e.g. (${template6 'Core\ 0' 60}
template6 ${execi 2 sensors | grep -A 0 \1 | cut -c18-19}${goto 100}${if_match ${execi 2 sensors | grep -A 0 \1 | cut -c18-21}<\2}${color}${execibar 2 sensors | grep -A 0 \1 | cut -c18-19}${endif}${if_match ${execi 2 sensors | grep -A 0 \1 | cut -c18-21}>=\2}${color red}${execibar 2 sensors | grep -A 0 \1 | cut -c18-19}${color}${endif}${goto 96}${color white} ${execbar echo 0}${color}
#template7 (cpu_no max_temp) e.g. (${template6 cpu1 60}
template7 ${cpu \1}${goto 100}${if_match ${cpu \1}<\2}${cpubar \1}${endif}${if_match ${cpu \1}>=\2}${color5}${cpubar \1}${color}${endif}${color}${goto 1}${color white}${goto 100}${execbar echo 0}${color}


########################################################################
# Output
TEXT
${image /home/kira/general/conky/conky-laughingman2.png -s 150x120} 



${font Neuropolitical:pixelsize=25}${alignr}WE 4RE
${font Symbol:pixelsize=25}${alignr}${color #1793d0}4N0N4M0U5
${template5 CPU\ AND\ PROCESSES}
${color1}Usage: ${color2}${cpu}% \
 | ${color1}Freq: ${color2}$freq_g GHz \
| ${color1}Load: ${color2}$loadavg
Cpu  1(%): ${template7 cpu1 99}
${color white}Cpu  2(%): ${template7 cpu2 99}

${color1}Processes: ${color2}$processes \
 | ${color1}Running: ${color2}$running_processes
${color white}NAME${alignr}${offset -70}PID${alignr}${offset -38}CPU${alignr}MEM
${color #FFFFFF}${top name 1}${alignr}${offset -40}${top pid 1}${alignr}${offset -20}${top cpu 1}  ${alignr}${top mem 1}
${color #EFEFEF}${top name 2}${alignr}${offset -40}${top pid 2}${alignr}${offset -20}${top cpu 2}  ${alignr}${top mem 2}
${color #DFDFDF}${top name 3}${alignr}${offset -40}${top pid 3}${alignr}${offset -20}${top cpu 3}  ${alignr}${top mem 3}
${color #CFCFCF}${top name 4}${alignr}${offset -40}${top pid 4}${alignr}${offset -20}${top cpu 4}  ${alignr}${top mem 4}
${color #BFBFBF}${top name 5}${alignr}${offset -40}${top pid 5}${alignr}${offset -20}${top cpu 5}  ${alignr}${top mem 5}

${template5 MEMORY\ AND\ SWAP}
${color1}RAM:  ${color2}$mem/$memmax ($memperc%)
${if_match $memperc <85}${goto 5}${membar 5}${endif}${if_match $memperc >=85}${goto 5}${color red}${membar 5}${color}${endif}${goto 5}${execbar echo 0}
${color1}SWAP: ${color2}$swap/$swapmax ($swapperc%)
${swapbar 5}

${template5 NETWORK}
${if_gw}\
${template1 Network: Online}
${template1 DGW: $gw_ip\ ($gw_iface)} \
| ${template1 Nameserver: $nameserver}
\
${if_up usb0}
${color1}Interface:${color2} usb0 \
| ${color1}IP-Address:${color2} ${addr usb0}
${color1}Speed:${color2} Down: ${downspeedf usb0} / Up: ${upspeedf usb0}
${downspeedgraph usb0 20,150 000000 FFFFFF} ${alignr}${color #CFCFCF}\
${upspeedgraph usb0 20,150 000000 CFCFCF}
${endif}\
\
${if_up br0}
${color1}Interface:${color2} br0 \
| ${color1}IP-Address:${color2} ${addr br0}
${color1}Speed:${color2} Down: ${downspeedf br0} / Up: ${upspeedf br0}
${downspeedgraph br0 20,150 000000 FFFFFF} ${alignr}${color #CFCFCF}\
${upspeedgraph br0 20,150 000000 CFCFCF}
${endif}\
\
${if_up wlan0}
${template1 Interface: wlan0} \
| ${color1}IP-Address:${color2} ${addr wlan0}
${color1}ESSID:${color2} ${wireless_essid wlan0} \
| ${color1}Quality:${color2} ${wireless_link_qual_perc wlan0}%
${color1}Speed:${color2} Down: ${downspeedf wlan0} / Up: ${upspeedf wlan0}
${downspeedgraph wlan0 20,150 000000 FFFFFF} ${alignr}${color #CFCFCF}\
${upspeedgraph wlan0 20,150 000000 CFCFCF}
${endif} \
${else}\
${template1 Network: Offline}
${endif}
${color #1793d0}Battery: ${color2}${battery_percent BAT0}% ${alignc}${battery_bar BAT0}

${template5 FILESYSTEMS}
${template4 /}

${if_running banshee}
${color #1793d0}NOW PLAYING ${hr 2}
${color white}
# ARTIST
${alignc}${execi 10 banshee --no-present --query-artist|cut -c8-}
# SONG TITLE
${alignc}"${execi 10 banshee --no-present --query-title|cut -c8-}"
# ALBUM
${alignc}${execi 10 banshee --no-present --query-album|cut -c8-}
# POSITION / DURATION
${execibar 10 pos=`banshee --no-present --query-position| sed s/position:\ //| sed s/,.*//`; dur=`banshee --no-present --query-duration| sed s/duration:\ //| sed s/,.*//`;echo "$pos / $dur * 100" | bc -l}
$endif

Offline

#7867 2014-09-25 19:27:46

syntaxerror
Member
Registered: 2014-09-08
Posts: 30

Re: Conky v1.9 Thread

@AnonFriendly
This has the size of a postal stamp ... nothing to see...

Offline

#7868 2014-09-25 22:44:32

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

Re: Conky v1.9 Thread

@syntaxerror
That problem with ${scroll} in conky is a known bug (Bug Report #1, Bug Report #2).
It happens because the scroll code advances through the scrolled string by "bytes" instead of "characters" which creates invalid UTF-8 strings when it encounters a multi-byte UTF-8 character.
Because these strings are invalid they can't be displayed so scroll goes blank until it generates a valid string again.

You can use a Lua script to scroll text and it won't have this problem though.
I have a scroll function already written though it is not setup to be standalone as is.

function scrollingAlerts(cr, extents, wuAPI_Parsed, weatherData, blx, bly, scrollAdvance, scrollDisplay_Length)
	cairo_text_extents(cr, "|", extents)
	local vBar_x_advance = extents.x_advance - 1
	--local scrollAdvance = 10 --# number of characters to advance scroll string by
	--local scrollDisplay_Length = 115 --# length of scrolling text in characters
	local displayString = ""
	--print("1\nweatherData.alertString_Start: "..weatherData.alertString_Start.."\nweatherData.alertString_End: "..weatherData.alertString_End.."\nDifference: "..(weatherData.alertString_End - weatherData.alertString_Start))
	weatherData.alertString_End = weatherData.alertString_End + scrollAdvance
	if weatherData.alertString_End > scrollDisplay_Length then
		weatherData.alertString_Start = weatherData.alertString_End - (scrollDisplay_Length - 1)
		if weatherData.alertString_Start > #weatherData.alertString then
			weatherData.alertString_Start = 1
			weatherData.alertString_End = 1 + scrollAdvance
			displayString = weatherData.alertString:sub(weatherData.alertString_Start, weatherData.alertString_End)
			cairo_text_extents(cr, " ", extents)
			blx = blx + (extents.x_advance * (scrollDisplay_Length - #displayString))
		else
			displayString = weatherData.alertString:sub(weatherData.alertString_Start, weatherData.alertString_End)
		end --# if weatherData.alertString_Start > #weatherData.alertString then
	else
		displayString = weatherData.alertString:sub(weatherData.alertString_Start, weatherData.alertString_End)
		if #displayString < scrollDisplay_Length then
			cairo_text_extents(cr, " ", extents)
			blx = blx + (extents.x_advance * (scrollDisplay_Length - #displayString))
		end --# if #displayString < scrollDisplay_Length then
	end --# if weatherData.alertString_End > scrollDisplay_Length then
	--print(displayString)
	--print(#displayString)
	local displaySplit = assert(loadstring(("return {'"..(displayString:gsub("'","\\'"):gsub("||","','")).."'}")))()
	local displaySplit2 = {}
	for i = 1, #displaySplit do
		displaySplit2[i] = assert(loadstring(("return {'"..(displaySplit[i]:gsub("'","\\'"):gsub("|","','")).."'}")))()
	end --# for i = 1, #displaySplit do
	--print(#displaySplit2)
	for i = 1, #displaySplit2 do
		if i > 1 then
			cr = draw_shaded_text(cr, "|", blx, bly, {color1_R,color1_G,color1_B,color1_A}, {color3_R,color3_G,color3_B,color3_A})
			blx = blx + vBar_x_advance
			cr = draw_shaded_text(cr, "|", blx, bly, {color1_R,color1_G,color1_B,color1_A}, {color3_R,color3_G,color3_B,color3_A})
			blx = blx + vBar_x_advance
		end --# if i > 1 then
		for j = 1, #displaySplit2[i] do
			cr = draw_shaded_text(cr, displaySplit2[i][j], blx, bly, {color0_R,color0_G,color0_B,color0_A}, {color3_R,color3_G,color3_B,color3_A})
			cairo_text_extents(cr, displaySplit2[i][j], extents)
			blx = blx + extents.x_advance + 1
			if j ~= #displaySplit2[i] then
				cr = draw_shaded_text(cr, "|", blx, bly, {color1_R,color1_G,color1_B,color1_A}, {color3_R,color3_G,color3_B,color3_A})
				blx = blx + vBar_x_advance
			end --# if j ~= #displaySplit2[i] then
		end --# for j = 1, #displaySplit2[i] do
	end --# for i = 1, #displaySplit2 do
	--#################################################################
	return cr,blx,bly
end --# function scrollingAlerts(cr, extents, wuAPI_Parsed, weatherData, blx, bly, scrollAdvance, scrollDisplay_Length)

It does some more complicated things than ${scroll} so it would need to be simplified and setup to be called from a .conkyrc and not a Lua script before being used as a ${scroll} substitute.

Offline

#7869 2014-09-26 02:45:19

OhF!sh!
Member
Registered: 2014-09-26
Posts: 18

Re: Conky v1.9 Thread

Guys, guys. I'm trying to create a simple Conky that appears when I click on the date (located in my tint2 bar). This should show multiple reminders separated by columns, but I can't think of a way to vertically align the reminders! 8.(

opXVvpAs.png

${voffset} will not work, because the output of each reminder varies in height... I need an absolute value.

I've thought about some "insane" solutions like to join all outputs in a text file or even use LUA, but I'm not so skilled.

What I'm REALLY trying to avoid is having to create 7 conkys, one for each day... I believe this is unnecessary. (And c'mon... 7?!)

# Color Picker
default_color 111111
default_shade_color 000000
default_outline_color 111111
own_window_colour 262524

# Minimum size of text area
minimum_size 830 350
# maximum_width 200

background yes

# Use Xft?
use_xft yes
xftfont PF Tempesta Seven Condensed:size=6
xftalpha 1

# Update interval in seconds
update_interval 1.0

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_class Background
own_window_argb_visual no
own_window_transparent no
own_window_type normal

own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

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

# Draw shades or outline?
draw_shades no
draw_outline no

# Borders
draw_borders yes
border_width 2
border_inner_margin 15

# Text alignment, other possible values are commented
alignment middle_left

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 80
gap_y 0

# Subtract file system buffers from used memory?
no_buffers yes

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

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

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

TEXT
${color EEE}${font PF Arma Five-6}${time %A, %d de %B}	${goto 160}${execi 600 echo $(date +%A -d "+1 days")}, ${execi 600 echo $(date +%d -d "+1 days")} de ${execi 600 echo $(date +%B -d "+1 days")}	${goto 300}${execi 600 echo $(date +%A -d "+2 days")}, ${execi 600 echo $(date +%d -d "+2 days")} de ${execi 600 echo $(date +%B -d "+2 days")}	${goto 440}${execi 600 echo $(date +%A -d "+3 days")}, ${execi 600 echo $(date +%d -d "+3 days")} de ${execi 600 echo $(date +%B -d "+3 days")}	${goto 580}${execi 600 echo $(date +%A -d "+4 days")}, ${execi 600 echo $(date +%d -d "+4 days")} de ${execi 600 echo $(date +%B -d "+4 days")}	${goto 720}${execi 600 echo $(date +%A -d "+5 days")}, ${execi 600 echo $(date +%d -d "+5 days")} de ${execi 600 echo $(date +%B -d "+5 days")}${font}
${stippled_hr}

${execi 600 rem -g | sed -e '1d;2d'}
${execpi 600 rem -g $(date +%Y/%m/%d -d "+1 days") | sed 's/^/${goto 160} /' | sed -e '1d;2d'}
${execpi 600 rem -g $(date +%Y/%m/%d -d "+2 days") | sed 's/^/${goto 300} /' | sed -e '1d;2d'}
${execpi 600 rem -g $(date +%Y/%m/%d -d "+3 days") | sed 's/^/${goto 440} /' | sed -e '1d;2d'}
${execpi 600 rem -g $(date +%Y/%m/%d -d "+4 days") | sed 's/^/${goto 580} /' | sed -e '1d;2d'}
${execpi 600 rem -g $(date +%Y/%m/%d -d "+5 days") | sed 's/^/${goto 720} /' | sed -e '1d;2d'}

So, can anyone help me on this?


I definitely need to learn Lua. 8.(

Offline

#7870 2014-09-26 03:07:34

syntaxerror
Member
Registered: 2014-09-08
Posts: 30

Re: Conky v1.9 Thread

arclance wrote:

@syntaxerror
That problem with ${scroll} in conky is a known bug (Bug Report #1, Bug Report #2).
It happens because the scroll code advances through the scrolled string by "bytes" instead of "characters" which creates invalid UTF-8 strings when it encounters a multi-byte UTF-8 character.
Because these strings are invalid they can't be displayed so scroll goes blank until it generates a valid string again.

SPOT ON! Thank you, that were the links in the bug tracker I needed. Trust me, I've searched it many times, but unfortunately I must've used the wrong keywords which led to entirely unrelated search results...

Well, there is even a PATCH provided!! And why, if I may ask, has this lazy git of a "main" programmer not thought of including it officially into 1.9.1?? For I have 1.9.1_pre2471 and nothing was applied! D'oh! Those bug reports are months old. And besides, there are over 20 being open and disregarded for way more than "quite a while".

Anyways, maybe I can make it work here on my box by patching the tree myself. Thanks so far in any case.

Last edited by syntaxerror (2014-09-26 03:09:12)

Offline

#7871 2014-09-26 03:47:34

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

Re: Conky v1.9 Thread

syntaxerror wrote:

Well, there is even a PATCH provided!! And why, if I may ask, has this lazy git of a "main" programmer not thought of including it officially into 1.9.1?? For I have 1.9.1_pre2471 and nothing was applied! D'oh!

It was probably not applied because it was reported that it may cause crashes instead of display problems in some cases.
There are worse bug reports still open though.

Offline

#7872 2014-09-26 05:05:16

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

Re: Conky v1.9 Thread

OhF!sh! wrote:

Guys, guys. I'm trying to create a simple Conky that appears when I click on the date (located in my tint2 bar). This should show multiple reminders separated by columns, but I can't think of a way to vertically align the reminders! 8.(

http://i.imgur.com/opXVvpAs.png

${voffset} will not work, because the output of each reminder varies in height... I need an absolute value.

I've thought about some "insane" solutions like to join all outputs in a text file or even use LUA, but I'm not so skilled.

What I'm REALLY trying to avoid is having to create 7 conkys, one for each day... I believe this is unnecessary. (And c'mon... 7?!)


7 is cool, my conky startup bash script starts 13 on various workspaces, and one of them is a 'remind' conky - to remind me of what's happening "today" and this "month".

You could switch to a vertical conky.  I think you'll have a problem with the horizontal since you output varies between 2 and 5 lines - that we can see at least.
2014_09_26_01_58_37_532x387_Sector11.jpg


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

Offline

#7873 2014-09-26 13:39:24

syntaxerror
Member
Registered: 2014-09-08
Posts: 30

Re: Conky v1.9 Thread

OhF!sh! wrote:

Guys, guys. I'm trying to create a simple Conky that appears when I click on the date (located in my tint2 bar). This should show multiple reminders separated by columns, but I can't think of a way to vertically align the reminders! 8.(

...
So, can anyone help me on this?

Yes I think I do have an idea how to solve your issue...

However, I don't know much of "reminder" and its syntax at all (nor am I too keen on RTFM since I don't use reminders)
Could you please provide me a .reminder file (need not be anything sensible, just one I can parse; most importantly it should have varying amount of lines)

Offline

#7874 2014-09-26 16:00:47

OhF!sh!
Member
Registered: 2014-09-26
Posts: 18

Re: Conky v1.9 Thread

Sector11 and syntaxerror. I... I DID IT!

I went to sleep thinking about the idea of creating a "table" with the rem outputs, but I'm just TERRIBLE with awk and sed so I thought it was impossible for me alone. But after much googling I found a ridiculously simple solution!

1. Create output files with the proper ${goto} in bash;

rem -g | sed -e '1d;2d' >> /tmp/rem0
rem -g $(date +%Y/%m/%d -d "+1 days") | sed 's/^/${goto 160}/' | sed -e '1d;2d' >> /tmp/rem1
[...]

2. Merge the outputs;

paste /tmp/rem0 /tmp/rem1 [...] >> ~/.conky/rem_table

3. And finally print the table on Conky!

The code is even shorter and clean than before! I feel really stupid, but at the same time victorious... LOL.

Thaaankz, guys. big_smile

PS: The actual .reminders file is much larger so a horizontal conf wouldn't suit, also I forgot to put one more day. LOL! Anyway... It's fixed now.  smile


I definitely need to learn Lua. 8.(

Offline

Help fund CrunchBang, donate to the project!

#7875 2014-09-26 17:14:21

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

Re: Conky v1.9 Thread

OhF!sh! wrote:

The code is even shorter and clean than before! I feel really stupid, but at the same time victorious... LOL.

Thaaankz, guys. big_smile

PS: The actual .reminders file is much larger so a horizontal conf wouldn't suit, also I forgot to put one more day. LOL! Anyway... It's fixed now.  smile

You're welcome.  I realize a ~/.reminders file can be quite long, mine is 55 lines, but if you add appointments etc. oh yea ... big!

I use mine for birthdays (ß) and anniversaries (@) and a couple of things that repeat at a certain time every month, like The €agle Flies - the third last working day of every month.  I have that plus the working day before the 15th of Dec

# 3rd last working day of the month: The €agle Flies
REM 1 -3 OMIT Sat Sun MSG The €agle Flies
# Working day before the 15th of Dec
REM 15 Dec -1 OMIT Sat Sun MSG ßaby €agle Ŧlies

I would really like to see the finished conky when you're finished.

You've done things with remind I never even thought of ... I'k horrible with sed and such ... most commands come from others helping and of course research.

If you think yours is simple ... mine will blow you away:  lol

# pkill -xf "conky -c /media/5/Conky/S11_Rem_Cal.conky" &
# conky -c /media/5/Conky/S11_Rem_Cal.conky &
# To use #! in a conky use: ${exec echo '#!'}
# Reminder fix compliments: Reid Thompson
###  Begin Window Settings  ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
#own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_class Conky
own_window_title Remind Calendar
#own_window_colour gray
### ARGB can be used for real transparency
own_window_argb_visual yes
own_window_argb_value 125

# 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

minimum_size 190 0     ## width, height
maximum_width 190      ## width, no smaller than minimum width

gap_x 5 # left-right
gap_y 5 # up-down

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

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

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
draw_shades yes #no # amplifies text if yes
default_shade_color 000000

draw_outline no # amplifies text if yes
default_outline_color 000000

#default_color DCDCDC #220 220 220	Gainsboro
#default_color C0C0C0 #192 192 192 Silver
#default_color 778899 #119 136 153	LightSlateGray
default_color B0E0E6 #176 224 230 PowderBlue
color0 8FBC8F #143 188 143	DarkSeaGreen
color1 778899 #119 136 153	LightSlateGray
color2 D8BFD8 #216 191 216	Thistle
color3 9ACD32 #154 205  50	YellowGreen
color4 FFA07A #255 160 122	LightSalmon
color5 FFDEAD #255 222 173	NavajoWhite
color6 00BFFF #  0 191 255	DeepSkyBlue
color7 5F9EA0 # 95 158 160	CadetBlue
color8 BDB76B #189 183 107	DarkKhaki
color9 CD5C5C #205  92  92	IndianRed
#####################################################  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
#default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background yes

# 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 none

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

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


### REMINDER NOTE ###
# ~/.reminders - permissions must be:
#Owner: username
#Access: Read & Write
#Group: username
#Access: Read only
#Others: Read only
### REMINDER NOTE ###

update_interval 1
TEXT
${font monofur:size=20}${alignc}${color6}Easter${color}${font}
${alignc}${pre_exec ncal -e}
${color7}${hr}${color}
${goto 32}SU MO ${color6}${time %b %Y}${color} FR SA
${goto 32}${color}${execpi 7200 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | sed ':a;N;$!ba;s/\n/\n${goto 32}/g'}${color}
${color7}${hr}
${font monofur:size=20}${alignc}${color6}Today${color}${font}
${pre_exec remind -q -r ~/.reminders | fold -sw70 | sed -e "/.*(today):/d" -e '/^$/d'}
${color7}${hr}
${font monofur:size=20}${alignc}${color6}This Month${color}${font}
${pre_exec rem -s | cut -c9-10,19-}
${color7}${hr}${color}
${pre_exec head /media/5/Conky/Days/all.txt -n 37}
${hr}

2014_09_26_13_30_37_201x904_Sector11.jpg


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

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