Giter Club home page Giter Club logo

Comments (5)

redmaw avatar redmaw commented on September 3, 2024 1

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.

fluffychaos avatar fluffychaos commented on September 3, 2024

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.

jtroo avatar jtroo commented on September 3, 2024

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.

fluffychaos avatar fluffychaos commented on September 3, 2024

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.

fluffychaos avatar fluffychaos commented on September 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.