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

make niri-session POSIX compatible #970

Merged
merged 2 commits into from
Jan 14, 2025
Merged

Conversation

z-erica
Copy link
Contributor

@z-erica z-erica commented Jan 13, 2025

&> redirection is undefined in POSIX sh (should fix #969)

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 13, 2025

As I mentioned in the issue, please leave /bin/sh and change the &> instead. It's supposed to be POSIX compatible

@z-erica
Copy link
Contributor Author

z-erica commented Jan 13, 2025

sure thing! i also changed the bash invocation early on, since that was what made me assume it was intended to be a bash script

@z-erica z-erica changed the title change niri-session shebang to /bin/bash make niri-session POSIX compatible Jan 13, 2025
@YaLTeR
Copy link
Owner

YaLTeR commented Jan 14, 2025

sure thing! i also changed the bash invocation early on, since that was what made me assume it was intended to be a bash script

Hmm, so this is a good question. Looks like the -l argument to exec is also bash-specific:

If the -l option is supplied, the shell places a dash at the beginning of the zeroth argument passed to command. This is what login(1) does.

$ dash
$ exec -l bash -c 'echo $0'
dash: 1: exec: -l: not found

So maybe it's better to leave exec bash on that line?

cc @kchibisov, but I think this invocation was cargo culted from other similar scripts

@kchibisov
Copy link
Contributor

The script pretty much does what the gnome shell wrapper does for the same thing, and was written the same way. There's generally no way to easy set the zero argument unless you use bash/zsh/etc.

You may try to pass the -l to shell directly though, if the goal is to use sh.

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 14, 2025

Let's just leave exec bash then for now

@YaLTeR YaLTeR merged commit 36076d5 into YaLTeR:main Jan 14, 2025
@YaLTeR
Copy link
Owner

YaLTeR commented Jan 14, 2025

Thanks

matthieucx pushed a commit to matthieucx/niri that referenced this pull request Jan 15, 2025
* make niri-session POSIX compatible

* Update resources/niri-session

---------

Co-authored-by: Ivan Molodetskikh <[email protected]>
matthieucx pushed a commit to matthieucx/niri that referenced this pull request Jan 15, 2025
* make niri-session POSIX compatible

* Update resources/niri-session

---------

Co-authored-by: Ivan Molodetskikh <[email protected]>
matthieucx pushed a commit to matthieucx/niri that referenced this pull request Jan 15, 2025
* make niri-session POSIX compatible

* Update resources/niri-session

---------

Co-authored-by: Ivan Molodetskikh <[email protected]>
matthieucx pushed a commit to matthieucx/niri that referenced this pull request Jan 15, 2025
* make niri-session POSIX compatible

* Update resources/niri-session

---------

Co-authored-by: Ivan Molodetskikh <[email protected]>
matthieucx pushed a commit to matthieucx/niri that referenced this pull request Jan 15, 2025
* make niri-session POSIX compatible

* Update resources/niri-session

---------

Co-authored-by: Ivan Molodetskikh <[email protected]>
matthieucx pushed a commit to matthieucx/niri that referenced this pull request Jan 15, 2025
* make niri-session POSIX compatible

* Update resources/niri-session

---------

Co-authored-by: Ivan Molodetskikh <[email protected]>
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

Successfully merging this pull request may close these issues.

niri-session fails to run if /bin/sh is not bash (dinit system)
3 participants