3

I use GNU Screen for terminal multiplexing, and I was wondering if a similar solution existed for desktop environments. This is not the same concept as locking the screen, or logging out of the desktop. But to truly suspend, and then resume the X server at a later time without loss of data.

Also, I am not using Gnome or KDE, neither am I using a login manager.

Desired Behaviour

1) Login via the console.

2) Run startx.

3) Launch Firefox, Terminal, etc.

4) Suspend current X session; user is returned back to the console.

5) Resume previous X session; user is returned back to desktop environment.

Note: all previously running applications should still be present.

Research

Ctrl+Z is used to suspend a job in the terminal. This is used in conjunction with fg to resume the process.

The kill command can also send signals to a running process, e.g. -STOP, -CONT, among others.

5
  • I would also like some functionality like this. Does connecting to another tty satisfy you? Pressing Ctrl-Alt-F2 should provide you with a second login console, in which you can do whatever you like. If it is important to you that the X server running on tty1 is really paused, you can pause it with killall -TSTP X or similar, and resume it with killall -CONT X. Similarly you can just pause your window manager if you prefer. Commented Sep 27, 2020 at 21:23
  • A warning: Do not switch back to tty1 while the X server is paused. I don't know exactly why, but this freezes my console. My guess is that X is still set up to swallow all input, but can't process it because the process is paused. If you pause and then continue, though, I experienced no problems. However, if it is important to you that you are attached to tty1, I don't know how to do that! If not, I can turn these comments into an answer. Commented Sep 27, 2020 at 21:25
  • I know I can switch to another TTY, but I would really like to be able to suspend the graphical session. Commented Sep 28, 2020 at 12:07
  • Does suspending the graphical session from another terminal not work for you either? (I appreciate that the ideal is some functionality similar to ctrl-z, but I'm not sure how to get that). Commented Sep 28, 2020 at 13:10
  • 1
    You may find this discussion helpful: forums.gentoo.org/viewtopic-p-8505598.html Commented Sep 29, 2020 at 8:48

1 Answer 1

2

Maybe xpra is a solution for you? It works like screen for X connections.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.