applescript trellis keyboard buddy
It's not a dragon, but it's white and it's your mate too.
It's a programmable 16 button keypad that helps you with common tasks in your day a day with your Mac.
- Wemos D1 Mini (The brain)
- Trellis (The arms and legs)
- 3D printed case (The body)
- USB - Micro USB cable (The heart)
After configuring and starting mosquitto in your Mac, plug atreyu to any available USB port.
It tries to connect to your WiFi (you must set SSID and password previously in the arduino script) and then to the mosquitto server. The IP of your Mac must be setted in the arduino script too, but if it's dynamic, no problem, you can configure the last two ranges or 6 cipher of it. Just press the bottom-right button when the connecting error animation displays, and it'll show a numpad where you can select the numbers of the IP of your Mac (i.e. 192.168.002.134).
There are four available pages, selected by the four upper buttons.
The other 12 buttons sends a message to the mosquitto server with its number depending the page selected (0 to 47).
After 60 seconds of idle, atreyu starts to play alone a random pattern. Press any button to wake it up.
When changin between apps in your mac, atreyu automatic changes the page assigned to it. You will notice this as a scrolling animaton in atreyu.
The below table shows the current configuration that the atreyu provides right out of the box. When a button is pressed, its value is published to the mosquitto server. The script, which is a subscriber of the same topic, executes the AppleScript correspondent to the button value. Usually, it's some key presses.
Button | Page 1 | Page 2 | Page 3 | Page 4 |
---|---|---|---|---|
1 | ||||
2 | ||||
3 | ||||
4 | ||||
5 | ||||
6 | ||||
7 | ||||
8 | ||||
9 | ||||
10 | ||||
11 | ||||
12 |
If you have some knowledge in AppleScript, it's very easy to adapt the functionality. You just have to modify atreyu.sh to your requirements. All buttons are commented in the code. Here there are a couple of links that may be interesting: