Skip to content

More extensive kmscon-launch-gui.sh tweaks, inotifywait#163

Merged
kdj0c merged 4 commits intokmscon:mainfrom
Vladimir-csp:patch-2
Dec 9, 2025
Merged

More extensive kmscon-launch-gui.sh tweaks, inotifywait#163
kdj0c merged 4 commits intokmscon:mainfrom
Vladimir-csp:patch-2

Conversation

@Vladimir-csp
Copy link
Contributor

Continuation of #162

Use inotifywait to monitor foreground console change, if available, otherwise fallback to sleep.

Use case for control sequence selectors as it is more compact, elegant, and handy for potential future variant additions.

apply shfmt -s -sr formatting.

Copy link
Contributor

@kdj0c kdj0c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR, I agree with most of the changes.
Please update it, and I will merge it.

Fixed printf syntax to be portable and work in dash.
Got rid of useless `cat`s.

Signed-off-by: Vladimir-csp <[email protected]>
Signed-off-by: Vladimir-csp <[email protected]>
@kdj0c
Copy link
Contributor

kdj0c commented Dec 5, 2025

Sorry, I pushed to your branch, because I wanted to cleaned-up the commit history, the content should be the same.
The only thing I changed, is I kept the \ at the end of printf '\033Ptmux;\033\033]setBackground\a\033\\'.
The reason is that we want an \ and this must be escaped, it works if you put only one, because it's the last char of the string, but if you want to append some stuff it won't work.
If no other comments, I will merge it.

@Vladimir-csp Vladimir-csp mentioned this pull request Dec 5, 2025
@Vladimir-csp
Copy link
Contributor Author

Corrected a dumb mistake, sorry.

Use `inotifywait` to monitor foreground console change, if available, otherwise fallback to sleep.

Use `case` for control sequence selectors as it is more compact, elegant, and handy for potential future variant additions.

apply `shfmt -s -sr` formatting.

Signed-off-by: Vladimir-csp <[email protected]>
Use single quotes to reduce escape ambiguity. There are no variables in those strings, now there is one less backslash, result is the same:
```
printf '%b' "\033Ptmux;\033\033]setBackground\a\033\\" | md5sum
printf '%b' '\033Ptmux;\033\033]setBackground\a\033\' | md5sum
```
```
f5a7f67be35dcd7b910e05f52cf1676a  -
f5a7f67be35dcd7b910e05f52cf1676a  -
```

Signed-off-by: Vladimir-csp <[email protected]>
@kdj0c kdj0c merged commit 12423f4 into kmscon:main Dec 9, 2025
2 checks passed
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.

2 participants