Known Bugs
- Text passed to the server to open applications is not validated. Possible Shell Injection.
Update 1.0
- Added folder structure
- Moved
snippets.js
toactionables.js
- Added
import
type. Import statements are added at the top of text field.
Insipred by Taran Van Hemert's (Linus Tech Tips) macro keyboard video, I wanted to make something similar to help me code, and here is the result.
-
SnipeTouch was intented to be a software that you can access from a second screen (or how many ever you need) that has buttons, which type in code snippets (on the primary device).
-
By clicking a button on second screen, it triggers xdotool on the primary device, which types the selected text at the cursor location.
- It has a few python snippets pre-defined.
-
But the way it works is, the second screen sends commands to the server (primary device). The server then processes it, and executes it in a "shell".
- So, once you have commands running in a shell, you can do pretty much anything you that you can, by directly being on the primary device. You can write scripts, run any software that you need. The possibilities are endless.
- It has a few websites listed, which open in Chromium.
-
There is also folder structure, so you can organize your code snippets based on language, or any way you like. *
- Type in code snippets and import statements
- Open webpages
- Open applications
After downloading the files, navigate to the folder containing "server.js" file and type in terminal:
# to install dependencies
npm install
# to start the server
npm start
- Open
http://ip-address-of-server:3000
on your mobile (or any other device). - Place the mouse where you want to type the snippet, and click.
Note: Devices should be on the same network
To add code snippets, edit public/actionables.js
file.
To edit how the webpage looks, edit files in public
folder.
Dependecies:
- NodeJS
- Express
- CORS
- Express Rate Limit
- Child Process
- xdotool / python
- For keyboard input
References: