loupedeck-commander 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,131 +1,131 @@
1
- # loupedeck-commander
2
-
3
- ## Getting started
4
-
5
- The loupedeck-commander is helping you using your Loupedeck device more easily, and connect it with custom commands you define with script files.
6
-
7
- Features:
8
-
9
- - Reference image files for every state of your button in the touch-display fields
10
- - Connect commands to your state transitions
11
- - Tested with following LoupeDeck devices:
12
- - [LoupeDeck Live](https://loupedeck.com/products/loupedeck-live/)
13
- - [LoupeDeck CT](https://loupedeck.com/products/loupedeck-ct/)
14
-
15
- Runs on:
16
-
17
- - Linux (Tested with Ubuntu 22.04 and Debian 11/12 on x64 & arm32/arm64)
18
- - Windows (Tested with Windows 10/11 on x64)
19
-
20
- Small footprint
21
-
22
- - Raspberry PI Zero is suitable to run this
23
-
24
- Please take care about the following:
25
-
26
- - LoupeDeck devices after `version 0.2.x` use a serial interface instead of WebSocket.
27
- When using this library please upgrade your firmware using the [LoupeDeck Software](https://loupedeck.com/downloads/)
28
- Tested with Firmware version [`version 0.2.5`](https://support.loupedeck.com/f-a-q-support#firmware-connectivity-issues)
29
-
30
- ## Basic Usage
31
-
32
- Do the following steps:
33
-
34
- ```bash
35
- # init your new node package
36
- npm init
37
-
38
- # install the loupedeck-commander dependency
39
- npm install -s loupedeck-commander
40
- ```
41
-
42
- Create a new configuration file with at least one profile or copy from here,
43
- and replace the image references with your own icons (90x90px size):
44
-
45
- - [config.yaml](https://gitlab.com/keckxde/loupedeck-commander/-/blob/main/config.yaml)
46
- - [profile-1.yaml](https://gitlab.com/keckxde/loupedeck-commander/-/blob/main/profile-1.yaml)
47
-
48
- Create a `index.mjs` file to open up your loupedeck connection:
49
-
50
- ```javascript
51
- # save as index.mjs
52
- import { BaseLoupeDeckHandler } from 'loupedeck-commander'
53
-
54
- const handler = new BaseLoupeDeckHandler('config.yaml')
55
-
56
- /**
57
- * Stop the handlers when a signal like SIGINT or SIGTERM arrive
58
- * @param {*} signal
59
- */
60
- const stopHandler = async(signal) => {
61
- console.log(`Receiving ${signal} => Stopping processes.`)
62
- await handler.stop()
63
- }
64
-
65
- // Initiating the signal handlers:
66
- // see https://www.tutorialspoint.com/unix/unix-signals-traps.htm
67
- process.on('SIGINT', async (signal) => { stopHandler(signal) })
68
- process.on('SIGTERM', async (signal) => { stopHandler(signal) })
69
-
70
- // Start it
71
- await handler.start()
72
-
73
- // Take care of running background processes and stop them accordingly:
74
- await new Promise((resolve) => process.once("SIGINT", resolve));
75
-
76
- ```
77
-
78
- Run the script using the following command:
79
-
80
- ```bash
81
- node index.mjs
82
- ```
83
-
84
- If you end up with errors related to canvas module - please install the dependencies as mentioned below, and run `npm install -s` again
85
-
86
- ## Thanks
87
-
88
- Big thanks go out to [foxxyz](https://github.com/foxxyz/loupedeck) and his team maintaining a great javascript loopdeck module
89
-
90
- ## Hints
91
-
92
- ### Cannot connect to Loupedeck device
93
-
94
- You may need to add your user to the `dialout` group to allow access to the LoupeDeck device, you could do su using the `usermod` as shown below
95
-
96
- ```bash
97
- # ls -la /dev/ttyACM0
98
- crw-rw---- 1 root dialout 166, 0 Nov 30 12:59 /dev/ttyACM0
99
-
100
- # add the current user to the dialout group:
101
- # sudo usermod -a -G dialout $USER
102
- ```
103
-
104
- After modifying users group you need to logout and login again to activate this change
105
-
106
- ### CANVAS Module - additional effort needed
107
-
108
- The library is using [canvas](https://www.npmjs.com/package/canvas) to load images and render graphical content on the LoupeDeck devices.
109
- Please follow the instructions to install the preconditions, to properly use canvas on your system.
110
-
111
- Example for Ubuntu:
112
-
113
- ```bash
114
- # different build & graphic dev-libs are needed to use canvas module:
115
- sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
116
- ```
117
-
118
- ### Resizing of images
119
-
120
- The buttons images shown on the different buttons should be prepared with specific resolutions:
121
-
122
- - Main/Center Touch-Area: 90px x 90px per Button
123
- - Left/Right Touch-Area: 90px x 270px per Button
124
- - LoupeDeck CT Knob Touch-Area: 240px x 240px Button
125
-
126
- if you already have suitable icons with the right aspect ratio, you could resize them with imagemagick/mogrify:
127
-
128
- ```bash
129
- mkdir resized
130
- mogrify -resize 90x90 -quality 100 -path resized *.png
131
- ```
1
+ # loupedeck-commander
2
+
3
+ ## Getting started
4
+
5
+ The loupedeck-commander is helping you using your Loupedeck device more easily, and connect it with custom commands you define with script files.
6
+
7
+ Features:
8
+
9
+ - Reference image files for every state of your button in the touch-display fields
10
+ - Connect commands to your state transitions
11
+ - Tested with following LoupeDeck devices:
12
+ - [LoupeDeck Live](https://loupedeck.com/products/loupedeck-live/)
13
+ - [LoupeDeck CT](https://loupedeck.com/products/loupedeck-ct/)
14
+
15
+ Runs on:
16
+
17
+ - Linux (Tested with Ubuntu 22.04 and Debian 11/12 on x64 & arm32/arm64)
18
+ - Windows (Tested with Windows 10/11 on x64)
19
+
20
+ Small footprint
21
+
22
+ - Raspberry PI Zero is suitable to run this
23
+
24
+ Please take care about the following:
25
+
26
+ - LoupeDeck devices after `version 0.2.x` use a serial interface instead of WebSocket.
27
+ When using this library please upgrade your firmware using the [LoupeDeck Software](https://loupedeck.com/downloads/)
28
+ Tested with Firmware version [`version 0.2.5`](https://support.loupedeck.com/f-a-q-support#firmware-connectivity-issues)
29
+
30
+ ## Basic Usage
31
+
32
+ Do the following steps:
33
+
34
+ ```bash
35
+ # init your new node package
36
+ npm init
37
+
38
+ # install the loupedeck-commander dependency
39
+ npm install -s loupedeck-commander
40
+ ```
41
+
42
+ Create a new configuration file with at least one profile or copy from here,
43
+ and replace the image references with your own icons (90x90px size):
44
+
45
+ - [config.yaml](https://gitlab.com/keckxde/loupedeck-commander/-/blob/main/config.yaml)
46
+ - [profile-1.yaml](https://gitlab.com/keckxde/loupedeck-commander/-/blob/main/profile-1.yaml)
47
+
48
+ Create a `index.mjs` file to open up your loupedeck connection:
49
+
50
+ ```javascript
51
+ # save as index.mjs
52
+ import { BaseLoupeDeckHandler } from 'loupedeck-commander'
53
+
54
+ const handler = new BaseLoupeDeckHandler('config.yaml')
55
+
56
+ /**
57
+ * Stop the handlers when a signal like SIGINT or SIGTERM arrive
58
+ * @param {*} signal
59
+ */
60
+ const stopHandler = async(signal) => {
61
+ console.log(`Receiving ${signal} => Stopping processes.`)
62
+ await handler.stop()
63
+ }
64
+
65
+ // Initiating the signal handlers:
66
+ // see https://www.tutorialspoint.com/unix/unix-signals-traps.htm
67
+ process.on('SIGINT', async (signal) => { stopHandler(signal) })
68
+ process.on('SIGTERM', async (signal) => { stopHandler(signal) })
69
+
70
+ // Start it
71
+ await handler.start()
72
+
73
+ // Take care of running background processes and stop them accordingly:
74
+ await new Promise((resolve) => process.once("SIGINT", resolve));
75
+
76
+ ```
77
+
78
+ Run the script using the following command:
79
+
80
+ ```bash
81
+ node index.mjs
82
+ ```
83
+
84
+ If you end up with errors related to canvas module - please install the dependencies as mentioned below, and run `npm install -s` again
85
+
86
+ ## Thanks
87
+
88
+ Big thanks go out to [foxxyz](https://github.com/foxxyz/loupedeck) and his team maintaining a great javascript loopdeck module
89
+
90
+ ## Hints
91
+
92
+ ### Cannot connect to Loupedeck device
93
+
94
+ You may need to add your user to the `dialout` group to allow access to the LoupeDeck device, you could do su using the `usermod` as shown below
95
+
96
+ ```bash
97
+ # ls -la /dev/ttyACM0
98
+ crw-rw---- 1 root dialout 166, 0 Nov 30 12:59 /dev/ttyACM0
99
+
100
+ # add the current user to the dialout group:
101
+ # sudo usermod -a -G dialout $USER
102
+ ```
103
+
104
+ After modifying users group you need to logout and login again to activate this change
105
+
106
+ ### CANVAS Module - additional effort needed
107
+
108
+ The library is using [canvas](https://www.npmjs.com/package/canvas) to load images and render graphical content on the LoupeDeck devices.
109
+ Please follow the instructions to install the preconditions, to properly use canvas on your system.
110
+
111
+ Example for Ubuntu:
112
+
113
+ ```bash
114
+ # different build & graphic dev-libs are needed to use canvas module:
115
+ sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
116
+ ```
117
+
118
+ ### Resizing of images
119
+
120
+ The buttons images shown on the different buttons should be prepared with specific resolutions:
121
+
122
+ - Main/Center Touch-Area: 90px x 90px per Button
123
+ - Left/Right Touch-Area: 90px x 270px per Button
124
+ - LoupeDeck CT Knob Touch-Area: 240px x 240px Button
125
+
126
+ if you already have suitable icons with the right aspect ratio, you could resize them with imagemagick/mogrify:
127
+
128
+ ```bash
129
+ mkdir resized
130
+ mogrify -resize 90x90 -quality 100 -path resized *.png
131
+ ```