Skip to content

Instantly share code, notes, and snippets.

@SpaceK33z
Last active August 29, 2015 14:21
Show Gist options
  • Save SpaceK33z/c511d124d21ef7e3399b to your computer and use it in GitHub Desktop.
Save SpaceK33z/c511d124d21ef7e3399b to your computer and use it in GitHub Desktop.
PC Remote Control Webapp

Allows you to execute shell commands from a webapp. It lists commands as a card with an icon.

Use cases:

  • Party.
  • Lying on bed and being lazy.

For example: I'm lying on bed and I want to view some series. I tap on 'Open Plex' in the webapp, open the Plex Android app and setup a serie. After finishing, I want to listen to Spotify. I tap on 'Open Spotify' and continue controlling Spotify with their app. After that I want to go to sleep. I tap on 'Shutdown'.

Main file: commands.json Lists all the commands you want to be able to execute from the webapp. Only these commands can be executed.

Syntax of this file:

[
    {
        "name": "Shutdown",
        "icon": "icons/shutdown.svg",
        "exec": "shutdown now",
        "confirm": true
    }, {
        "name": "Open Spotify",
        "icon": "icons/spotify.svg",
        "exec": "open /Applications/Spotify.app"
    }
]

Webapp shows list of these commands. Clicking on one results in a POST request that tries to execute the command. Successfull command returns 200, unsuccessfull 400. A success / error message shows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment