Comments (5)
In my case this error was caused by which
not finding the executable in $HOME/.cargo/bin. Copying it to /usr/local/bin fixed the issue. Haven't taken the time to figure out the solution or the problem so cannot share any more details.
from kanata.
I've also tried to escape the quotes with \'
but this resulted in a different error
kanata.service - Kanata keyboard remapper
Loaded: loaded (/etc/systemd/user/kanata.service; enabled; preset: disabled)
Drop-In: /usr/lib/systemd/user/service.d
└─10-timeout-abort.conf
Active: failed (Result: exit-code) since Wed 2024-07-24 15:52:30 CEST; 3s ago
Duration: 5ms
Docs: https://github.com/jtroo/kanata
Process: 11542 ExecStart=/usr/bin/sh -c 'exec $$(which kanata) --cfg $${HOME}/.config/kanata/config.kbd' (code=exited, status=2)
Main PID: 11542 (code=exited, status=2)
CPU: 4ms
Started kanata.service - Kanata keyboard remapper.
$(which: -c: line 1: unexpected EOF while looking for matching `''
kanata.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
kanata.service: Failed with result 'exit-code'.
from kanata.
Interesting 🤔
Any improvement to the doc would be welcome! This has apparently worked for someone since they contributed the suggestion, but perhaps it doesn't work in all versions/configurations of systemd.
from kanata.
I didn't have much time lately to look at this problem again, unfortunately, but thanks to the help on the systemd matrix room I now have a working solution not involving the shell at all.
[Unit]
Description=Kanata keyboard remapper
Documentation=https://github.com/jtroo/kanata
[Service]
Environment=PATH=%h/.cargo/bin
Environment=DISPLAY=:0
ExecSearchPath=%h/.cargo/bin
Type=simple
ExecStart=kanata --cfg %h/.config/kanata/kanata.kbd
Restart=no
[Install]
WantedBy=default.target
PATH
and ExecSearchPath
obviously needs to be adjusted if kanata was not installed via cargo but this executes kanata without the need for a shell exec. The %h
is a systemd specifier for the home directory of the user running the current service manager. So if you are currently the user Bob
and execute systemctl --user start kanata.service
%h
would resolve to /home/Bob
from kanata.
I should note that, in my case, I also had to set ExecSearchPath
in order for systemd to find kanata. Only setting PATH
did not suffice for me.
from kanata.
Related Issues (20)
- Why doesn't `C-S-mlft` (open link in new tab and move to that tab in Chrome) work when mapped to anything? HOT 2
- Feature request: AHK style hotstrings HOT 2
- kanata.service error finding config file HOT 4
- Feature request: Accessible output messages HOT 9
- Feature request: Reverse the release order of (multi) keys
- Bug: unmod-ing modded keys not possible ({, }, !, $, etc.) HOT 3
- [minor] Prefix a new line after some secs idling in the debug log HOT 2
- Bug: "switch" & "not" operator not working HOT 6
- Bug: kanata interception gui executable does not use interception HOT 1
- Bug: Unable to find a keyboard device HOT 2
- Bug: Ctrl Shift W doesnt work in remapper ctrl key. HOT 3
- Bug: Second character of macro disappears when it is used in chord HOT 5
- help: remap fn key nixos-asahi m1 HOT 1
- Bug: tap-hold-press and tap-hold-release do not work on Linux HOT 2
- Bug: kanata doesn't work on startup HOT 3
- Bug: Not deterministic builds on macOS
- Bug: Defoverrides combined with one-shot shift gives both shifted and non-shifted key. HOT 7
- Bug: IOHIDDeviceOpen error: (iokit/common) not permitted HOT 1
- Kanata "kills" espanso triggers partly
- Scroll on mouse move.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kanata.