Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
display-managers: Fix the xsession parameters
The xsession script was called with inconsistent (depending on the display managers) and wrong parameters. The main reason for this where the spaces the parameter syntax. In order to fix this the old syntax: $1 = '<desktop-manager> + <window-manager>' Will be replaced with a new syntax: $1 = "<desktop-manager>+<window-manager>" This assumes that neither "<desktop-manager>" nor "<window-manager>" contain the "+" character but this shouldn't be a problem. This patch also fixes the quoting by using double quotes (") instead of single quotes (') [0]. Last but not least this'll add some comments for the better understanding of the script. [0]: https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html
- Loading branch information
Showing
3 changed files
with
38 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1273f41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have a sec, please explain what
if [ "''${1:0:1}" = "/" ];
does. On my tests the hard quotes are always part of the string as characters. I figured you're trying to check that the first character of arg$1
is a backslash with${1:0:1}
but I'm drawing blanks while figuring out the hard quotes. What am I missing? Thank you in advance for helping me understand π1273f41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @vidbina, yes that's actually a bit strange because it's a mix of Nix and Bash. The two single quotes are needed to escape the
${expr}
syntax from the Nix expression language:I.e. after the evaluation it will be
if [ "${1:0:1}" = "/" ];
.1273f41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't even looking at this nix βοΈ side of things, but now I vaguely recall glancing over that escaping issue in the manual a while ago. Thank you so much for pointing this out, @primeos. π
1273f41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vidbina No problem, you're welcome π.