Hacker News new | ask | show | jobs
by BenjiWiebe 2242 days ago
Are you actually using exec before each xinput command? If so, only your first xinput command actually gets run. exec replaces the currently running process, effectively making it run-this-and-exit.
2 comments

Looks like & saves the day by invoking the command in a subshell and then in that subshell exec replaces the subshell with the xinput command. E.g. you can test it by

    $ cat ./a.sh 
    #!/bin/sh
    exec /bin/echo foo &
    exec /bin/echo bar &
which outputs foo and bar. Seems like a special case, just like exec without a command for file descriptor redirection.
That's rather interesting - it does work, I can tell you that much, but maybe there's a more standard way of doing this :)