SEARCH

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

You are not logged in.

#701 2012-08-23 15:16:59

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

Re: interactive conky

^ That would still have window decorations, though it would be better than vlc for what falldown wants to do.
I think that package does not have the buggy built-in mplayer GUI complied in.

Offline

Help fund CrunchBang, donate to the project!

#702 2012-08-23 15:35:05

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

Re: interactive conky

correct on vlc.. still has a thin border after undecorated.
S11 gave me a great idea, but doing it the way I wanted sends the cpu usage up because of the amount of images..
so I am thinking bash video.

Last edited by falldown (2012-08-23 15:42:13)

Offline

#703 2012-08-23 16:44:52

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

Re: interactive conky

falldown wrote:

Peachy my good friend.
Can your timer script be converted into a continuous loop?

a continuous loop would be quite easy
something like

updates=conky_parse("${updates}")
loop_length=10
step=(updates %loop_length)

then step will count = 0 to 9 continuously

Offline

#704 2012-08-23 17:34:05

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

Re: interactive conky

^ thank you sir!!
Hope you are feeling better today smile

##I PLAYED A VIDEO FROM CONKY!!!##
I am not sure if it is the first time it has been done, but I am excited either way!!

It needs alot of work..
Button won't close until video has finished..
ugly text across the screen..
and mplayer opens above windows until you highlight window.

I will put a video up in a bit!!

also
The left side conky (the one with video) stops responding.

Last edited by falldown (2012-08-23 17:43:10)

Offline

#705 2012-08-23 17:46:41

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

Re: interactive conky

falldown wrote:

^ thank you sir!!
Hope you are feeling better today smile

##I PLAYED A VIDEO FROM CONKY!!!##
I am not sure if it is the first time it has been done, but I am excited either way!!

It needs alot of work..
Button won't close until video has finished..
ugly text across the screen..
and mplayer opens above windows until you highlight window.

I will put a video up in a bit!!

also
The left side conky (the one with video) stops responding.

The conky button won't close or some other button?
What text is on the screen?
The window opening problem sounds like a layering issue, seeing the video will help me understand it better.

The conky not responding sounds related to the button issue.
Could you post the line you are using to start mplayer?
I think I know what the problem is but I need to see the line to be sure.

Offline

#706 2012-08-23 17:50:06

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

Re: interactive conky

Here is the video...
http://youtu.be/iXOPVcf-yK4

And I will grab the other info you requested.

Here is the bash..

#!/bin/bash

# conky-video
# calculate width in %
# get screen width in pixels
widthpx=`xrandr | grep "*" | sed -r 's/^([^.]+).*$/\1/; s/^[^0-9]*([0-9]+).*$/\1/'`
# get 47% of that (just some number, use what you need here)
percentpx=`echo "$widthpx*10/100" | bc`


# open playlist and play
mplayer  -geometry 25%:35% -xy $percentpx -fixed-vo /home/falldown/test-0000.mpeg


# end

And the button I am referring to is the weather button..

Last edited by falldown (2012-08-23 17:55:29)

Offline

#707 2012-08-23 17:59:22

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

Re: interactive conky

^ I also need to see the lua line you use to start that bash script.
I think that is where the problem is.

If the conky is not updating the buttons will not work because the buttons are part of the same script that is stuck.

Offline

#708 2012-08-23 18:05:11

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

Re: interactive conky

weatherbutton..

if weatherbutton==1 then
starty=42
gap=15
ypos=wthb
ypos=starty+ypos
--image({x=5,y=weatherbuttony-10,w=600,h=220,file="/home/falldown/lua/trekv9000opened7.png"})
out({c=0xCD9712,a=1,f="starcine",fs=12,x=10,y=ypos-25,txt=weather_location})
ypos=gap+ypos
image({x=15,y=ypos-15,h=100,w=100,file=now["weather_icon"]})
image({x=100,y=ypos+gap*3,h=35,w=35,file=now["wind_icon"]})
--data titles
ypos=gap+ypos
ypos=gap+ypos
out({c=0x85B4E0,a=1,f="starcine",fs=12,x=132,y=ypos-12,txt="temperature-"})
ypos=gap+ypos
out({c=0x327DC1,a=1,f="starcine",fs=12,x=151,y=ypos-5,txt="feels like-"})
ypos=gap+ypos
out({c=0xFDFDFD,a=1,f="starcine",fs=12,x=130,y=ypos,txt="wind:"})
--out({c=0x327DC1,a=1,f="starcine",fs=14,x=160,y=ypos+gap*2-3,txt="today's"})
out({c=0x327DC1,a=1,f="starcine",fs=12,x=120,y=ypos+gap*2-1,txt="hi:"})
out({c=0x327DC1,a=1,f="starcine",fs=12,x=180,y=ypos+gap*2-1,txt="lo:"})
out({c=0x000000,a=1,f="starcine",fs=12,x=255,y=ypos+gap*4,txt="hum:"})
out({c=0x000000,a=1,f="starcine",fs=12,x=255,y=ypos+gap*2,txt="dp:"})
out({c=0x327DC1,a=1,f="starcine",fs=12,x=65,y=ypos+gap*3,txt="precip:"})
out({c=0x85B4E0,a=1,f="starcine",fs=12,x=68,y=ypos+gap*5,txt="cloud:"})
out({c=0x000000,a=1,f="starcine",fs=11,x=10,y=ypos+gap*2,txt="moon"})
out({c=0x000000,a=1,f="starcine",fs=11,x=10,y=ypos+gap*6,txt="phase"})
--output of data options
ypos=gap+ypos
out({c=0x327DC1,a=1,f="starcine",fs=14,x=10,y=ypos-85,txt=now["conditions_short"]})
ypos=gap+ypos
out({c=0x000000,a=1,f="starcine",fs=20,x=255,y=ypos-68,txt=now["temp"].."°"})
ypos=gap+ypos
out({c=0x000000,a=1,f="starcine",fs=20,x=255,y=ypos-50,txt=now["feels_like"].."°"})
ypos=gap+ypos
out({c=0xFDFDFD,a=1,f="starcine",fs=12,x=175,y=ypos-60,txt=now["wind_mph"]})
out({c=0xFD700A,a=1,x=140,y=ypos-31,txt=high_temp[1].."°"})
out({c=0xBCC5C5,a=1,x=205,y=ypos-31,txt=low_temp[1].."°"})
out({c=0x000000,a=1,x=265,y=ypos+30,txt=now["humidity"].."%"})
out({c=0x000000,a=1,x=275,y=ypos-30,txt=now["dew_point"].."°"})
out({c=0x327DC1,a=1,x=125,y=ypos-15,txt=precipitation[1].."%"})
out({c=0x85B4E0,a=1,x=125,y=ypos+15,txt=cloud_cover[1].."%"})
image({x=20,y=ypos-30,h=50,w=50,file=moon_icon[1]})
out({a=1,txt=conky_parse"${exec ~/lua/conky_video}"})
end--weatherbutton==1 function

Offline

#709 2012-08-23 18:10:48

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

Re: interactive conky

I can take the geometry out of the bash and leave that up to the lua script.

Offline

#710 2012-08-23 18:12:09

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

Re: interactive conky

^^ As far as the freezing and weired text problems this line is your problem.

out({a=1,txt=conky_parse"${exec ~/lua/conky_video}"})

exec prints the text returned by the command and stops all conky updates until the command is done running.
Since mplayer outputs text to the terminal as it plays it explains your text issue.
Since you did not put a " &" after the command it remains attached to the conky process so the update does not end until the mplayer process ends.

Lua has it's own built in way to execute programs you should use those instead, they are much better than the ones in conky.
Use this line instead.

os.execute("~/lua/conky_video &")

I will explain it in a moment.

There are two ways to execute a command in lua.

The first is

os.execute()

which runs a command but does not return any output produced by this command.
The command that is executed is not attached to the conky thread so it won't cause lockups of the lua script.
This is good for running things that are slow or that you don't care about the return value.

The second is

io.popen()

which runs a command and returns anything printed to "stdout" by the command, "stderr" output ends up in the terminal conky is running in.
You use it like this to get the output into a script.

stdout = io.popen("command")
stdout = stdout:read("*a")

This command is attached to the conky thread so it will cause lockups if it takes longer to run than the time remaining in the update interval.
This command is used when you want to run a command and use its output in some way in your lua script.

Last edited by arclance (2012-08-23 18:28:56)

Offline

#711 2012-08-23 18:16:42

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 13,408
Website

Re: interactive conky

falldown wrote:

##I PLAYED A VIDEO FROM CONKY!!!##
I am not sure if it is the first time it has been done, but I am excited either way!!

WOW!
  YIPEEEE!
      Holy Videos, Batman!

man oh man you are amazing!!!!!!!!!!!!!!!!!

Now just how did 'I' give you that idea?

Offline

#712 2012-08-23 18:21:15

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

Re: interactive conky

S11 wrote:

WOW!
  YIPEEEE!
      Holy Videos, Batman!

man oh man you are amazing!!!!!!!!!!!!!!!!!

Now just how did 'I' give you that idea?

Your wallpaper that you suggested sent me on a crazed google search for animated wallpaper which led me here.. big_smile
Good stuff!! lol

Offline

#713 2012-08-23 18:22:51

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

Re: interactive conky

arclance
I am getting the

Conky: llua_do_call: function conky_weather execution failed: /home/falldown/lua/v9000.lua:981: attempt to call field '?' (a nil value)

using the

os.execute("~/lua/conky_video &")

Offline

#714 2012-08-23 18:26:00

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

Re: interactive conky

^ Try replacing the "~" with "/home/yourusername" that might be the problem.
Also try restarting your conky process, it might be global variable issue.
If that does not fix it post line 981 in "/home/falldown/lua/v9000.lua" here so I can see what is causing the problem.

Last edited by arclance (2012-08-23 18:27:49)

Offline

#715 2012-08-23 18:28:51

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

Re: interactive conky

Ok fixed that issue, but now my cpu % shot up 100% and my entire system froze.

edit
A stray { <--bracket needed removed

Last edited by falldown (2012-08-23 18:30:22)

Offline

#716 2012-08-23 18:30:30

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

Re: interactive conky

^ Ah, right that would be because you are starting a new mplayer every second.
You need to add a check so it only starts the movie if it is not already playing.
Sorry I forgot about that.

Give me a second to and I will show you how to do it.

Last edited by arclance (2012-08-23 18:30:51)

Offline

#717 2012-08-23 18:32:00

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

Re: interactive conky

Almost fried my VAIO!!  big_smile

Offline

#718 2012-08-23 18:42:53

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

Re: interactive conky

Okay this checks if your bash script is running and if it is not it starts the script.

local mplayer_running = conky_parse("${if_running -x conky_video}1${else}0${endif}")
if mplayer_running == "0" then
    os.execute("~/lua/conky_video &")
end --# if mplayer_running == "0" then

Put it where the os.execute() line is now, making sure the os.execute() in the new code is the same as the one you are replacing.

If this does not work we will need to check for the mplayer process itself.

You also might need to have the button kill the script/mplayer when it is closed or it the mplayer will stay there.

Offline

#719 2012-08-23 18:48:58

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

Re: interactive conky

if i understand correctly what has been going on, you need an execute type button to activate the movie rather than an on off
you currently have this

click button = button on until it is clicked again
if button is on execute movie script

but this leads to repeated executes if the script which causes the frying

what you need to control the movie is

click button = on
turn movie on
turn button off

Offline

#720 2012-08-23 18:49:27

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

Re: interactive conky

arclance
Nope.. it loads multiple mplayers.
And the whole system goes into slow-mo.

Last edited by falldown (2012-08-23 18:50:24)

Offline

#721 2012-08-23 18:51:27

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

Re: interactive conky

mrpeachy wrote:

if i understand correctly what has been going on, you need an execute type button to activate the movie rather than an on off
you currently have this

click button = button on until it is clicked again
if button is on execute movie script

but this leads to repeated executes if the script which causes the frying

what you need to control the movie is

click button = on
turn movie on
turn button off

So a sub-button for the video?

if weatherbutton==1 then
--videobutton button
local videobuttonx=5
local videobuttony=wthb--425
local videobuttonw=45
local videobuttonbuttonh=45
--more stuff--
if videobutton==1 then
--data stuff--
end

Last edited by falldown (2012-08-23 18:56:52)

Offline

#722 2012-08-23 18:52:39

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 13,408
Website

Re: interactive conky

falldown wrote:
S11 wrote:

WOW!
  YIPEEEE!
      Holy Videos, Batman!

man oh man you are amazing!!!!!!!!!!!!!!!!!

Now just how did 'I' give you that idea?

Your wallpaper that you suggested sent me on a crazed google search for animated wallpaper which led me here.. big_smile
Good stuff!! lol

Hahahahahahaha I'll say it again!
man oh man you are amazing!!

How you got 'animated' out of that I have no idea, but love the results.

Animated wallpapers ... never knew such things existed ... I see now they do.

Glad I could get some creativity flowing.  big_smile

Offline

#723 2012-08-23 18:54:36

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

Re: interactive conky

falldown wrote:

arclance
Nope.. it loads multiple mplayers.
And the whole system goes into slow-mo.

falldown wrote:

So a sub-button for the video?

Okay so the script must end before the mplayer does.
You can either check for the mplayer process or run it with a sub-button.
What do you want to do?

Last edited by arclance (2012-08-23 18:55:00)

Offline

#724 2012-08-23 18:57:25

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

Re: interactive conky

falldown wrote:
mrpeachy wrote:

if i understand correctly what has been going on, you need an execute type button to activate the movie rather than an on off
you currently have this

click button = button on until it is clicked again
if button is on execute movie script

but this leads to repeated executes if the script which causes the frying

what you need to control the movie is

click button = on
turn movie on
turn button off

So a sub-button for the video?

or set up an execute type button with the same size and position as the on/off button
a click there will activate both buttons but as the execute type button turns itself off immediately you only get the video playing once
...unless you were to continuously click the button

one condition would be that once the on/off button is on, that turning it off wouldnt cause the movie to launch (as you would be clicking the exec button again also)

you could do this by

if on_off_button==1 and exec_button==1 then 
play movie
exec_button==0 --turn exec button off
end

Last edited by mrpeachy (2012-08-23 19:01:58)

Offline

Help fund CrunchBang, donate to the project!

#725 2012-08-23 19:12:31

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

Re: interactive conky

How about this..?

if weatherbutton==1 then
--videobutton button
local videobuttonx=5
local videobuttony=wthb--425
local videobuttonw=45
local videobuttonh=45
--calculate if click was inside box
if localx>=videobuttonx and localx<=videobuttonx+videobuttonw and localy>=videobuttony and localy<=videobuttony+videobuttonh and videobutton~=1 then 
videobutton=1 
elseif localx>=videobuttonx and localx<=videobuttonx+videobuttonw and localy>=videobuttony and localy<=videobuttony+videobuttonh and videobutton==1 then 
videobutton=0
end
if weatherbuttonbutton==1 and videobutton==1 then 
os.execute("~/lua/conky_video &")
videobutton==0 --turn videobutton off
end --videobutton function

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