2

I'm trying to work out what function call opens the Applications overlay in Ubuntu 18.04 - this is the function call that runs when the Super+a shortcut is pressed in Ubuntu 18.04.

Applications overlay:

Application Overlay in Ubuntu 18.04

I've attempted to find an application that prints the function call from a given keyboard shortcut, but couldn't find anything. Googling generic words such as "applications overlay" didn't work either.

Furthermore, is there any way to find out these function calls in the future (e.g., documentation), as I feel I'm asking a very basic question.

Nick Bull
  • 182

1 Answers1

2

Found it! Bit long winded, and involved going through the discussion for the Super+a commit on gnome-shell (found here), then analyzing the code a little bit.

Finally, I used gdbus to execute the JavaScript, inspired from this snippet about loading themes from JavaScript. Final result is this beautiful snippet:

gdbus call --session --dest org.gnome.Shell \
  --object-path /org/gnome/Shell --method org.gnome.Shell.Eval \
  'Main.overview._dash.showAppsButton.checked = true;Main.overview.show();';
Nick Bull
  • 182
  • 1
    I hope your takeaway from this is the understanding that shortcuts need not execute commands, but you can execute commands that mimic shortcuts. – muru Aug 09 '18 at 15:25
  • 2
    This is typical of GNOME-based desktops to have a dbus call for showing "start menu" or manipulate other UI elements. But IMHO having JavaScript there is just whole lot of yuck. Also, I second what muru said – Sergiy Kolodyazhnyy Aug 09 '18 at 15:29
  • @muru I'm not sure I understand fully. Is this not the command that is executed when the shortcut Super+a is pressed? – Nick Bull Aug 09 '18 at 15:30
  • Or does the word command explicitly mean "CLI command" in this context? Because I believe the shortcut does execute the JavaScript command in the answer – Nick Bull Aug 09 '18 at 15:31
  • 1
    @NickBull yes, it explicitly means "CLI command" in this context. The shortcut results in some functions being called in code. Some shortcuts may result have those functions actually running an executable command, for example, the shortcut for a terminal or calculator. Most don't, like this one, or changing the volume, for example. – muru Aug 09 '18 at 15:33
  • @muru Ah okay, gotcha! Maybe a lack of understanding of proper terminology on my behalf, I had already assumed it wasn't an actual "command" but instead either C or some other function call. I'll prefer your use of semantics on these topics in the future as they're more specific :) Thank you! – Nick Bull Aug 09 '18 at 15:36
  • If either of you happen to know a better way of finding these function calls without searching through commit messages, I'd greatly appreciate knowing that too! – Nick Bull Aug 09 '18 at 15:40