to achieve same effect as when I press “Sleep”.
How do I achieve “Switch user” effect? lxlock is not what I want, it calls xscreensaver and makes it ask for a password, instead of just activating it
Not sure what you’re describing regarding the screensaver,
But answering your subject line, the following will switch to another User account at the command line (That command option is a hyphen, letter L for “login” in lower case)
Hello. Unfortunately, I didn’t mean switch the user in command line, but rather from command line.
Attaching a screenshot of button I want to “press” from command line https://i.imgur.com/mHzEwwo.png
What I provided enables you to “press that button” from within a running terminal.
Actually, avoiding the complications from actually running through the GUI code, the command I provided accesses the equivalent functionality behind the GUI.
@arvidjaar thank you for input, but I don’t know where to execute the code you provided, please hint (in bash it produces errors).
Also, I think I’ve found a working solution (for LXDE)
dm-tool switch-to-greeter
@tsu2 It’s my bad that I’ve worded it this way, I meant achieving exactly (and no more) than the “switch user” button does, and that is locks your session without enabling any lock mechanisms in screensavers, which in comparison lxlock does (I don’t want to get stuck with other keyboard layout being active, considering xscreensaver freezes for seconds after you type a wrong password).