How 2 Write A Cinnamon Applet Using Hover?

Chat about anything related to Linux Mint

How 2 Write A Cinnamon Applet Using Hover?

Postby teslasparks on Tue Jan 01, 2013 9:04 pm

I am trying to write a cinnamon applet that activates when I hover over the icon just like the Scale applet does. In fact, I took the code from Scale (/usr/share/cinnamon/applets/scale@cinnamon.org) and changed only a few things. It works on click but not with hover. I added a new key to org.cinnamon.gschema.xml and recompiled (took a bit to figure that out). To me the only real difference is in the execution function which is now

Code: Select all
    doAction: function() {
        GLib.spawn_command_line_async('/usr/local/bin/slingshot');
    },


I realize this is kind of terse but are no other real differences except for the name of the hover object and the doAction function. How does one write an applet that utilizes hover?

teslasparks
Last edited by teslasparks on Wed Feb 13, 2013 4:39 pm, edited 2 times in total.
teslasparks
Level 1
Level 1
 
Posts: 6
Joined: Thu Dec 20, 2012 12:13 pm

Linux Mint is funded by ads and donations.
 

Re: How Write A Cinnamon Applet Using Hover

Postby nomko on Wed Jan 02, 2013 4:50 am

Best to ask our highly valued member Bimsebasse: memberlist.php?mode=viewprofile&u=70092.
he did a lot of good things for the Cinnamon desktop!

Take a look here: viewtopic.php?f=208&t=96165
MSI GE70-2PE*Quad core Intel Core i7-4710HQ*Kingston 16 GB RAM*Intel 4th Gen. Integr. GPU/NVidia GeForce GTX860M*Qualcomm Atheros Killer E2200/Intel Wireless 3160*Sitecom X5-N600 Router (WLR-5100)
Linux tips and tricks
User avatar
nomko
Level 9
Level 9
 
Posts: 2943
Joined: Sat Feb 25, 2012 7:28 pm
Location: The Hague, The Netherlands

Re: How Write A Cinnamon Applet Using Hover?

Postby teslasparks on Wed Feb 13, 2013 2:18 pm

I finally figured it out. NO, I didn't work on it for last 6 weeks. I just came back to it today and looked again at the various parts with new, fresh eyes. I was a bit too literal when I copied the key for hover in org.cinnamon.gschema.xml and preserved the default value of false. :oops: Scale and Expo have check boxes to implement hover in the cinnamon settings (I can never remember exactly where) but anything else would have to be done in the schema and recompiled. Give cinnamon a restart and you are good to go. Now this gives me pseudo-hotcorners an my top panel with launchpad at one end and Scale at the other. Using cinnamon settings I put Expo in the bottom left and, voile, I have 3 hotcorners. :D

I wrote this for launchpad (also known as slingshot sometimes). I would post this but a person would need to also compile launchpad. I use an older version that is more mac-like than the new version that is, well, completely different. I would accomodate any interest in this but, since I have never done this before, would need some instruction in how to post. I am having a problem with the icon (does not display) but I trust that it is just a minor setback.


t
teslasparks
Level 1
Level 1
 
Posts: 6
Joined: Thu Dec 20, 2012 12:13 pm


Return to Chat about Linux Mint

Who is online

Users browsing this forum: Shunjoss and 8 guests