Subscription date : 05 August 2009
Messages : 285
|
I'm a Ruby enthusiast and could not resist to code some applet to Cairo-Dock. Since this was the first one coded in Ruby, I had no reference how to deal with some specificities such as DBus. So, this applet is not that useful, but personally I'm using it, but I have no hope that much more persons will use it. It is a PowerManager kind of applet. It keeps monitoring the battery charge using threads, show some alert when the charge is critically down. As I said, it is more a proof-of-concept and a union of lots of things that I've learned regarding Ruby, Dbus and Cairo-Dock Dbus interface in this last 3 days.
The applet is using the Battery gauge, but I've made a gauge specifically for RubyBattery. It is a cute ruby being filled as the battery charge increases and emptied as the battery charge decreases. I did commit the gauge files together with the applet.
There is a README file in the RubyBattery applet which shows some informations such as what need to be installed to run the applet, Ruby and some another things. Any doubt, suggestion or anything else, except asking for some money , I would be pleased to received a message from you all.
I will keep myself coding Ruby applets to Cairo-Dock, even if nobody gonna use it
Thanks. |
Subscription date : 05 August 2009
Messages : 285
|
Here is how it looks like
|
fabounet, Thursday 25 March 2010 à 03:41
|
|
Subscription date : 30 November 2007
Messages : 17118
|
hoho, well done !
although I'm not fan of Ruby, it may interest people who knows this language better than Python or Mono.
I'm quite happy to see that the DBus API can be used to make such useful applet
feel free to share your code with other users. |
Subscription date : 05 August 2009
Messages : 285
|
Now I can add the word "Ruby" to the list of languages used for applets in the Wiki. |
fabounet, Thursday 25 March 2010 à 14:20
|
|
Subscription date : 30 November 2007
Messages : 17118
|
yes !
want to put your applet on the site ?
also, would it be possible to make a Ruby version of the Demo applet ?
I already have 4 versions of this applet, they are placed in the sources as boilerplate. |
matttbe, Thursday 25 March 2010 à 15:27
|
|
Subscription date : 24 January 2009
Messages : 12573
|
Can you share your sources ? (a bzr branch, a tarball, or what you want) )
If possible under GNU/GPL3 licence. |
Subscription date : 05 August 2009
Messages : 285
|
@fabounet: I will code the demo in ruby. Actually I began coding the demo, but latter I changed its functionalities to RubyBattery.
@matttbe: I did it, I submitted yesterday to bzr in launchpad under my login "eduardo-mucelli". It is already under GNU/GPL3 and the terms are described in the code.
I proposed merge branch right now.
Thanks |
matttbe, Thursday 25 March 2010 à 16:02
|
|
matttbe, Thursday 25 March 2010 à 18:03
|
|
Subscription date : 24 January 2009
Messages : 12573
|
It's merged
Just : I can't change the gauge and the wrong icon is displayed :
$ acpi
Battery 0: Unknown, 97%
$ acpi -t
Thermal 0: ok, 62.0 degrees C
Thermal 1: ok, 52.0 degrees C |
Subscription date : 05 August 2009
Messages : 285
|
I know why. Your "acpi -t" does not bring the charge informations together with temperature, just the temperature. Mine brings your results of acpi + acpi -t together.
I'm thankful because you pointed this out. I will fix.
Edit: Could you provide me your "acpi -b" result ? |
Subscription date : 05 August 2009
Messages : 285
|
@matttbe: I committed a new version. In order to select a new gauge, change value of "theme" parameter present in RubyBattery.conf file, e.g., "theme = Battery" to "theme = Ruby-Battery". Later, it is necessary to copy the "Ruby-Battery" directory and paste it in "/usr/share/cairo-dock/gauges". Reload the applet and it is done.
In the next version I will ask the user for the gauge and change it in the file. |
ppmt, Friday 26 March 2010 à 02:20
|
|
Subscription date : 29 November 2007
Messages : 3520
|
J'ai ca en mettant a jour avec le script
Installation : Plug-ins Extras
\tCheck dependences
Package `ruby1.8-dev' is not installed and no info is available.
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
dependences_deb.sh: 17: cannot create : Directory nonexistent
Package `ri1.8' is not installed and no info is available.
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
dependences_deb.sh: 17: cannot create : Directory nonexistent
Package `rdoc1.8' is not installed and no info is available.
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
dependences_deb.sh: 17: cannot create : Directory nonexistent
Package `irb1.8' is not installed and no info is available.
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
dependences_deb.sh: 17: cannot create : Directory nonexistent
Package `libreadline-ruby1.8' is not installed and no info is available.
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
dependences_deb.sh: 17: cannot create : Directory nonexistent
Package `rubygems1.8' is not installed and no info is available.
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
dependences_deb.sh: 17: cannot create : Directory nonexistent
Package `acpi' is not installed and no info is available.
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
dependences_deb.sh: 17: cannot create : Directory nonexistent |
Subscription date : 05 August 2009
Messages : 285
|
The Google Translator did not translated the French text properly but I guess you did a script to verify the compatibility of the Ruby installation with the necessary requirements of the plugin. Is this it ? If so, oh, man, that is awesome. Thanks. |
Subscription date : 05 August 2009
Messages : 285
|
@all: I've coded the demo_ruby. In order to push it to LP which one of the commands I do:
1) bzr push lp:~eduardo-mucelli/cairo-dock-plug-ins-extras/demos/demo_ruby or
2) bzr push lp:~eduardo-mucelli/cairo-dock-plug-ins-extras/demo_ruby
Thanks. |
matttbe, Friday 26 March 2010 à 15:26
|
|
Subscription date : 24 January 2009
Messages : 12573
|
Eduardo Mucelli : Could you provide me your "acpi -b" result ? $ acpi -b
Battery 0: Charging, 45%, 00:42:20 until charged
In order to select a new gauge, change value of "theme" parameter present in RubyBattery.conf file, e.g., "theme = Battery" to "theme = Ruby-Battery". Later, it is necessary to copy the "Ruby-Battery" directory and paste it in "/usr/share/cairo-dock/gauges". Reload the applet and it is done.
In the next version I will ask the user for the gauge and change it in the file. The approach should be : In order to use it, just do the following:
- 1 - Copy the Ruby-Battery folder to ~/.config/cairo-dock/extras/gauges/
- 2 - Open the config panel of the applet and change the gauge theme by "Ruby-Battery"
(this is what you can see it the 'cairo-dock-plug-ins-extras' branch)
I committed a new version Where ?
In order to push it to LP which one of the commands I do:
1) bzr push lp:~eduardo-mucelli/cairo-dock-plug-ins-extras/demos/demo_ruby or
2) bzr push lp:~eduardo-mucelli/cairo-dock-plug-ins-extras/demo_ruby
- ~eduardo-mucelli is your pseudo on launchpad
- cairo-dock-plug-ins-extras is the linked branch
- demo_ruby is the name of the branch (what you want -> only one word
@ ppmt: should be ok now (sorry, I was hurry) |
ppmt, Friday 26 March 2010 à 15:27
|
|
Subscription date : 29 November 2007
Messages : 3520
|
matttbe: ok I will try later tonight |
Subscription date : 05 August 2009
Messages : 285
|
@matttbe: I forgot to propose the branch merge. Did it now. Thanks. |
matttbe, Friday 26 March 2010 à 17:02
|
|
Subscription date : 24 January 2009
Messages : 12573
|
Thank you but if I change gauge theme from config panel, I can see that there is a reload but it still uses the Battery theme. |
Subscription date : 05 August 2009
Messages : 285
|
@matttbe: Got it. In this first moment I do not know how to solve this because I do not know how to write to the .conf file. I thought the config panel could edit the value of any parameter from the .conf file. You see the "reload" effect and then I reload the parameters from the .conf file. Anyway, since this parameters were not edited in the .conf file, they are reloaded the same way.
I would like to hear from Fabounet how to deal with the changing of a .conf parameter value through the interface, e.g., config panel. Is there any parameter coming from "on_reload_module" that is not the usual "has config changed" ?
Thanks. |
matttbe, Friday 26 March 2010 à 21:11
|
|
Subscription date : 24 January 2009
Messages : 12573
|
It's easy, you have the 'on_reload_module' signal : Signal received when the module is reloaded.
We receive : a boolean that is true if the config has changed and false if it was just a reload because of a resize.
So about the '.conf' file :
- The script:
- Read it
- Received a signal when it has changed
- Can change it (but not advised)
- The config panel:
- Modify it
- Sent a signal when there is a modification
|
|