0

5.18.9-arch1-1 Dell XPS 15 9510

I am running arch linux on xmonad. I do not have a login manager. On boot, I simply login via the tty and run startx to start my x session. This behavior is exactly what I want.

However, when I sleep or hibernate via systemctl sleep/hibernate, upon waking I am thrown right back into my graphical environment. I find this behavior to be insecure because I do not have to reauthenticate. I would like to be able to sleep/hibernate, relogin to my tty, then be put right back into my graphical environment with the state preserved.

I feel as though this must be something that a lot of people would want to do yet I cannot seem to find any resources on how to do it. I would prefer to continue to not have a login manager and only interface with the tty for authentication.

2 Answers 2

2

You should be able to do this from a start-up script.

With the i3 window manager, you can execute a shell script from the i3 config to execute programs and move them to the appropriate workspace.

There are a few other ways to run scripts on startup, e.g. cron, rc.local, init.d.
Source: https://www.baeldung.com/linux/run-script-on-startup

1

However, when I sleep or hibernate via systemctl sleep/hibernate, upon waking I am thrown right back into my graphical environment. I find this behavior to be insecure because I do not have to reauthenticate.

Create a hook on sleep/hibernate/resume to launch an external screen locker is simpler and keeps your session and your work alive.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.