Skip to content

susepaste: handle multiple login sessions#25

Open
tacerus wants to merge 1 commit into
openSUSE:masterfrom
tacerus:multipletty
Open

susepaste: handle multiple login sessions#25
tacerus wants to merge 1 commit into
openSUSE:masterfrom
tacerus:multipletty

Conversation

@tacerus
Copy link
Copy Markdown
Member

@tacerus tacerus commented Aug 17, 2024

The script would return something like

Failed to get path for session '1
2': No session '1
2' known
Graphics server not found. Copying to clipboard is not possible.

if multiple login sessions matching the username are found. This is mostly caused by the list-sessions output being passed to the show-session query including line breaks.

Repair this by:

  • querying only seat sessions, those are most likely to be
    graphical
  • stopping after the first match, instead of adding line breaks
    and additional session IDs to the type query (show-session does
    support passing multiple session IDs, but our case-logic would
    not handle the result)

This might still be error prone, as someone could theoretically have multiple graphical sessions with a mix of X11 and Wayland launched, but I deem it already better than not handling multiple active login sessions at all.

The script would return something like

```
Failed to get path for session '1
2': No session '1
2' known
Graphics server not found. Copying to clipboard is not possible.
```

if multiple login sessions matching the username are found.
This is mostly caused by the list-sessions output being passed to
the show-session query including line breaks.

Repair this by:
- querying only seat sessions, those are most likely to be
  graphical
- stopping after the first match, instead of adding line breaks
  and additional session IDs to the type query (show-session does
  support passing multiple session IDs, but our case-logic would
  not handle the result)

This might still be error prone, as someone could theoretically have
multiple graphical sessions with a mix of X11 and Wayland launched,
but I deem it already better than not handling multiple active login
sessions at all.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
@tacerus
Copy link
Copy Markdown
Member Author

tacerus commented Aug 17, 2024

Amended to use search for seat instead of tty.

@arvidjaar
Copy link
Copy Markdown

As I already said on mailing list, you don't even need the session number.

bor@bor-Latitude-E5450:~$ loginctl show-session -p Type auto
Type=wayland
bor@bor-Latitude-E5450:~$ 

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