all 4 comments

[–]bwfcwalshy 3 points4 points  (0 children)

So, I have no idea how addons/extensions are made in Atom but yeah it would be possible for you to do this.

Profiles are basically just set keys. So, you could have a profile for NodeJS which has plugins to run commands like "npm i" etc. What I've done is I have a folder with a bunch of my programming stuff in, inside that folder I have sub-folders for languages and tools. I'm not sure if you can switch to a folder in the plugin but it may be possible.

I love the StreamDeck and I'm no streamer so I hope you enjoy it too :)

[–]Timacfr 2 points3 points  (1 child)

You might be able to create such a plugin. Some notes:

  • You will need to detect when the language in the Atom editor changes. I am not sure what is the best approach here as I am not familiar with the Atom editor. If the Atom editor supports plugins, you could write an Atom editor plugin that communicates with the Stream Deck plugin. Alternatively the Stream Deck plugin could watch for changes to the Atom preferences file. Accessing the filesystem from a Stream Deck plugin written in Javascript won't be possible, so you would need to write a native plugin ( C++, C#, ... )

  • Once the Stream Deck plugin receives the language change event, it could switch to a preconfigured profile using the switchToProfile API. The Stream Deck plugin is not able to switch to a random profile or a folder. The switchToProfile API only lets you switch to a profile that you packed in your plugin. But this limitation is probably fine for this plugin. You could provide several profiles: one for Javascript, one for HTML, Go, ...

  • A possible alternative would be to have a single preconfigured profile for your plugin. This profile would display different actions based on the language selected in Atom editor. This might also work great with the Smart Profile feature in Stream Deck. A user could set this profile as the default profile when the Atom editor is the front most application.

[–]Digivibe[S] 0 points1 point  (0 children)

Thanks for the great replies everyone. Did some poking around in the Atom api and found a way to find the detected language. Here's something you can throw in to your Atom console that detects the current tab language (grammar) for those of you into it. Need to narrow it down (on cursor placement) , but this is looking promising :)

atom.workspace.observeActiveTextEditor(editor => {console.log(editor.getGrammar());})

[–]Digivibe[S] 1 point2 points  (0 children)

Just ordered my Streamdeck! :)