Where to find the code for Prefs->Hot Corners?

About programming and getting involved with Linux Mint development
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
newlyminted7
Level 5
Level 5
Posts: 563
Joined: Sat Jan 02, 2021 4:44 pm

Where to find the code for Prefs->Hot Corners?

Post by newlyminted7 »

There's a feature in Preferences called Hot Corners, which I use. I have a corner set to the feature "Show all windows", which I find handy.

I'm curious if there's a way to find the actual code that exectutes when this "Show all windows" feature is triggerred. I am interested in copying it and modifying it to create a feature that shows all windows of the currently active, focused window (ie. all web browser windows, for example).

Anyone know where I might find this code and what language it is written in?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29507
Joined: Wed Jul 06, 2011 3:58 am

Re: Where to find the code for Prefs->Hot Corners?

Post by xenopeek »

I assume you mean you're using Cinnamon. Show all windows is called scale overview in the code. Here is the clue for that from the settings: https://github.com/linuxmint/cinnamon/b ... er.py#L193. I'm not quite sure but I think the hotcorners are handled by code in https://github.com/linuxmint/cinnamon/b ... tCorner.js and the scale overview code gets importer (through main.js in same directory) from https://github.com/linuxmint/cinnamon/b ... verview.js. I'm not much of a JavaScript programmer or really at home in the Cinnamon code but perhaps I pointed to something useful.

I'd guess you can implement what you want as an extension or maybe an applet. Have a look at the Cinnamon spices for something akin to what you want to do? Here: https://cinnamon-spices.linuxmint.com/. Code is on GitHub here https://github.com/linuxmint/cinnamon-spices-extensions and here https://github.com/linuxmint/cinnamon-spices-applets.

On the Cinnamon GitHub project there are Wiki pages with documentation about creating spices. You can also install the cinnamon-doc package to get Devhelp on your system where you can browse the available APIs. As you can see in the above JavaScript files import section you can also use other libraries which will have their own API documentation.
Image
newlyminted7
Level 5
Level 5
Posts: 563
Joined: Sat Jan 02, 2021 4:44 pm

Re: Where to find the code for Prefs->Hot Corners?

Post by newlyminted7 »

Thanks, xenopeek, yes, that is all very helpful. Gives me an idea of how Cinnamon is put together and some more insight into how it works. Much appreciated!
Locked

Return to “Programming & Development”