Open BobbyWibowo opened 4 years ago
nvidia-xrun runs the user xinitrc with sh
which is dash on Ubuntu. You need to either modify it to run your user nvidia-xinitrc directly or modify your user nvidia-xinitrc to run another file directly (e.g. ./xinitrc
) or not use bashisms.
Yeah, I eventually settled with not using bashisms specifically for the xinitrc file, before posting this issue. Overall it's been working great ever since.
Was just mainly wondering if it was just an Ubuntu thing, either due to it having an older version of X, or whatever I dunno. And kinda hoping the devs would perhaps take it into account for future developments of the script (if Ubuntu is ever planned on being supported - though I guess it never really was to begin with?).
It's because Ubuntu uses dash as /bin/sh
. This project could change /etc/X11/xinitrc/nvidia-xinitrc
to execute the user's config directly instead of calling sh
. It looks like the project may have been abandoned though.
I noticed that the script file starts with
#!/usr/bin/env bash
, but that didn't seem to be doing anything anyway.
It seems to be honored only if nvidia-xinitrc
is made executable. After giving the file permissions 755
it was executed under bash
instead of the default sh
, and that fixed the issue.
I found out that
[[
is abash
-builtin, meaning it's not available if the xinit script is being executed withsh
.I'm on KDE neon 5.17.1 (Ubuntu 18.04 LTS), and from my tests, it appears that nvidia-xinitrc seems to always be executed without
bash
, so I kept on getting the[[: not found
errors.I noticed that the script file starts with
#!/usr/bin/env bash
, but that didn't seem to be doing anything anyway.I wonder if it's just an Ubuntu thing?