SEARCH

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

You are not logged in.

#201 2012-04-07 23:10:38

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

Re: interactive conky

i think grouping sounds a little complicated smile

here is the current state of things
Screenshot_at_2012_04_07_18_01_40.jpg

in the first column (leftmost) is the panel with launcher open and lots of windows open
there are too many windows to fit so the scroll button shows (1/2)
click the scroll button and you are taken to view (2/2) as in the third column

the second column shows the launcher closed up, so that now all my windows will fit ( SCROLL (1/1) )

column 4 is the same as 1 but you can see the change in the appearance indicating the active window
also list select button 3 has been clicked

you can also see where im putting some general info down at the bottom

Last edited by mrpeachy (2012-04-07 23:13:48)

Offline

Help fund CrunchBang, donate to the project!

#202 2012-04-08 02:25:49

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

Re: interactive conky

^ This is really cool Peachy!!

It seems that grouping windows with the same titles would be simple, but that just shows how little I know about lua and coding in general. smile

Offline

#203 2012-04-08 05:03:27

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

Re: interactive conky

@mrpeachy
I don't know lua well enough to separate the button code from all the other things your scripts do myself.
Do you have a simple version of your interactive script posted somewhere?
Hopefully something with only one or two buttons that don't do anything too complicated.

Offline

#204 2012-04-08 15:55:45

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

Re: interactive conky

arclance wrote:

@mrpeachy
I don't know lua well enough to separate the button code from all the other things your scripts do myself.
Do you have a simple version of your interactive script posted somewhere?
Hopefully something with only one or two buttons that don't do anything too complicated.

try this setup
http://dl.dropbox.com/u/19008369/intera … ton.tar.gz

extract so the test_button folder is in your home directory then use the conkyrc "conky_buttons" to launch

gives you an on/off button and an "execute" buttons

Last edited by mrpeachy (2012-04-08 15:56:28)

Offline

#205 2012-04-08 18:22:50

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

Re: interactive conky

Ok Peachy I finally got my randr and xinerama sorted out.
I'm messing around with the Window_List script.

Offline

#206 2012-04-08 22:15:39

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

Re: interactive conky

mrpeachy wrote:

try this setup
http://dl.dropbox.com/u/19008369/intera … ton.tar.gz

extract so the test_button folder is in your home directory then use the conkyrc "conky_buttons" to launch

gives you an on/off button and an "execute" buttons

Thanks I will look at it tommorow when I have more free time.

This is giving me ideas.

deadbeef --help
starting deadbeef devel
Usage: deadbeef [options] [--] [file(s)]
Options:
   --help  or  -h     Print help (this message) and exit
   --quit             Quit player
   --version          Print version info and exit
   --play             Start playback
   --stop             Stop playback
   --pause            Pause playback
   --toggle-pause     Toggle pause
   --play-pause       Start playback if stopped, toggle pause otherwise
   --next             Next song in playlist
   --prev             Previous song in playlist

   --random           Random song in playlist
   --queue            Append file(s) to existing playlist
   --gui PLUGIN       Tells which GUI plugin to use, default is "GTK2"
   --nowplaying FMT   Print formatted track name to stdout
                      FMT %-syntax: [a]rtist, [t]itle, al[ b]um,
                      [l]ength, track[n]umber, [y]ear, [c]omment,
                      copy[r]ight, [e]lapsed
                      e.g.: --nowplaying "%a - %t" should print "artist - title"
                      for more info, see http://sourceforge.net/apps/mediawiki/d … Formatting

I am going to add controls to the bottom of this.
641b4_thumb.png

Offline

#207 2012-04-08 23:30:21

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

Re: interactive conky

falldown wrote:

Ok Peachy I finally got my randr and xinerama sorted out.
I'm messing around with the Window_List script.

i think im getting close to having something usable
been working on consolidating the settings at the top of the script
removing uneccessary code lines and getting everything running as optimally as i know how

still have a couple of things to work out
but i should be able to post some "alpha" code soon

Offline

#208 2012-04-09 01:37:44

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

Re: interactive conky

Thats good cause I'm actually looking for things to do... like upgrading one of my installs to sid!!.. and reading entire threads.. from other distros that I haven't even tried.. lol

Offline

#209 2012-04-09 16:26:13

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

Re: interactive conky

arclance wrote:
mrpeachy wrote:

try this setup
http://dl.dropbox.com/u/19008369/intera … ton.tar.gz

extract so the test_button folder is in your home directory then use the conkyrc "conky_buttons" to launch

gives you an on/off button and an "execute" buttons

Thanks I will look at it tommorow when I have more free time.

I tried it and mouseover works but I can not click on the buttons.

Here is the conky -D output.

conky -DD -c test_button/conky_buttons
DEBUG(0) [../../src/conky.c:5376]: reading contents from config file 'test_button/conky_buttons'
DEBUG(1) [../../src/core.c:1218]: no templates to replace
Conky: desktop window (15d) is root window
DEBUG(0) [../../src/x11.c:240]: Found ARGB Visual
Conky: window type - normal
Conky: drawing to created window (0x2400002)
Conky: drawing to double buffer
DEBUG(1) [../../src/core.c:1218]: no templates to replace
DEBUG(1) [../../src/conky.c:2416]: evaluated '${updates}' to '0'
xdotool: no process found
DEBUG(1) [../../src/core.c:1218]: no templates to replace
DEBUG(1) [../../src/conky.c:2416]: evaluated '${updates}' to '1'

Offline

#210 2012-04-09 16:31:46

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

Re: interactive conky

@ arclance
are you running the conkyrc that was in the archive?

go to your tmp folder and see if the file xdo was created

also in the main script, click_test.lua
put in a test line like this towards the end line 147

--click calculations #################################
local f=io.open("/tmp/xdo")
click=f:read()
f:close()
print (click)

and watch the terminal

Offline

#211 2012-04-09 16:40:12

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

Re: interactive conky

mrpeachy wrote:

@ arclance
are you running the conkyrc that was in the archive?

yes

mrpeachy wrote:

go to your tmp folder and see if the file xdo was created

yes it's there, but its empty

mrpeachy wrote:

also in the main script, click_test.lua
put in a test line like this towards the end line 147

--click calculations #################################
local f=io.open("/tmp/xdo")
click=f:read()
f:close()
print (click)

and watch the terminal

It returns "nil"

conky -DD -c test_button/conky_buttons
DEBUG(0) [../../src/conky.c:5376]: reading contents from config file 'test_button/conky_buttons'
DEBUG(1) [../../src/core.c:1218]: no templates to replace
Conky: desktop window (15d) is root window
DEBUG(0) [../../src/x11.c:240]: Found ARGB Visual
Conky: window type - normal
Conky: drawing to created window (0x2400002)
Conky: drawing to double buffer
DEBUG(1) [../../src/core.c:1218]: no templates to replace
DEBUG(1) [../../src/conky.c:2416]: evaluated '${updates}' to '0'
xdotool: no process found
DEBUG(1) [../../src/core.c:1218]: no templates to replace
DEBUG(1) [../../src/conky.c:2416]: evaluated '${updates}' to '1'
DEBUG(1) [../../src/core.c:1218]: no templates to replace
DEBUG(1) [../../src/conky.c:2416]: evaluated '${updates}' to '2'
DEBUG(1) [../../src/core.c:1218]: no templates to replace
DEBUG(1) [../../src/conky.c:2416]: evaluated '${updates}' to '3'
DEBUG(1) [../../src/core.c:1218]: no templates to replace
DEBUG(1) [../../src/conky.c:2416]: evaluated '${updates}' to '4'
DEBUG(1) [../../src/core.c:1218]: no templates to replace
DEBUG(1) [../../src/conky.c:2416]: evaluated '${updates}' to '5'
DEBUG(1) [../../src/core.c:1218]: no templates to replace
DEBUG(1) [../../src/conky.c:2416]: evaluated '${updates}' to '6'
nil
DEBUG(1) [../../src/core.c:1218]: no templates to replace
DEBUG(1) [../../src/conky.c:2416]: evaluated '${updates}' to '7'
nil
DEBUG(1) [../../src/core.c:1218]: no templates to replace
DEBUG(1) [../../src/conky.c:2416]: evaluated '${updates}' to '8'
nil
DEBUG(1) [../../src/core.c:1218]: no templates to replace
DEBUG(1) [../../src/conky.c:2416]: evaluated '${updates}' to '9'
nil
DEBUG(1) [../../src/core.c:1218]: no templates to replace
DEBUG(1) [../../src/conky.c:2416]: evaluated '${updates}' to '10'
nil
DEBUG(1) [../../src/core.c:1218]: no templates to replace
DEBUG(1) [../../src/conky.c:2416]: evaluated '${updates}' to '11'
nil
DEBUG(1) [../../src/core.c:1218]: no templates to replace
DEBUG(1) [../../src/conky.c:2416]: evaluated '${updates}' to '12'
nil

Last edited by arclance (2012-04-09 16:41:00)

Offline

#212 2012-04-09 16:48:32

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

Re: interactive conky

in the conkyrc

make it like this

TEXT
${lua record}${lua main}

the launch the conky and click inside the window and check the xdo file again

Offline

#213 2012-04-09 17:15:23

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

Re: interactive conky

mrpeachy wrote:

in the conkyrc

make it like this

TEXT
${lua record}${lua main}

the launch the conky and click inside the window and check the xdo file again

/tmp/xdo now contains

Usage: xdotool search [options] regexp_pattern
 --class         check regexp_pattern agains the window class
 --maxdepth N    set search depth to N. Default is infinite.
 --name          check regexp_pattern agains the window name
 --onlyvisible   matches only windows currently visible
 --pid PID       only show windows belonging to specific process
                 Not supported by all X11 applications --screen N      only search a specific screen. Default is all screens
 --title         check regexp_pattern agains the window title
                 -1 also means infinite.
 -h, --help      show this help output

* If none of --title, --class, and --name are specified,
the defaults are to match any of them.

and the conky terminal output now has this in it

Usage: xdotool search [options] regexp_pattern
Conky: llua_do_call: function conky_main execution failed: /home/arclance/test_button/click_test.lua:155: attempt to perform arithmetic on a nil value

Offline

#214 2012-04-09 17:18:27

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

Re: interactive conky

ah... what version of xdotool are you using?

xdotool -v

it has to be an recent version, like this xdotool version 2.20110530.1

many repos only have an old version so you will have to install via the debs
as found on the first post of this thread

Offline

#215 2012-04-09 17:32:10

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

Re: interactive conky

mrpeachy wrote:

ah... what version of xdotool are you using?

xdotool -v

it has to be an recent version, like this xdotool version 2.20110530.1

many repos only have an old version so you will have to install via the debs
as found on the first post of this thread

Yes that was the problem I must have forgotten to add unstable to my sources when I installed xdotool.

Offline

#216 2012-04-09 19:53:00

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

Re: interactive conky

I got the control buttons for Deadbeef working but they are being rendered under the shading image I am using.
0874c_thumb.png
Any ideas on how to fix that?

I have the buttons running in a second conky by themselves for testing.

Here are the files that I am using to make the buttons, I did no make any changes to the other files.
.conkyrc

##############################################
#  Settings for conkyrc_DeadbeefControls by arclance
##############################################
### Position ###
alignment bottom_right
gap_x 210
gap_y 0
minimum_size 250 16
maximum_width 250
### End Position ###

### Borders ###
border_inner_margin 0
border_outer_margin 0
border_width 0
#stippled_borders 0
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no
### End Borders ###

### Window ###
own_window yes
own_window_transparent yes
own_window_argb_visual no
#own_window_argb_value 50
#own_window_class Conky
own_window_type normal
own_window_title clicky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
### End Window ###

### Color ###
#default_color CC9900
default_color CC9900
default_outline_color EE7600
default_shade_color EE7600
#own_window_color 006400
#color0 EE7600
color0 EE7600
color1 EE7600
# red 8B0000
### End Color ###

### Font ###
use_xft yes
#xftfont Monospace:size=10
xftfont DejaVu Sans Mono:size=10
#xftfont Liberation Mono:size=10
#xftfont Ubuntu Mono:size=12
### End Font ###

### Conky Settings ###
double_buffer
background no
update_interval 1.0
cpu_avg_samples 2
net_avg_samples 2
no_buffers yes
out_to_console no
out_to_stderr no
extra_newline no
uppercase no
use_spacer none
show_graph_scale yes
show_graph_range no
text_buffer_size 3000
default_bar_size 432 6
imlib_cache_size 0
top_name_width 10
if_up_strictness address
### End Conky Settings ###

### Lua ###
lua_load /media/Linux_Data/bin/ConkyDeadbeef/Deadbeef_Controls/deadbeefControls.lua
lua_load /media/Linux_Data/bin/ConkyDeadbeef/Deadbeef_Controls/click_record.lua
lua_load /media/Linux_Data/bin/ConkyDeadbeef/Deadbeef_Controls/click_run_last.lua
### End Lua ###

TEXT
${image /media/Linux_Data/bin/Conky/dynamic_background.png -p -1,-1 -s 254x18}${lua record}${lua main}${lua run_last}

Buttons

--[[click tutorial lua by mrpeachy - thanks to barrybarrykelly for the xdotool method and gmonti for finding the deb files for the xdotool
in conkyrc, in addition to regular settings:

own_window_title clicky

TEXT
]]
--# deadbeefControls.lua by arclance

require 'cairo'

main_start=1-- this starts the clickfunction
buttons={}--this table ini9tially holds the values from the buttons

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
--#################################################################################################
localx,localy,localnowx,localnowy=clickfunction()--this line activates the clickfunction and sets the click coordinates
--#################################################################################################

--#################################################################################################
--button setup - this section for an execute type button
local button_name="dbStop"
local blx=10--bottom left x coordinate of click area
local bly=16--bottom left x coordinate of click area
local height=15--height of click area
local width=30--width of click area
--##############################################################
--calculate if click was inside box and set actions#############
--best to keep the button calculations seperate to the actions##
if localx>=blx and localx<=blx+width and localy<=bly and localy>=bly-height and buttons[1]~=1 then
buttons[tostring(button_name)]=1
else
buttons[tostring(button_name)]=0 end
--end of calculations ##########################################
--##############################################################
--use the output of the button to set other conditions #########
--set color based on button, but other things can be set here too such as executing a shell command
if buttons[tostring(button_name)]==1 then
color={(139/255),0,0,1}--if button is clicked on it will be drawn red
fill=0
os.execute ("deadbeef --stop")
else
color={(204/255),(153/255),0,1}--if button is not on it will be drawn white
fill=0
end
font="DejaVu Sans Mono"
fsize=12
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
cairo_set_source_rgba (cr,(238/255),(118/255),0,1)
cairo_move_to (cr,(blx + 1),(bly - 3))
cairo_show_text (cr,"Stop")
cairo_stroke (cr)
--draw the button ####################
buttondraw(blx,bly,height,width,color,fill)
--#################################################################################################

--#################################################################################################
--button setup - this section for an execute type button
local button_name="dbPlay"
local blx=(blx + width + 10)--bottom left x coordinate of click area
local bly=16--bottom left x coordinate of click area
local height=15--height of click area
local width=30--width of click area
--##############################################################
--calculate if click was inside box and set actions#############
--best to keep the button calculations seperate to the actions##
if localx>=blx and localx<=blx+width and localy<=bly and localy>=bly-height and buttons[1]~=1 then
buttons[tostring(button_name)]=1
else
buttons[tostring(button_name)]=0 end
--end of calculations ##########################################
--##############################################################
--use the output of the button to set other conditions #########
--set color based on button, but other things can be set here too such as executing a shell command
if buttons[tostring(button_name)]==1 then
color={(139/255),0,0,1}--if button is clicked on it will be drawn red
fill=0
os.execute ("deadbeef --play")
else
color={(204/255),(153/255),0,1}--if button is not on it will be drawn white
fill=0
end
font="DejaVu Sans Mono"
fsize=12
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
cairo_set_source_rgba (cr,(238/255),(118/255),0,1)
cairo_move_to (cr,(blx + 1),(bly - 3))
cairo_show_text (cr,"Play")
cairo_stroke (cr)
--draw the button ####################
buttondraw(blx,bly,height,width,color,fill)
--#################################################################################################

--#################################################################################################
--button setup - this section for an execute type button
local button_name="dbPause"
local blx=(blx + width + 10)--bottom left x coordinate of click area
local bly=16--bottom left x coordinate of click area
local height=15--height of click area
local width=38--width of click area
--##############################################################
--calculate if click was inside box and set actions#############
--best to keep the button calculations seperate to the actions##
if localx>=blx and localx<=blx+width and localy<=bly and localy>=bly-height and buttons[1]~=1 then
buttons[tostring(button_name)]=1
else
buttons[tostring(button_name)]=0 end
--end of calculations ##########################################
--##############################################################
--use the output of the button to set other conditions #########
--set color based on button, but other things can be set here too such as executing a shell command
if buttons[tostring(button_name)]==1 then
color={(139/255),0,0,1}--if button is clicked on it will be drawn red
fill=0
font="DejaVu Sans Mono"
fsize=12
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
cairo_set_source_rgba (cr,(238/255),(118/255),0,1)
cairo_move_to (cr,(blx + 1),(bly - 3))
cairo_show_text (cr,"Pause")
cairo_stroke (cr)
os.execute ("deadbeef --pause")
else
color={(204/255),(153/255),0,1}--if button is not on it will be drawn white
fill=0
font="DejaVu Sans Mono"
fsize=12
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
cairo_set_source_rgba (cr,(238/255),(118/255),0,1)
cairo_move_to (cr,(blx + 1),(bly - 3))
cairo_show_text (cr,"Pause")
cairo_stroke (cr)
end
--draw the button ####################
buttondraw(blx,bly,height,width,color,fill)
--#################################################################################################


--#################################################################################################
--button setup - this section for an execute type button
local button_name="dbPrevious"
local blx=(blx + width + 10)--bottom left x coordinate of click area
local bly=16--bottom left x coordinate of click area
local height=15--height of click area
local width=31--width of click area
--##############################################################
--calculate if click was inside box and set actions#############
--best to keep the button calculations seperate to the actions##
if localx>=blx and localx<=blx+width and localy<=bly and localy>=bly-height and buttons[1]~=1 then
buttons[tostring(button_name)]=1
else
buttons[tostring(button_name)]=0 end
--end of calculations ##########################################
--##############################################################
--use the output of the button to set other conditions #########
--set color based on button, but other things can be set here too such as executing a shell command
if buttons[tostring(button_name)]==1 then
color={(139/255),0,0,1}--if button is clicked on it will be drawn red
fill=0
os.execute ("deadbeef --prev")
else
color={(204/255),(153/255),0,1}--if button is not on it will be drawn white
fill=0
end
font="DejaVu Sans Mono"
fsize=12
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
cairo_set_source_rgba (cr,(238/255),(118/255),0,1)
cairo_move_to (cr,(blx + 1),(bly - 3))
cairo_show_text (cr,"Prev")
cairo_stroke (cr)
--draw the button ####################
buttondraw(blx,bly,height,width,color,fill)
--#################################################################################################

--#################################################################################################
--button setup - this section for an execute type button
local button_name="dbNext"
local blx=(blx + width + 10)--bottom left x coordinate of click area
local bly=16--bottom left x coordinate of click area
local height=15--height of click area
local width=31--width of click area
--##############################################################
--calculate if click was inside box and set actions#############
--best to keep the button calculations seperate to the actions##
if localx>=blx and localx<=blx+width and localy<=bly and localy>=bly-height and buttons[1]~=1 then
buttons[tostring(button_name)]=1
else
buttons[tostring(button_name)]=0 end
--end of calculations ##########################################
--##############################################################
--use the output of the button to set other conditions #########
--set color based on button, but other things can be set here too such as executing a shell command
if buttons[tostring(button_name)]==1 then
color={(139/255),0,0,1}--if button is clicked on it will be drawn red
fill=0
os.execute ("deadbeef --next")
else
color={(204/255),(153/255),0,1}--if button is not on it will be drawn white
fill=0
end
font="DejaVu Sans Mono"
fsize=12
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
cairo_set_source_rgba (cr,(238/255),(118/255),0,1)
cairo_move_to (cr,(blx + 1),(bly - 3))
cairo_show_text (cr,"Next")
cairo_stroke (cr)
--draw the button ####################
buttondraw(blx,bly,height,width,color,fill)
--#################################################################################################

--#########################################################################################################
end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function

--button drawing function
function buttondraw(blx,bly,height,width,color,fill)
cairo_set_line_width (cr,2)
cairo_set_source_rgba (cr,color[1],color[2],color[3],color[4])
cairo_rectangle (cr,blx,bly,width,-height)
if fill==0 then
cairo_stroke (cr)
elseif fill==1 then
cairo_fill (cr)
end
end--of buttondraw function

--clickfunction, this runs xdotool and xwininfo and reads the coordinates of clicks
function clickfunction()
--start click logging and calculations ##########################################
if main_start==1 then--run at script start 
local f = io.popen("xwininfo -name 'clicky' | grep 'Absolute'")
geometry = f:read("*a")
f:close()
local geometry=string.gsub(geometry,"[\n]","")
--print (geometry)
s,f,abstlx=string.find(geometry,"X%p%s*(%d*)")
s,f,abstly=string.find(geometry,"Y%p%s*(%d*)")
main_start=nil
end--if click_start=1 ######################################
--click calculations #################################
local f=io.open("/tmp/xdo")
click=f:read()
f:close()
if click==nil then click="x:0 y:0 " end
local s,f,mousex=string.find(click,"x%p(%d*)")
local s,f,mousey=string.find(click,"y%p(%d*)")
localx=tonumber(mousex)-abstlx
localy=tonumber(mousey)-abstly
--get now location
local f = io.popen("xdotool getmouselocation")
mousenow = f:read("*a")
f:close()
local s,f,mousenowx=string.find(mousenow,"x%p(%d*)%s")
local s,f,mousenowy=string.find(mousenow,"y%p(%d*)%s")
localnowx=tonumber(mousenowx)-abstlx
localnowy=tonumber(mousenowy)-abstly
--END CLICK CALCULATIONS #################################
return localx,localy,localnowx,localnowy
end--function

Last edited by arclance (2012-04-09 20:07:42)

Offline

#217 2012-04-09 21:29:39

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

Re: interactive conky

you mentioned 2 conkies?

the way you have it set up in the one you posted seems like it should work
ie by having the lua files run AFTER the background is drawn by the ${image} command

is the other conky drawing a background also that might be getting in front of the lua script?

there are some things you could do
make the background part of the lua script, it really easy to draw a semi transparent rectangle with a given color in lua, draw it before anything else and it will go to the background

or i can give you a lua function for displaying images, which you could use instead of the conkyrc method
again, call that first to load the image and the text will be drawn above

check on that other conky first however

Offline

#218 2012-04-09 21:38:04

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

Re: interactive conky

mrpeachy wrote:

you mentioned 2 conkies?

the way you have it set up in the one you posted seems like it should work
ie by having the lua files run AFTER the background is drawn by the ${image} command

is the other conky drawing a background also that might be getting in front of the lua script?

I already checked if the other conky was the problem by putting the buttons somewhere else on screen and it did not change anything.

mrpeachy wrote:

there are some things you could do
make the background part of the lua script, it really easy to draw a semi transparent rectangle with a given color in lua, draw it before anything else and it will go to the background

or i can give you a lua function for displaying images, which you could use instead of the conkyrc method
again, call that first to load the image and the text will be drawn above

check on that other conky first however

The shading image is generated every time my random background script runs (to change the color and transparency of the image) so let's try displaying the image with lua.

Last edited by arclance (2012-04-09 21:40:37)

Offline

#219 2012-04-10 00:00:34

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

Re: interactive conky

here is the function

put this into the main script outside of the main function (probably best to put it underneath like all the other functions)

function image(im)--#################################################################
x=nil
x=(im.x or 0)
y=nil
y=(im.y or 0)
w=nil
w=(im.w or default_image_width)
h=nil
h=(im.h or default_image_height)
file=nil
file=tostring(im.file)
if file==nil then print("set image file") end
---------------------------------------------
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(w)==0 then 
width=imlib_image_get_width() 
else
width=tonumber(w)
end
if tonumber(h)==0 then 
height=imlib_image_get_height() 
else
height=tonumber(h)
end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(x, y)
imlib_free_image()
show=nil
end--function image #################################################################

then in the main function call it like this (before the buttons)

image({x=0,y=0,w=300,h=500,file="/media/Linux_Data/bin/Conky/dynamic_background.png"})

adjust setting to match

Offline

#220 2012-04-10 00:20:46

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

Re: interactive conky

mrpeachy wrote:

here is the function

That works but you forgot about adding

require 'imlib2'

Offline

#221 2012-04-10 00:25:45

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

Re: interactive conky

arclance wrote:
mrpeachy wrote:

here is the function

That works but you forgot about adding

require 'imlib2'

indeed i did!
good that you are n the ball arclance smile

Offline

#222 2012-04-10 02:00:50

gutterslob
#! Resident Bum
Registered: 2009-11-03
Posts: 3,207

Re: interactive conky

mrpeachy wrote:

here is the current state of things
Screenshot_at_2012_04_07_18_01_40.jpg

Sweet Mother of Ganja!! O_O


Point & Squirt

Offline

#223 2012-04-10 02:05:50

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

Re: interactive conky

gutterslob wrote:
mrpeachy wrote:

here is the current state of things
Screenshot_at_2012_04_07_18_01_40.jpg

Sweet Mother of Ganja!! O_O

ill take that as a compliment lol

Offline

#224 2012-04-10 02:17:37

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

Re: interactive conky

mrpeachy wrote:
gutterslob wrote:
mrpeachy wrote:

here is the current state of things
Screenshot_at_2012_04_07_18_01_40.jpg

Sweet Mother of Ganja!! O_O

ill take that as a compliment lol

And you'd be right too.  You and falldown lost me a long time ago with this interactive stuff.

You are doing GREAT stuff. Believe it!  This isn't Ripley's there is no "Or Not!"


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

Offline

Help fund CrunchBang, donate to the project!

#225 2012-04-10 17:22:28

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

Re: interactive conky

thanks sector11!

if you want to give my panel a go here is the archive
extrat to your home/username folder
and run with the provided conkyrc (conky_launch)

see later post for fixed archive

and here it is with a bit of additional setup
Screenshot_at_2012_04_10_12_50_01.jpg

have my first launch list done

Last edited by mrpeachy (2012-04-10 18:12:40)

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