Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

WIP: Sketch using OSC sequences to interact with openFile and openMedia #1163

Closed
wants to merge 1 commit into from

Conversation

pyrocto
Copy link
Contributor

@pyrocto pyrocto commented Aug 14, 2021

In the discussion at #973 (reply in thread), @branislavblazek asked

can I open editor for .txt file by some command? I can open editor by clicking on file in filessytem explorer.

@Animus-Surge replied

It's very hard to add commands into the terminal (especially for windows) that works with eDEX, so unfortunately it is not possible to do the command.

This is an attempt to solve the problem using an OSC sequence. It is a work in progress, as I haven't bothered to do path resolution yet, but it illustrates the concept.

With this shell script:

printf '\e]1024;{"cmd":"openFile","path":"'
printf "$1"
printf '"}\a'

one can provide the full path to a file and open it. For instance,
./openFile "/Users/stay/Library/Application Support/eDEX-UI/settings.json"
opens the json file in the built-in text editor.

@pyrocto
Copy link
Contributor Author

pyrocto commented Aug 14, 2021

Also at the moment, openMedia will display a media player for mp3s but won't play them. The pdf viewer works.

@GitSquared
Copy link
Owner

Interesting idea, so we could build & bundle in some kind of CLI tool that leverages those escape sequences to talk to the UI?

@pyrocto
Copy link
Contributor Author

pyrocto commented Aug 14, 2021

Yes, exactly.

@pyrocto
Copy link
Contributor Author

pyrocto commented Aug 29, 2021

This is, as I wrote, a sketch. If someone would like to contribute a PR to my fork that resolves relative paths properly and fixes the sound player issue, then it might be worth submitting. Another option is to close it without submitting.

@GitSquared
Copy link
Owner

Closing as I'm archiving the project (announcement).

Regardless, thanks for digging into this and sharing your prototype 🙏

@GitSquared GitSquared closed this Oct 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants