Hacker News new | past | comments | ask | show | jobs | submit login
Plotinus: A searchable command palette in every modern GTK+ application (github.com/p-e-w)
143 points by ingve on May 22, 2021 | hide | past | favorite | 40 comments



This seems like an answer to KDE‘s KCommandBar https://pointieststick.com/2021/05/21/this-week-in-kde-kcomm...


More like KCommandBar is the "answer" to this since Plotinus has existed since 2016 although it seems it has gone under the radar.


Are both not influenced by the Unity HUD, which was probably influenced by the macOS / OSX "Help" menu?


Most certainly they've. I wonder whether OSX was the first to offer such a feature or it goes even more back.


"helloSystem" (FreeBSD-based) has it for both Qt & GTK.[0,1]

> This seems like an answer to KDE‘s KCommandBar

Here is pure Qt implementation of search commands for Scribus, based on implementation from Olive Video Editor.[2,3]

And LibreOffice would get feature, based on implementation from Collabora.[4,5]

[0] https://twitter.com/probonopd/status/1332084406614450178

[1] https://twitter.com/probonopd/status/1332388691004825604

[2] https://github.com/aoloe/scribus-plugin-actionSearch

[3] https://github.com/olive-editor/olive/pull/266/files

[4] https://twitter.com/libreoffice/status/1395355230162886657

[5] https://tomazvajngerl.blogspot.com/2021/05/command-popup-hud...


As a tip for macOS users who maybe don’t know this: Theres a similar feature in every macOS app when you click the “Help” menubar entry of an app and enter text into the search field there.


I don’t really use this as a command palette, but it’s so good for finding specific bits of functionality in an app.

It’s also one of the reasons I’m a big fan of global menubars: they act as a sort of index of everything an app can do, and the menubar is always present anyway there’s no point in devs not utilizing them.


There’s a default binding for it as well: `command + /`.


Such an under-appreciated feature by macOS users and devs alike.


It's actually command + shift + /, i.e., command + ?


Sadly not every application has something useful available there.


A new incarnation of the old ubuntu unity all over again. Actually a kind liked how unity worked on ubuntu 12.04, I could have many files open on gedit and easily switch them, it was easy to find plugins on gimp without needing to search the menus... Don't know why it didn't stay.

This doesn't support gtk4 afaik and last commit if from 2017, seems abandoned.


This kind of functionality is awesome. I have visual tracking problems for some reason. I get tunnelvision frequently, I often lose track of the mouse, and it's just generally hard for me to find things by physically scanning for them with my eyes.

One of the things that I love about text/search-driven interfaces (like my terminal, global search tools (Spotlight, KRunner, whatever), Emacs, etc.) is that the information I need to see comes to ME. I fix my eyes on one part of the screen, and I know that exactly whatever I need to consider will appear exactly there. It's great!

I really hope something like this can become a more standard/expected feature in most GUI environments.


GIMP has such a feature for a while, specifically since 2.10 released three years ago[0], accessible with slash key (/).

[0]: https://www.gimp.org/release-notes/gimp-2.10.html#search-sys...


Long time Gimp user here who didn't know about this. Huge time saver.


I remember GTK had editable keyboard shortcuts, I wonder why it was axed together with "tear off" menus, and multi-column menus.


Just my observations:

- Editing shortcuts within the menus is not really discoverable, except by accident, it's too easy to accidentally change a shortcut that way and screw up your program, and the UI around saving/loading/resetting them is not good

- Tearoff/multicolumn menus were seen as a workaround for programs that have too many huge and/or nested menus, where something like a toolbar or a command palette would be more appropriate


KDE has a standard keyboard shortcut editing dialog, it's perhaps not the most beautifully designed dialog, but it certainly works quite nicely.


I love this kind of navigation in an application. Less looking through the menu bar for an action.

VSCode has this with Ctrl+Shift+P which I use all the time. Not a big time JetBrains user but I think tapping Shift twice does the same in their IDEs.


Ditto. IMO every application should have a searchable (and context-aware) command palette. (Gimp, Inkscape, I'm looking at you in particular!)


As I wrote in another comment GIMP has and is accessible with slash key (/).


Now all we need is a tool to search for this search functionality :)


Yes shift shift searches everything in JetBrains IDEs. If you just want actions it’s ctrl shift A.


Also ctrl+shift+p in Sublime Text.


I remember building something similar about ten years ago for Windows using the accessibility APIs to extract menus from applications.

To my chagrin, a great many applications, including those shipping with Windows (even the explorer, iirc) and almost everything using fancy UIs or various toolkits (GTK, Tk and Java apps I think, Qt worked) don't expose their menus through them, which made it pretty useless.


Oh, so it's like Unity's HUD, but DE-independent? Cool.


Oh wow. This needs to start just being a part of GTK.


Great idea! I must check it out when I'll be in front of computer.

I lately wonder what amaizing tools could be written using accessibility APIs, but presenting things graphically. AFAIU this uses introspection abilities of GTK, but the idea is similar I guess.


How does this work exactly? Are there anythings that an app needs to do for it to work fully?

"Nemo vir est qui mundum non reddat meliorem" translates to "No one man is that the world doesn't render better". Weird.


This probably uses Gtk introspection to enumerate the main menu of the application.

> Documentation on GTK+ modules is essentially nonexisting. Without gtkparasite and gnome-globalmenu to learn from, it would have been a lot harder to get this project off the ground.

-

> Nemo vir est qui mundum non reddat meliorem

Going of my very unused latin knowledge. "Nemo vir est" = "There is no man", "qui mundum non reddat meliorem" -> "There is no man, who doesn't return betterment to the world" (had to look meliorem up tho)


Nobody who does not improve the world is a man


This code seems to be pretty hacky, it works by injecting a dynamic library into the program and then looping on a timeout to rescan every window and attach a key handler: https://github.com/p-e-w/plotinus/blob/master/src/Keybinder....

Newer Gtk apps that use app menus with GAction and GMenuModel should work fine, and will be forward-compatible with other similar tools, since those will export the menu over d-bus.


>> How does this work exactly? Are there anythings that an app needs to do for it to work fully?

> Plotinus brings that power to every application on your system (that is, to those that use the GTK+ 3 toolkit). It automatically extracts all available commands by introspecting a running application, instantly adapting to UI changes and showing only relevant actions. Using Plotinus requires no modifications to the application itself!


> "Nemo vir est qui mundum non reddat meliorem"

That quote is present in (originates from ?) the movie "Kingdom Of Heaven", in the workshop of the main character Balian, where it is translated as "What man is a man who does not make the world better?".


I'd translate it to portuguese like "Não há homem que não torne o mundo melhor" -> "there is no man that doesn't make the world better".


Previous thread[0] (year ago)

[0] https://news.ycombinator.com/item?id=22317371


This looks awesome, but installing it on Manjaro caused my OS to crash whenever I logged in. Any possible solutions?


I really like the direction this leads to: GUI Programs properly controllable with the keyboard.


"modern GTK+ application"


as a fellow Plotinus and list fan: very nice




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: