SEARCH

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

You are not logged in.

#726 2012-03-04 21:11:24

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: The New Monster Conky Thread

The password and usernames are not setup or called within that script...

You would have it in your conky like this

${color #7D8C93}GMail   - ${execpi 15 python ~/gmail_parser.py Your_Gmail_Account Your_Gmail_Account_Password 3}

If you post your conky I will work with it to test it for you

In my conky that line is just below TEXT


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

Help fund CrunchBang, donate to the project!

#727 2012-03-04 22:01:24

Behemoth
#! Member
Registered: 2008-12-17
Posts: 57

Re: The New Monster Conky Thread

Ahh, gotcha. I see that now lol..

Here is my .conkyrc

# Use Xft?
use_xft yes
xftfont Terminus:size=6
xftalpha 0.8
text_buffer_size 2048

# Update interval in seconds
update_interval 1

# 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_transparent yes
    own_window_type desktop
    own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

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

# Minimum size of text area
minimum_size 150 150


# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
border_margin 5

# border width
border_width 1

# Default colors and also border colors
default_color white
#default_shade_color black
#default_outline_color white
own_window_colour 333333

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

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 35
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

# number of net samples to average
# set to 1 to disable averaging
net_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 none

TEXT 
${color 66FF00}
CPU: ${color}${color 8f8f8f}${cpubar 3 75 cpu0}${color}${color 66FF00}
RAM: ${color}${color 8f8f8f}${membar 3 75 mem}${color}${color 66FF00}
ROOT: ${color}${color 8f8f8f}${fs_free /} / ${fs_size /}     ${color 66FF00}BACKUP: ${color}${color 8f8f8f}${fs_free /media/usb0} / ${fs_size /media/usb0}${color}${color 66FF00}
TEMP: ${color}${color 8f8f8f}${acpitemp}C     ${color}${color 66FF00}LOAD: ${color}${color 8f8f8f}${loadavg 1|2|3}    ${color}${color 66FF00}GMAIL: ${color}${color #8f8f8f} - ${execpi 15 python ~/gmail_parser.py *** 3}
${color 8f8f8f}${downspeedgraph wlan0 30,140}   ${upspeedgraph wlan0 30,140}${color}

Linux User #480198
Crunchbang Web Badge

Offline

#728 2012-03-04 23:01:18

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: The New Monster Conky Thread

^ That all should work providing you have your gmail login name and password correct along with having python-feedparser installed

Just to be sure...

${execpi 15 python ~/gmail_parser.py *** 3}

should be something like this

${execpi 15 python ~/gmail_parser.py vastone ***pw***** 3}

You also have to make sure gmail_parser.py is executable

chmod +x /path/to/gmail_parser.py

VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#729 2012-03-05 00:16:21

Behemoth
#! Member
Registered: 2008-12-17
Posts: 57

Re: The New Monster Conky Thread

Brilliant! That worked perfectly. Thanks man!


Linux User #480198
Crunchbang Web Badge

Offline

#730 2012-03-05 00:17:14

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: The New Monster Conky Thread

^ Coitenly... 

Glad you got it going...


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#731 2012-03-05 02:26:55

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,726

Re: The New Monster Conky Thread

Working on a template for MrPeachy's Interactive Weather-v9000
23f4d1178132583.jpg
(MrPeachy I will post the template sometime tomorrow)

Offline

#732 2012-03-05 13:13:51

kiiroitori
#! CrunchBanger
From: Tokyo, Japan
Registered: 2010-12-07
Posts: 226

Re: The New Monster Conky Thread

I am back to post the output of what happened on page 28 big_smile

Basically I wanted a simple very way to display hard disk activity on my minimal conky set-up and MrPeachy provided a cool lua solution. Also a special thanks to Sector11 and PackRat for looking into the problem as well!

What happens below is that when the hdd is being read or written, "read" or "write" light up in bright FFFFFF white! Check the bottom left on the screenshot!

tY3h1dQ

Not very spectacular but exactly what I wanted:)


I love #! more than my own kids. I told them and they sympathized.

Offline

#733 2012-03-07 03:45:34

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: The New Monster Conky Thread

just playing around with some buttons and some cli programs
need to come up with a concept that i can sink my teeth into (like falldowns cyber weather concept)

http://youtu.be/n61HPDPKE_k

still many things to figure out and improve!

Last edited by mrpeachy (2012-03-07 03:46:29)

Offline

#734 2012-03-09 18:56:46

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: The New Monster Conky Thread

heres another use of conky interaction
sector11's idea for a way to display log files

here it is working
http://youtu.be/AQsWeU3u1HQ

the only thing im thinking of changing is to add the ability to wrap the longer lines

here is a link to the script if you want to try it out
http://dl.dropbox.com/u/19008369/s11buttons.lua.tar.gz

Offline

#735 2012-03-10 00:29:05

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Offline

#736 2012-03-10 01:05:05

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,125
Website

Re: The New Monster Conky Thread

I've been in/out - over/under - up/down - left/right all day ... am I coming or going, I'm not sure?

What I am sure of is the list!

I came up with the idea from JuseBOX on the ARCH forums - and thought mrpeachy's "interactive" LUA script for conky would make a great conky for that!

So lets get this straight; not my idea, not my work, JuseBOX and mrpeachy own this.

It starts:

Click on [Logs] 7b6649178947056.jpg -> the List: 774aa6178981868.jpg

Click on one: 8d9177178947220.jpg -> on [Close] go go back to [Logs] -

Select another: ca38ef178947207.jpg more -> f884b1178947190.jpg

Yup, LUA is more than just a pretty face and eye candy ... it Works for ya!

Now I have to try the folding lines one.

conky

# To use #! in a conky use: ${exec echo '#!'}
# killall conky && conky -c ~/Conky/S11_LOGS.conky &

# WARNING: Change name and passwords on e-mail code if posting!!

###  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_colour brown
own_window_class click_log
own_window_title click_log  ##### NOTE instruction in the LUA script! I changed it!

# 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

### 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
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
#own_window_argb_value 200

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

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

alignment tl #top_right
###################################################  End Window Settings  ###
###  Font Settings  #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Anonymous Pro: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 no
default_shade_color black

draw_outline no # amplifies text if yes
default_outline_color black

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

default_color DCDCDC #Gainsboro
color0 9ACD32 #YellowGreen
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
#####################################################  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 #yes
default_graph_size 15 40
#####################################################  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 none

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

# 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

##############################################  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
#
## Calling the weather script
#
# lua_load ~/v9000/v9000.lua
# lua_draw_hook_post weather
# lua_load ~/Conky/templates/v9003-V-template.lua
#
#starts the lua weather data gathering function, call once at top of conkyrc
##
#######################################################  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


# Load Lua scripts
#lua_load ~/Conky/LUA/clock.lua
#lua_draw_hook_pre draw_clock

lua_load ~/Conky/LUA/s11buttons.lua
lua_draw_hook_pre conky_main


## on blank line after text!
TEXT

s11buttons.lua

--[[conky interactive log messages by mrpeachy 03/12
http://youtu.be/SQVX3sgXdnA
call in conkyrc in a similar manner to this
lua_load /home/mcdowall/lua/filename.lua
lua_draw_hook_pre draw_main

in the conkyrc you also need to add this setting

own_window_title click_log

or you can set your own window title then edit towards the bottom of the script
so that any instances of click_log are replaced with the title you set
avoid spaces in title name


see interactive weather thread on crunchbang forum
link soon

]]

require 'cairo'
start=1
buttons={}
buttons[1]=0
text_table={}
--------------------------------------------------------------------------------
function conky_main()
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)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--#########################################################################################################
--get click coordinates
localx,localy=clickfunction()--dont edit
--##############################################
--SETTINGS #####################################
--set message length
local tail_length=1
commands={
"dmesg",
"/var/log/alternatives.log",
"/var/log/alternatives.log.1",
"/var/log/apt/history.log",
"/var/log/apt/term.log",
"/var/log/ConsoleKit/history",
"/var/log/ConsoleKit/history.1",
"/var/log/dpkg.log",
"/var/log/dpkg.log.1",
"/var/log/fontconfig.log",
"/var/log/installer/hardware-summary",
"/var/log/installer/lsb-release",
"/var/log/nvidia-installer.log",
"/var/log/pm-powersave.log",
"/var/log/pm-powersave.log.1",
"/var/log/sgfxi/sgfxi.log.1",
"/var/log/smxi.log",
"/var/log/Xorg.0.log",
"/var/log/Xorg.1.log",
"/var/log/Xorg.2.log",
}
--setup list table
list={
"dmesg",
"alternatives.log",
"alternatives.log.1",
"apt/history.log",
"apt/term.log",
"ConsoleKit/history",
"ConsoleKit/history.1",
"dpkg.log",
"dpkg.log.1",
"fontconfig.log",
"installer/hardware-summary",
"installer/lsb-release",
"nvidia-installer.log",
"pm-powersave.log",
"pm-powersave.log.1",
"sgfxi/sgfxi.log.1",
"smxi.log",
"Xorg.0.log",
"Xorg.1.log",
"Xorg.2.log",
}
--set list font and size
local list_font="Anonymous Pro"
local list_fsize=12
--set text properties for LOG main button
local log_text="[Logs]"
local log_font="Anonymous Pro"
local log_fsize=12
--set button top left corner coordinates and width/heioght
local log_tlx=20.5
local log_tly=20.5
--need to set the top left corner of the top button in the list
local list_tlx=100.5
local list_tly=20.5
--set gap between buttons
local gap=5
--setup sections###############################
--set topl left coords and size of close button
local tlx_close=300.5
local tly_close=20.5
--set text properties for CLOSE main button
local close_text="[Close]"
local close_font="Anonymous Pro"
local close_fsize=12
--set properties for section display text
local section_font="Anonymous Pro"
local section_fsize=12
local section_blx=20.5
local section_bly=50.5
--set how many lines to show
local max_lines=60
local line_height=12
--END OF SETTINGS ########################################
--########################################################
--calculate number of entries in the above table
number_in_list=#list
--main button, button1 ###################################
--get dimensions of log text
cairo_select_font_face (cr, log_font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, log_fsize)
--get font height
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,log_text,extents)
local log_height=extents.height
local log_width=extents.width
--########################################################
--calculate if click was inside box
if localx>=log_tlx and localx<=log_tlx+log_width and localy>=log_tly and localy<=log_tly+log_height and buttons[1]~=1 then
buttons[1]=1
elseif localx>=log_tlx and localx<=log_tlx+log_width and localy>=log_tly and localy<=log_tly+log_height and buttons[1]==1 then
buttons[1]=0
end
if buttons[1]==1 then
color={1,0,0,1}--set on color red
elseif buttons[1]==0 then
color={1,1,1,1}--offcolor white
end
cairo_set_source_rgba (cr,color[1],color[2],color[3],color[4])
--[[draw the box for positioning purposes, you can comment out the draw commands later
cairo_set_line_width (cr,1)
cairo_rectangle (cr,tlx,tly,width,height)
cairo_stroke (cr)--]]
--write title
cairo_move_to (cr,log_tlx,log_tly+log_height)
cairo_show_text (cr,log_text)
cairo_stroke (cr)
--------------------------------------------------------------------------------------
--if the main button is clicked then all this stuff will happen
if buttons[1]==1 then 
--generate buttons
cairo_select_font_face (cr, list_font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, list_fsize)
--get font height
local getheight_text="the quick brown fox jumps over the lazy dog"
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,getheight_text,extents)
list_height=extents.height--dont localize
for i=1,number_in_list do --use a for loop to generate all the buttons with a single code chunk
--###########################################################
--buttons--##################################################
--calculate width and height based on text and font and fsize
local list_text=list[i]
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,list_text,extents)
local list_width=extents.width
--###########################################################
--calculate if click is inside buttons
    if localx>=list_tlx and localx<=list_tlx+list_width and localy>=list_tly+((gap+list_height)*(i-1)) and localy<=list_tly+((gap+list_height)*(i-1))+list_height and buttons[tostring("button1_"..i)]~=1 then
    buttons[tostring("button1_"..i)]=1
    elseif localx>=list_tlx and localx<=list_tlx+list_width and localy>=list_tly+((gap+list_height)*(i-1)) and localy<=list_tly+((gap+list_height)*(i-1))+list_height and buttons[tostring("button1_"..i)]==1 then
    buttons[tostring("button1_"..i)]=0
    end
if buttons[tostring("button1_"..i)]==1 then
color={1,0,0,1}--set on color red
--also going to turn off all the other buttons
        n=i
        for i=1,number_in_list do
            if i~=n then
            buttons[tostring("button1_"..i)]=0
            end
        end
        buttons[1]=0
else--if buttons[tostring("button1_"..i)]==0 then
color={1,1,1,1}--offcolor white
end
cairo_set_source_rgba (cr,color[1],color[2],color[3],color[4])
--[[draw the box for positioning purposes, you can comment out the draw commands later
cairo_set_line_width (cr,1)
cairo_rectangle (cr,tlx,tly+((gap+height)*(i-1)),width,height)
cairo_stroke (cr)--]]
--------------------------------------------------------------------------------------
--write titles
cairo_move_to (cr,list_tlx,list_tly+((gap+list_height)*(i-1))+list_height)
cairo_show_text (cr,list_text)
cairo_stroke (cr)
end--for loop
end--if main button=1
--############################################################
--activate the function
--get dimensions of close text
cairo_select_font_face (cr, close_font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, close_fsize)
--get font height
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,close_text,extents)
local height_close=extents.height
local width_close=extents.width
for i=1,number_in_list do
    if buttons[tostring("button1_"..i)]==1 then
if get_text~=1 then
text_table={}
--do the thing and put it in table
if i>1 then
    local file = assert(io.open(tostring(commands[i]), "r"))
    for line in file:lines() do 
    table.insert(text_table,line)
    end
    file:close()
    get_text=1
elseif i==1 then
    local file = io.popen(tostring(commands[i]))
    for line in file:lines() do 
    table.insert(text_table,line)
    end
    file:close()
    get_text=1    
end
end
    cairo_set_source_rgba (cr,1,1,1,1)    
    cairo_select_font_face (cr, section_font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, section_fsize)
    for i=1,max_lines do
    cairo_move_to (cr,section_blx,section_bly+((i-1)*line_height))
    cairo_show_text (cr,text_table[i])
    cairo_stroke (cr)    
    end
    cairo_set_source_rgba (cr,1,1,1,1)    
    cairo_select_font_face (cr, list_font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, list_fsize)
    cairo_move_to (cr,list_tlx,list_tly+list_height)
    cairo_show_text (cr,list[i])
    cairo_stroke (cr)    
    --loadstring('button1_'..i..'display("'..section_font..'",'..section_fsize..','..section_blx..','..section_bly..')')()
    --close button- turns everything off back to start position
    --calculate if click was inside box
    if localx>=tlx_close and localx<=tlx_close+width_close and localy>=tly_close and localy<=tly_close+height_close and buttons[2]~=1 then
    buttons[2]=1
    elseif localx>=tlx_close and localx<=tlx_close+width_close and localy>=tly_close and localy<=tly_close+height_close and buttons[2]==1 then
    buttons[2]=0
    end
    if buttons[2]==1 then
    color={1,0,0,1}--set on color red    
            for i=1,number_in_list do
                buttons[tostring("button1_"..i)]=0
            end
            buttons[1]=0
            buttons[2]=0
            get_text=0
    else
    color={1,1,1,1}--offcolor white
    end
    cairo_set_source_rgba (cr,color[1],color[2],color[3],color[4])
    --[[draw the box for positioning purposes, you can comment out the draw commands later
    cairo_set_line_width (cr,1)
    cairo_rectangle (cr,tlx_close,tly_close,width_close,height_close)
    cairo_stroke (cr)--]]
    --write titles
    cairo_select_font_face (cr, close_font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, close_fsize)
    cairo_move_to (cr,tlx_close,tly_close+height_close)
    cairo_show_text (cr,close_text)
    cairo_stroke (cr)
    end--if button =1
end--for i=
--#########################################################################################################
end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end--end main function

function clickfunction()
--start click logging and calculations ##########################################
if start==1 then
xdot=conky_parse("${if_running xdotool}1${else}0${endif}")
    if tonumber(xdot)==1 then
    os.execute("/usr/bin/killall xdotool && echo 'xdo killed' &")
    end
os.execute("xdotool search --name click_log behave %@ mouse-click getmouselocation >> /tmp/xdo &")
start=nil--]]
local f = io.popen("xwininfo -name 'click_log' | grep 'Absolute'")
geometry = f:read("*a")
f:close()
geometry=string.gsub(geometry,"[\n]","")
s,f,abstlx=string.find(geometry,"X%p%s*(%d*)")
s,f,abstly=string.find(geometry,"Y%p%s*(%d*)")
end--if start=1 ######################################
--click calculations #################################
local f=io.open("/tmp/xdo")
click=f:read()
f:close()
    if click~=nil then
    local f = io.open("/tmp/xdo","w")
    f:write("")
    f:close() 
    end--if click=nil
if click==nil then click="x:0 y:0 " end
s,f,mousex=string.find(click,"x%p(%d*)%s")
s,f,mousey=string.find(click,"y%p(%d*)%s")
mousex=tonumber(mousex)
mousey=tonumber(mousey)
localx=mousex-abstlx
localy=mousey-abstly
--END CLICK CALCULATIONS #################################
return localx,localy
end--function

Enjoy!

Last edited by Sector11 (2012-03-10 01:07:45)


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OTHCG'er
StartPage -  protect your privacy | IcyBlack | LinuxBBQ

Offline

#737 2012-03-10 01:12:02

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: The New Monster Conky Thread

^ Excellent work by all on this one! 

Interactive Conky... even the cool kids will catch on to this one eventually


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#738 2012-03-10 01:21:11

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,726

Re: The New Monster Conky Thread

lol
This Interactive lua has consumed my free time the past few days or so!
lol

I think this all part of MrPeachy's Master Plan for World Domination!!
lol

Offline

#739 2012-03-10 01:22:34

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: The New Monster Conky Thread

^ big_smile big_smile big_smile


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#740 2012-03-10 01:23:35

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: The New Monster Conky Thread

falldown wrote:

lol
This Interactive lua has consumed my free time the past few days or so!
lol

I think this all part of MrPeachy's Master Plan for World Domination!!
lol

No! The jig is up!

Peachy awaaayyyyyyyyy!!!

Offline

#741 2012-03-10 01:44:14

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,726

Re: The New Monster Conky Thread

mrpeachy wrote:

No! The jig is up!

Peachy awaaayyyyyyyyy!!!

^ as he types

$ conky_escape

into terminal... pausing momentarily as a large ESCAPE button materializes in the center of his screen... Clicking the button MrPeachy sitting comfortably in his control chair descends slowly into his escape pod... Laughing menacingly !!

Offline

#742 2012-03-10 02:36:55

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,125
Website

Re: The New Monster Conky Thread

mrpeachy wrote:

No! The jig is up!

Peachy awaaayyyyyyyyy!!!

{as the plane drones on.... a voice from nowhere}

mrpeachy, pull the rip cord ... NOW! f13ebe178991006.jpg


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OTHCG'er
StartPage -  protect your privacy | IcyBlack | LinuxBBQ

Offline

#743 2012-03-10 02:37:59

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,125
Website

Re: The New Monster Conky Thread

falldown wrote:

lol
This Interactive lua has consumed my free time the past few days or so!
lol

I think this all part of MrPeachy's Master Plan for World Domination!!
lol

And it's working  big_smile


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OTHCG'er
StartPage -  protect your privacy | IcyBlack | LinuxBBQ

Offline

#744 2012-03-11 00:21:34

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,726

Re: The New Monster Conky Thread

Here is the first part of the "cyber Interactive weather concept"

http://youtu.be/sHGt4Bns7Iw <-- fade in display

and

http://youtu.be/qhMFikc66rY <-- sliding from center display

Help decide which one looks better.

Last edited by falldown (2012-03-11 05:20:15)

Offline

#745 2012-03-11 09:06:38

barkbombardier
#! Member
Registered: 2011-09-07
Posts: 77

Re: The New Monster Conky Thread

Hello all. Have a idea probably not a good thing for me to think anyway!:lol:
But we can do random wallpapers,is there a way to do random conkys? Feel free to hate on me for thinking of something that might drive us conky addicts nuts!:lol:

Offline

#746 2012-03-11 10:45:42

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: The New Monster Conky Thread

That is part of what this thread is for, to show off your conky and it's sources, if that is what you mean.


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#747 2012-03-11 13:05:12

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,125
Website

Re: The New Monster Conky Thread

falldown wrote:

http://youtu.be/sHGt4Bns7Iw <-- fade in display

My choice!


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OTHCG'er
StartPage -  protect your privacy | IcyBlack | LinuxBBQ

Offline

#748 2012-03-11 13:21:51

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,125
Website

Re: The New Monster Conky Thread

barkbombardier wrote:

Hello all. Have a idea probably not a good thing for me to think anyway!:lol:
But we can do random wallpapers,is there a way to do random conkys? Feel free to hate on me for thinking of something that might drive us conky addicts nuts!:lol:


I'm sure it's possible.  With cron jobs.  Don't ask me how, I just know that people setup cron jobs to do backups.  So why not one that runs a bash scripts at:

03:00 = 03.sh, 06:00 = 06.sh, 09:00 = 09.sh, 12:00 = 12.sh, 15:00 = 15.sh, 18:00 = 18.sh, 21:00 = 21.sh and 00:00 = 00.sh

That's pretty drastic, I think:

Mon.sh, Tue.sh, Wed.sh, Thu.sh, Fri.sh, Sat.sh and Sun.sh would probably be better.

Each bash script would "kill all conky" if running and then start a conky.

Mon.sh

#!/bin/sh
if [ "$(pidof conky)" ]; then
    killall conky
conky -c ~/Conky/monday-conky &
    exit
else
conky -c ~/Conky/monday-conky &
    exit
fi

... I think you can see where this is going.


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OTHCG'er
StartPage -  protect your privacy | IcyBlack | LinuxBBQ

Offline

#749 2012-03-11 16:26:10

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,125
Website

Re: The New Monster Conky Thread

Found this neat 1280x1024 wallpaper, and got to thinking...
... so I removed             the hammer and wrench
0602c1179269244.jpg  6bb815179269249.jpg

... and created the domino clock,
... with, or               without rings.
162bb8179269269.jpg  155c2e179269261.jpg

Conky my wife likes in sin rings!

# To use #! in a conky use: ${exec echo '#!'}
# killall conky && conky -c ~/Conky/S11_Dominos.conky &

###  Begin Window Settings  ##################################################
own_window yes
own_window_type override #normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_colour yellow
own_window_class Domino Clock
own_window_title Domino Clock

# 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

### 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
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
#own_window_argb_value 200

minimum_size 372 367     ## width, height
maximum_width 372       ## width, usually a good idea to equal minimum width

gap_x 748 # left-right
gap_y 138 # up-down

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

# 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 no
default_shade_color black

draw_outline 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 9ACD32 #YellowGreen
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
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 0
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no #yes
default_graph_size 15 40
#####################################################  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 none

# 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, it pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

cpu_avg_samples 1                    
net_avg_samples 1

##############################################  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_post draw_bg 10 0 0 0 0 0xffffff 0.8
#
##
#######################################################  End LUA Settings  ###

default_bar_size 120 20 # reverse to commandline and no comma:  ${cpubar 20,102}

# 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

lua_load ~/Conky/LUA/domino_hands.lua
lua_draw_hook_pre clock_rings

## requires one blank line after TEXT
TEXT

domino_hands.lua

--[[
Clock Rings by londonali1010 (2009)
Edited by SuiCiDeSiNiSTeR (2012)
Edited by Sector11 for the "Time to be Creative Domino Clock" (11 Mar 2012)

This script draws percentage meters as rings, and also draws clock hands if you want! It is easily customized; all options are described in the script. This script is based off a combination of my clock.lua script and my rings.lua script.

IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement near the end of the script uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num > 5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num > 3; conversely if you update Conky every 0.5s, you should use update_num > 10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.

To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
    lua_load ~/scripts/clock_rings-v1.1.1.lua
    lua_draw_hook_pre clock_rings

Changelog:
+ v1.1.1 -- Fixed minor bug that caused the script to crash if conky_parse() returns a nil value (20.10.2009)
+ v1.1 -- Added colour option for clock hands (07.10.2009)
+ v1.0 -- Original release (30.09.2009)
]]

settings_table = {   -- if you want rings, open the tables
-- NOTE:  The settings_table must exist - even if empty.
--[[    {
        -- Edit this table to customise your rings.
        -- You can create more rings simply by adding more elements to settings_table.
        -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
        name='time',
        -- "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 ''.
        arg='%I', --arg='%I.%M',
        -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
        max=12,
        -- "bg_colour" is the colour of the base ring.
        bg_colour=0xffffff,
        -- "bg_alpha" is the alpha value of the base ring.
        bg_alpha=0.1,
        -- "fg_colour" is the colour of the indicator part of the ring.
        fg_colour=0xffffff,
        -- "fg_alpha" is the alpha value of the indicator part of the ring.
        fg_alpha=0.2,
        -- "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.
        x=186, y=186,
        -- "radius" is the radius of the ring.
        radius=170,
        -- "thickness" is the thickness of the ring, centred around the radius.
        thickness=15,
        -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
        start_angle=0,
        -- "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 than start_angle.
        end_angle=360
    },
    {
        name='time',
        arg='%M',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xffffff,
        fg_alpha=0.2,
        x=186, y=186,
        radius=150,
        thickness=15,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%S',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xffffff,
        fg_alpha=0.2,
        x=186, y=186,
        radius=130,
        thickness=15,
        start_angle=0,
        end_angle=360
    }, ]]
}  -- end of settings_table - must exist

-- Use these settings to define the origin and extent of your clock.

clock_r=180

-- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window.

clock_x=186
clock_y=186

-- Colour & alpha of the clock hands

clock_colour=0xffffff
clock_alpha=0.7

-- Do you want to show the seconds hand?

show_seconds=true

require 'cairo'

function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

function draw_ring(cr,t,pt)
    local w,h=conky_window.width,conky_window.height

    local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
    local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']

    local angle_0=sa*(2*math.pi/360)-math.pi/2
    local angle_f=ea*(2*math.pi/360)-math.pi/2
    local t_arc=t*(angle_f-angle_0)

    -- Draw background ring

    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    cairo_set_line_width(cr,ring_w)
    cairo_stroke(cr)

    -- Draw indicator ring

    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    cairo_stroke(cr)
end

function draw_clock_hands(cr,xc,yc)
    local secs,mins,hours,secs_arc,mins_arc,hours_arc
    local xh,yh,xm,ym,xs,ys

    secs=os.date("%S")
    mins=os.date("%M")
    hours=os.date("%I")

    secs_arc=(2*math.pi/60)*secs
    mins_arc=(2*math.pi/60)*mins+secs_arc/60
    hours_arc=(2*math.pi/12)*hours+mins_arc/12

    -- Draw hour hand

    xh=xc+0.7*clock_r*math.sin(hours_arc)
    yh=yc-0.7*clock_r*math.cos(hours_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xh,yh)

    cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    cairo_set_line_width(cr,5)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(clock_colour,clock_alpha))
    cairo_stroke(cr)

    -- Draw minute hand

    xm=xc+clock_r*math.sin(mins_arc)
    ym=yc-clock_r*math.cos(mins_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xm,ym)

    cairo_set_line_width(cr,3)
    cairo_stroke(cr)

    -- Draw seconds hand

    if show_seconds then
        xs=xc+clock_r*math.sin(secs_arc)
        ys=yc-clock_r*math.cos(secs_arc)
        cairo_move_to(cr,xc,yc)
        cairo_line_to(cr,xs,ys)

        cairo_set_line_width(cr,1)
        cairo_stroke(cr)
    end
end

function conky_clock_rings()
    local function setup_rings(cr,pt)
        local str=''
        local value=0

        str=string.format('${%s %s}',pt['name'],pt['arg'])
        str=conky_parse(str)

        value=tonumber(str)
        if value == nil then value = 0 end
        pct=value/pt['max']

        draw_ring(cr,pct,pt)
    end

    -- Check that Conky has been running for at least 5s

    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)

    local cr=cairo_create(cs)    

    local updates=conky_parse('${updates}')
    update_num=tonumber(updates)

    if update_num>5 then
        for i in pairs(settings_table) do
            setup_rings(cr,settings_table[i])
        end
    end

    draw_clock_hands(cr,clock_x,clock_y)
end

Again - my thanks to SiNiSTeR


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OTHCG'er
StartPage -  protect your privacy | IcyBlack | LinuxBBQ

Offline

Help fund CrunchBang, donate to the project!

#750 2012-03-11 16:30:58

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

Re: The New Monster Conky Thread

Sector11 wrote:

Found this neat 1280x1024 wallpaper, and got to thinking...
... so I removed             the hammer and wrench
0602c1179269244.jpg  6bb815179269249.jpg

... and created the domino clock,
... with, or               without rings.
162bb8179269269.jpg  155c2e179269261.jpg

Conky my wife likes in sin rings!

...

Looks good.

Anybody tell you that you got too much time on your hands! lol

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