-
Notifications
You must be signed in to change notification settings - Fork 25
Implements Command Line Matching #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Some applications can't be matched using wm_class or window title, especially when installed via Snap. For example, the Snap-packaged version of Firefox (the default install for Ubuntu) often ignores wm_class and sets inconsistent window titles. This commit introduces a new mode, "match-cmdline", which enables matching windows based on the full launch command, including arguments. This adds a useful general-purpose capability and, in particular, allows users to assign separate shortcuts to different Firefox profiles under Ubuntu and apply run-or-raise behavior to each.
Stops tracking schemas.compiled
|
Very clever, seems great to me! I'll try to check thoroughly soon |
e3rd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it, thanks! To be aligned with the code style, could you remove semicolons and use {} around return statements too?
| import Gio from 'gi://Gio' | ||
| import GLib from 'gi://GLib' | ||
| import Mtk from 'gi://Mtk' | ||
| import * as Main from 'resource:///org/gnome/shell/ui/main.js' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the Main is not used in your code, what's the purpose here?
| @@ -1 +1,3 @@ | |||
| build | |||
| notes | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What creates the notes file? I tend to have the code short, if it is unlikely the notes will be created on other machines, I prefer to put such things info .git/info/exclude instead
| if (!ok) return ""; | ||
|
|
||
| try { | ||
| const file = Gio.File.new_for_path(`/proc/${pid}/cmdline`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two lines (which might be perfomance-inefficient) are run twice. Is it on purpose?
Some applications can't be matched using wm_class or window title, especially when installed via Snap. For example, the Snap-packaged version of Firefox (the default install for Ubuntu) ignores wm_class and rewrites window titles.
This commit introduces a new mode, "match-cmdline", which enables matching windows based on the full launch command, including arguments. This adds a useful general-purpose capability and, in particular, allows users to assign separate shortcuts to different Firefox profiles under Ubuntu and apply run-or-raise behavior to each.