Skip to content

Commit 2fb0c28

Browse files
Merge pull request #110 from nathan-fiscaletti/wayland-support
Arch Linux & Wayland support
2 parents 5799755 + 1461531 commit 2fb0c28

File tree

10 files changed

+636
-25
lines changed

10 files changed

+636
-25
lines changed

.github/workflows/dev-build.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ on:
44
push:
55
branches:
66
- dev
7-
- linux-desktop
7+
- wayland-support
88
paths:
99
- 'application/**'
10+
- '.github/**'
1011

1112
jobs:
1213
build-windows-app:
@@ -120,6 +121,8 @@ jobs:
120121
uses: actions/setup-python@v2
121122
with:
122123
python-version: '3.12'
124+
- name: Install libarchive-tools
125+
run: sudo apt-get install -y libarchive-tools
123126
- name: Install Python dependencies
124127
run: |
125128
python -m pip install --upgrade pip
@@ -148,11 +151,19 @@ jobs:
148151
working-directory: ./application
149152
env:
150153
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
151-
- name: Rename Installer
152-
run: mv dist/kbs_*_amd64.deb dist/Keyboard-Sounds-amd64.deb
154+
- name: Rename deb installer
155+
run: mv dist/kbs_*_amd64.deb dist/Keyboard-Sounds-Setup-linux-x64.deb
153156
working-directory: ./application
154-
- name: Upload artifacts
157+
- name: Rename pacman installer
158+
run: mv dist/kbs-*.pacman dist/Keyboard-Sounds-Setup-linux-x64.pacman
159+
working-directory: ./application
160+
- name: Upload deb installer
161+
uses: actions/upload-artifact@v4
162+
with:
163+
name: build-artifacts-deb
164+
path: application/dist/Keyboard-Sounds-Setup-linux-x64.deb
165+
- name: Upload pacman installer
155166
uses: actions/upload-artifact@v4
156167
with:
157-
name: build-artifacts-linux
158-
path: application/dist/Keyboard-Sounds-amd64.deb
168+
name: build-artifacts-pacman
169+
path: application/dist/Keyboard-Sounds-Setup-linux-x64.pacman

.github/workflows/release-build.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ jobs:
137137
uses: actions/setup-python@v2
138138
with:
139139
python-version: '3.12'
140+
- name: Install libarchive-tools
141+
run: sudo apt-get install -y libarchive-tools
140142
- name: Install Python dependencies
141143
run: |
142144
python -m pip install --upgrade pip
@@ -165,11 +167,15 @@ jobs:
165167
working-directory: ./application
166168
env:
167169
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
168-
- name: Rename Installer
169-
run: mv dist/kbs_*_amd64.deb dist/Keyboard-Sounds-amd64.deb
170+
- name: Rename debian installer
171+
run: mv dist/kbs_*_amd64.deb dist/Keyboard-Sounds-Setup-linux-x64.deb
172+
working-directory: ./application
173+
- name: Rename pacman installer
174+
run: mv dist/kbs-*.pacman dist/Keyboard-Sounds-Setup-linux-x64.pacman
170175
working-directory: ./application
171176
- name: Upload Artifacts
172177
uses: softprops/action-gh-release@v2
173178
with:
174179
files: |
175-
application/dist/Keyboard-Sounds-amd64.deb
180+
application/dist/Keyboard-Sounds-Setup-linux-x64.deb
181+
application/dist/Keyboard-Sounds-Setup-linux-x64.pacman

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ dist
33
keyboardsounds.egg-info
44
build
55
app-version.txt
6-
version.py
6+
version.py
7+
venv/

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Keyboard Sounds is a free application that makes any keyboard sound like a Mecha
2626
### Helpful Links
2727

2828
- [Uninstall Keyboard Sounds](#uninstalling)
29+
- [Linux Support](./docs/linux-support.md)
2930
- [Developer Documentation](#development)
3031

3132
<br><br>

application/package.json

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,30 @@
3232
"icon": "./app_icon.ico"
3333
},
3434
"linux": {
35-
"target": "deb",
35+
"target": [
36+
"deb",
37+
"pacman"
38+
],
3639
"category": "AudioVideo",
3740
"icon": "./app_icon.icns"
41+
},
42+
"pacman": {
43+
"compression": "xz",
44+
"depends": [
45+
"c-ares",
46+
"ffmpeg",
47+
"gtk3",
48+
"libevent",
49+
"libvpx",
50+
"libxslt",
51+
"libxss",
52+
"minizip",
53+
"nss",
54+
"re2",
55+
"snappy",
56+
"libnotify",
57+
"libappindicator-gtk3"
58+
]
3859
}
3960
},
4061
"scripts": {
@@ -62,7 +83,7 @@
6283
"cross-env": "^7.0.3",
6384
"css-loader": "^6.0.0",
6485
"electron": "29.2.0",
65-
"electron-builder": "^24.13.3",
86+
"electron-builder": "^26.0.12",
6687
"file-loader": "^6.2.0",
6788
"node-loader": "^2.0.0",
6889
"style-loader": "^3.0.0"

docs/linux-support.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,37 @@
1-
# Keyboard Sounds: Desktop Linux Support
1+
# Keyboard Sounds: Linux Support
22

33
<img align="right" src="../images/linux.png" width="300px">
44

5-
> [!NOTE]\
6-
> This documentation is related to the **Desktop** Linux distribution of [Keyboard Sounds](https://keyboardsounds.net). It is not related to the Linux distribution of the [Keyboard Sounds command line application](../#command-line-macos-linux-or-windows)
5+
## Command Line
6+
7+
The Keyboard Sounds **command line** application is supported on Linux through [`pip`](https://packaging.python.org/en/latest/tutorials/installing-packages/).
8+
9+
```
10+
pip install keyboardsounds
11+
```
12+
13+
## Desktop Application
714

815
> [!WARNING]\
916
> The Linux distribution of the Keyboard Sounds Desktop Application is currently in beta.
1017
1118
[Download the latest release here](https://github.com/nathan-fiscaletti/keyboardsounds/releases/latest)
1219

13-
### Official Support
20+
### Using with Wayland
21+
22+
On Wayland, the application will use the libevdev library to listen for keyboard and mouse events. This is necessary because Wayland does not support the X11 event model.
23+
24+
> [!IMPORTANT]
25+
> In order for libevdev to work, your user must be added to the `input` group through `usermod`.
26+
27+
You can add your user to the `input` group by running the following command:
28+
```bash
29+
sudo usermod -aG input $USER
30+
```
31+
Then, log out and log back in for the changes to take effect.
32+
33+
Keyboard Sounds is not officially supported when running as root.
1434

15-
- Supports x86_64 Debian-based Linux distributions (e.g. Ubuntu, Debian, etc.)
16-
- Supports X Window System (X11) -- does not support Wayland.
35+
---
1736

18-
I'm interested in supporting other Linux distributions and Window managers, but I need help! As I'm unable to test the application on other Linux distributions, I'm looking for volunteers to help me test the application on other Linux distributions. If you are interested in helping, please [DM me on Discord](https://discord.gg/gysskqts6z).
37+
To expand support for other Linux distributions and window managers, I'm seeking volunteers to test the application in different environments. As I'm unable to personally test on all setups, your contributions would be invaluable to the project. If you are interested in helping, please [DM me on Discord](https://discord.gg/gysskqts6z).

keyboardsounds/daemon.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727

2828
from pygame import mixer
2929

30-
from pynput.keyboard import Listener
31-
from pynput.mouse import Listener as MouseListener, Button
30+
from pynput.mouse import Button
31+
32+
from keyboardsounds.listener import KeyboardListener, MouseListener
3233

3334
from keyboardsounds.profile import Profile, OneShotProfile
3435
from keyboardsounds.audio_manager import AudioManager
@@ -59,7 +60,7 @@
5960
__num_sound_workers = 8
6061

6162
# Keep references to listeners so they can be started/stopped dynamically
62-
__kb_listener: Optional[Listener] = None
63+
__kb_listener: Optional[KeyboardListener] = None
6364
__mouse_listener: Optional[MouseListener] = None
6465
try:
6566
# Ensure pydub knows where ffmpeg is, even if not on PATH
@@ -165,7 +166,7 @@ def on_command(command: dict) -> None:
165166
__am = AudioManager(Profile(profile))
166167
# Start keyboard listener if not running
167168
if __kb_listener is None:
168-
__kb_listener = Listener(
169+
__kb_listener = KeyboardListener(
169170
on_press=__on_press, on_release=__on_release
170171
)
171172
__kb_listener.start()
@@ -593,7 +594,7 @@ def run(
593594
mixer.init()
594595
mixer.set_num_channels(32)
595596
__kb_listener = (
596-
Listener(on_press=__on_press, on_release=__on_release)
597+
KeyboardListener(on_press=__on_press, on_release=__on_release)
597598
if __am is not None
598599
else None
599600
)

0 commit comments

Comments
 (0)