-
Notifications
You must be signed in to change notification settings - Fork 128
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
Implement support for an input modal #163
Comments
Somewhat related to #158. |
Would be awesome if this were able to behave like dmenu on Linux. Check out https://www.youtube.com/watch?v=R9m723tAurA for some inspiration. |
I got something to work using https://github.com/chipsenkbeil/choose ( I use it to jump between open windows: const OSASCRIPT_PATH = "/usr/bin/osascript";
const osascript = (script, callback = _.noop) =>
Task.run(OSASCRIPT_PATH, ["-e", script], callback);
// Jump Between Open Windows
keys.push(
new Key("j", ["cmd"], function () {
const windows = Window.all({ visible: true });
const titles = windows.map((window) => window.title()).join("\n");
osascript(
`do shell script "echo '${titles}' | /usr/local/bin/choose -c ff4a00 -n ${windows.length} -s 18 -m"`,
(r) => {
if (r.error) {
Phoenix.log(`Choose failed ${r.status} ${r.error}`);
} else {
const selection = r.output.trim();
const target = windows.find((window) => window.title() === selection);
if (target) {
Phoenix.log(`Focusing ${target.title()}`);
target.app().focus();
target.focus();
}
}
}
);
})
); cc @apazzolini |
@calebpeterson Sounds cool! |
kasper
added a commit
that referenced
this issue
Feb 13, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It has become clear that many use the modal for submitting text based input and commands to Phoenix. Since you need to bind every single key on your keyboard to make this work properly, it’s not really convenient. So we should really implement support for an input/prompt modal with relevant customising options and event callbacks for handling this use case.
The text was updated successfully, but these errors were encountered: