Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvidia-xinitrc errored with [[:not found #138

Open
BobbyWibowo opened this issue Oct 23, 2019 · 4 comments
Open

nvidia-xinitrc errored with [[:not found #138

BobbyWibowo opened this issue Oct 23, 2019 · 4 comments

Comments

@BobbyWibowo
Copy link

I found out that [[ is a bash-builtin, meaning it's not available if the xinit script is being executed with sh.

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?

@noctuid
Copy link

noctuid commented Nov 5, 2019

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.

@BobbyWibowo
Copy link
Author

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?).

@noctuid
Copy link

noctuid commented Nov 5, 2019

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.

@st3r4g
Copy link

st3r4g commented Dec 17, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants