Open an applet from cli

Forum rules
Before you post please read how to get help
Post Reply
User avatar
daffa
Level 1
Level 1
Posts: 10
Joined: Fri Mar 16, 2018 9:55 pm
Location: Indonesia

Open an applet from cli

Post by daffa » Mon Apr 02, 2018 12:56 am

Is it possible to open an applet (like you usually do with clicking it) from cli? Does there is any command or script to do it? I'm running Linux Mint 18.3 64 bit with Cinnamon 3.6.7 (Gtk 3.18.9-1ubuntu3.3)

User avatar
xenopeek
Level 24
Level 24
Posts: 22651
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Open an applet from cli

Post by xenopeek » Mon Apr 02, 2018 2:47 am

Not that I know. The Cinnamon panel doesn't have a command line interface. There's a tool called xdotool with which you can fake keyboard or mouse input which you could use to open the applet by programming what you'd do normally.
Image

User avatar
daffa
Level 1
Level 1
Posts: 10
Joined: Fri Mar 16, 2018 9:55 pm
Location: Indonesia

Re: Open an applet from cli

Post by daffa » Thu Apr 05, 2018 7:45 am

xenopeek wrote:
Mon Apr 02, 2018 2:47 am
Not that I know. The Cinnamon panel doesn't have a command line interface. There's a tool called xdotool with which you can fake keyboard or mouse input which you could use to open the applet by programming what you'd do normally.
That's not really what i'm looking for, but rather a smart trick (or workaround). I'll give it a shot anyway. A real command command would be nice though. Could this possible through extension?

Cosmo.
Level 23
Level 23
Posts: 17830
Joined: Sat Dec 06, 2014 7:34 am

Re: Open an applet from cli

Post by Cosmo. » Thu Apr 05, 2018 9:38 am

I don't think, that any of the spices (applets, desklets, extensions) have an API for that.

User avatar
daffa
Level 1
Level 1
Posts: 10
Joined: Fri Mar 16, 2018 9:55 pm
Location: Indonesia

Re: Open an applet from cli

Post by daffa » Thu Apr 05, 2018 11:56 am

Cosmo. wrote:
Thu Apr 05, 2018 9:38 am
I don't think, that any of the spices (applets, desklets, extensions) have an API for that.
Well, that leave me with that workaround then. Anyway, i was going to make a script that will open sound applet when user press volume up/down on their keyboard and there is any audio/video playing, then close the applet after a few second. Pretty much like in windows 10.

User avatar
xenopeek
Level 24
Level 24
Posts: 22651
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Open an applet from cli

Post by xenopeek » Thu Apr 05, 2018 12:03 pm

Depending on how comfortable you're with Javascript programming, it may be easier to just take the existing sound applet and edit its code to work as you want.
Image

User avatar
daffa
Level 1
Level 1
Posts: 10
Joined: Fri Mar 16, 2018 9:55 pm
Location: Indonesia

Re: Open an applet from cli

Post by daffa » Fri Apr 06, 2018 3:48 am

Well, i code in javascript mostly. Does it possible to make an applet that able to react with keyboard? Could you give me a link to a wiki or tutorial?

User avatar
xenopeek
Level 24
Level 24
Posts: 22651
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Open an applet from cli

Post by xenopeek » Fri Apr 06, 2018 4:27 am

New developer documentation is being worked on I think. For now you can check the extension system links here: http://developer.linuxmint.com/referenc ... index.html. All the applets are open source and hosted in Linux Mint's GitHub repositories. The official applets are on Cinnamon https://github.com/linuxmint/Cinnamon/t ... on/applets. Applets developed by others are on https://github.com/linuxmint/cinnamon-spices-applets. You could look for another applet that does something like you want to do and study the code. (Mind that the links go to development versions, you can of course just install any applets you want to study and then access the code on your own system that way.)
Image

Cosmo.
Level 23
Level 23
Posts: 17830
Joined: Sat Dec 06, 2014 7:34 am

Re: Open an applet from cli

Post by Cosmo. » Fri Apr 06, 2018 6:41 am

daffa wrote:
Thu Apr 05, 2018 11:56 am
Anyway, i was going to make a script that will open sound applet when user press volume up/down on their keyboard and there is any audio/video playing, then close the applet after a few second. Pretty much like in windows 10.
Why so complicated in this case? If the user changes the volume via keyboard the sound notification window automatically opens for a few seconds. So I wonder, why you need the applet opened in this case at all?

User avatar
daffa
Level 1
Level 1
Posts: 10
Joined: Fri Mar 16, 2018 9:55 pm
Location: Indonesia

Re: Open an applet from cli

Post by daffa » Fri Apr 06, 2018 8:37 am

xenopeek wrote:
Fri Apr 06, 2018 4:27 am
New developer documentation is being worked on I think. For now you can check the extension system links here: http://developer.linuxmint.com/referenc ... index.html. All the applets are open source and hosted in Linux Mint's GitHub repositories. The official applets are on Cinnamon https://github.com/linuxmint/Cinnamon/t ... on/applets. Applets developed by others are on https://github.com/linuxmint/cinnamon-spices-applets. You could look for another applet that does something like you want to do and study the code. (Mind that the links go to development versions, you can of course just install any applets you want to study and then access the code on your own system that way.)
Neat. Thanks for all your help, i'll begin researching.

User avatar
daffa
Level 1
Level 1
Posts: 10
Joined: Fri Mar 16, 2018 9:55 pm
Location: Indonesia

Re: Open an applet from cli

Post by daffa » Fri Apr 06, 2018 8:49 am

Cosmo. wrote:
Fri Apr 06, 2018 6:41 am
Why so complicated in this case? If the user changes the volume via keyboard the sound notification window automatically opens for a few seconds. So I wonder, why you need the applet opened in this case at all?
Idk, this crazy idea suddenly came up in my mind. And i think it would be cool if you could control applets using keyboard. Btw, sound notification just displaying the volume level, user can't do anything with it. However, if i show the sound applet, user would be able to change the volume through slider and control playing music or video. Like windows 10 do when you change volume through keyboard.

Post Reply

Return to “Scripts & Bash”