XSM(1)
โจ XSM(1) โ the X Session Manager, but make it bestie โจ
okay so first things first, the manual name is xsm and it lives in section 1 of the General Commands Manual, and honestly? she's iconic. let's get into it ๐
๐ธ NAME ๐ธ
xsm โ the X Session Manager. that's it, that's the name, she's booked and busy ๐
๐ฆ SYNOPSIS ๐ฆ
xsm [-display display] [-session sessionName] [-verbose]
three little flags, no chaos, we love a low-maintenance queen โจ
๐ DESCRIPTION ๐
so like, xsm is a session manager. and a session is a group of applications, where each one has a particular state. xsm lets you create arbitrary sessions โ like, literally whatever you want. for example bestie, you might have a "light" session, a "development" session, or an "xterminal" session. each session can have its own lil set of applications. no cap ๐ซถ
within a session, you can do a "checkpoint" to save application state, or a "shutdown" to save state and exit the session. and then when you log back in to the system, you can load a specific session โ and you can also delete sessions you no longer want to keep. spring cleaning energy ๐งนโจ
now, some session managers just let you manually specify a list of applications to be started in a session. xsm is more powerful because it lets you run applications and have them automatically become part of the session. on a simple level, xsm is useful because it gives you this ability to easily define which applications are in a session. but the true power of xsm? that's unlocked when more and more applications learn to save and restore their state. it's giving โจ ecosystem โจ and honestly we're obsessed.
๐ OPTIONS ๐
-displaydisplay โ causesxsmto connect to the specified X display. go where you're told, bestie ๐ฆ-sessionsessionName โ causesxsmto load the specified session, bypassing the session menu. no menu, straight to business, main character energy ๐-verboseโ turns on debugging information. she's telling you EVERYTHING, fr fr ๐
๐ SETUP ๐
๐ .xsession file ๐
using xsm requires a change to your .xsession file:
the last program executed by your.xsessionfile should bexsm. with this configuration, when the user chooses to shut down the session usingxsm, the session will truly be over. periodt.
since the goal of the session manager is to restart clients when logging into a session, your .xsession file, in general, should not directly start up applications. rather, the applications should be started within a session. when xsm shuts down the session, xsm will know to restart these applications. iykyk ๐
note however that there are some types of applications that are not "session aware". xsm allows you to manually add these applications to your session (see the section titled Client List). don't worry bestie, we got them ๐
๐ SM_SAVE_DIR environment variable ๐
if the SM_SAVE_DIR environment variable is defined, xsm will save all configuration files in this directory. otherwise, they will be stored in the user's home directory. session aware applications are also encouraged to save their checkpoint files in the SM_SAVE_DIR directory, although the user should not depend on this convention. so like, it's a vibe, not a promise ๐ธ
โญ Default Startup Applications โญ
the first time xsm is started, it will need to locate a list of applications to start up. for example, this list might include a window manager, a session management proxy, and an xterm. xsm will first look for the file .xsmstartup in the user's home directory. if that file does not exist, it will look for the system.xsm file that was set up at installation time. ๐
note that xsm provides a "fail safe" option when the user chooses a session to start up. the fail safe option simply loads the default applications described above. it's the "just make it work" button and honestly, we stan ๐ซถ
each line in the startup file should contain a command to start an application. a sample startup file might look this:
<start of file>
twm
smproxy
xterm
<end of file>
look at her. three lines. no notes. slay ๐
๐ฅ STARTING A SESSION ๐ฅ
when xsm starts up, it first checks to see if the user previously saved any sessions. if no saved sessions exist, xsm starts up a set of default applications (as described above in the section titled Default Startup Applications). if at least one session exists, a session menu is presented. ๐
the -session option forces the specified sessionName session to be loaded, bypassing the session menu. skip the line, VIP entrance ๐
๐ฆ The session menu ๐ฆ
the session menu presents the user with a list of sessions to choose from. the user can change the currently selected session with the mouse, or by using the up and down arrows on the keyboard. ๐ฑ๏ธโจ๏ธ
note that sessions which are locked (i.e. running on a different display) can not be loaded or deleted. they're booked elsewhere, bestie, we can't touch them ๐
the following operations can be performed from the session menu:
- Load Session โ pressing this button will load the currently selected session. alternatively, hitting the Return key will also load the currently selected session, or the user can double click a session from the list. three ways to say yes, we love options โจ
- Delete Session โ this operation will delete the currently selected session, along with all of the application checkpoint files associated with the session. after pressing this button, the user will be asked to press the button a second time in order to confirm the operation. yes, it double-checks, because deleting your whole vibe by accident is NOT the move ๐ญ
- Default/Fail Safe โ
xsmwill start up a set of default applications (as described above in the section titled Default Startup Applications). this is useful when the user wants to start a fresh session, or if the session configuration files were corrupted and the user wants a"fail safe"session. fresh start, clean slate, we love a reset button ๐ง - Cancel โ pressing this button will cause
xsmto exit. it can also be used to cancel a"Delete Session"operation. the "never mind bestie" button ๐
okay that's part one, and there's more coming so don't go anywhere โ we are NOT done yet ๐
๐ CONTROLLING A SESSION ๐
So after xsm figures out which session to load, it pops up its main window, and then starts launching every single application that's part of the session. The title bar of the session manager's main window will literally contain the name of the session that got loaded. cute, right? ๐
Here's everything you can do from xsm's main window:
Client Listโ tap this button and a window pops up with a list of every client chillin' in the current session. For each client, you get the host machine that the client is running on. As clients get added and removed from the session, this list updates itself to reflect the changes, no cap. And bestie, you get to control how these clients are restarted (more on that below ๐).- Hit the
View Propertiesbutton and you can view the session management properties associated with the currently selected client. ๐ - Hit the
Clonebutton and you can start a copy of the selected application. twin behavior fr fr. โจ - Hit the
Kill Clientbutton and you can remove a client from the session. ๐ - Pick a restart hint from the
Restart Hintmenu and you can control the restarting of a client. Here are your options, bestie:- The Restart If Running hint means the client should be restarted in the next session if it is connected to the session manager at the end of the current session.
- The Restart Anyway hint means the client should be restarted in the next session even if it exits before the current session is terminated.
- The Restart Immediately hint is giving Restart Anyway energy but turned up โ the client is meant to run continuously. If the client exits, the session manager will try to restart it in the current session.
- The Restart Never hint means the client should not be restarted in the next session. periodt.
- Hit the
Heads up: not all X applications are "session aware". ๐ Applications that are not session aware are ones that don't support the X Session Management Protocol, or ones that can't be detected by the Session Management Proxy (go read the section titled THE PROXY). xsm lets you manually add these applications to the session, because of course it does, it's an icon.
The bottom of the Client List window has a text entry field where you can type in application commands. Each command should go on its own line, okay? This info gets saved with the session at checkpoint or shutdown time. When the session is restarted, xsm will restart these applications in addition to the regular "session aware" ones. ๐ซถ
Pressing the Done button removes the Client List window. bye bestie ๐ธ
Session Log...โ the Session Log window serves up useful information about the session. Like, when a session is restarted, all of the restart commands will be displayed in the log window. it's giving receipts. ๐Checkpointโ performing a checkpoint means all applications in the session get asked to save their state. Not every application will save its complete state, but at a minimum the session manager is guaranteed that it will receive the command required to restart the application (along with all command line options). A window manager participating in the session should guarantee that the applications will come back up with the same window configurations. ๐
If the session being checkpointed was never assigned a name, you'll be required to specify a session name. Otherwise, you can perform the checkpoint using the current session name, or you can specify a new session name. If the session name you specified already exists, you'll be given the opportunity to specify a different name or to overwrite the already existing session. Note that a session which is locked can not be overwritten. ๐ซ
When performing a checkpoint, you must specify a Save Type, which informs the applications in the session how much state they should save.
- The Local type means the application should save enough information to restore the state as seen by the user. It should not affect the state as seen by other users. For example, an editor would create a temporary file containing the contents of its editing buffer, the location of the cursor, etc...
- The Global type means the application should commit all of its data to permanent, globally accessible storage. For example, the editor would simply save the edited file.
- The Both type means the application should do both of these. For example, the editor would save the edited file, then create a temporary file with information such as the location of the cursor, etc...
In addition to the Save Type, you must specify an Interact Style.
- The None type means the application should not interact with the user while saving state.
- The Errors type means the application may interact with the user only if an error condition arises.
- The Any type means the application may interact with the user for any purpose. Note that
xsmwill only allow one application to interact with the user at a time. one at a time, bestie, we're not chaotic. โ
After the checkpoint is completed, xsm will, if necessary, display a window containing the list of applications which did not report a successful save of state. ๐ญ
Shutdownโ a shutdown gives you all of the options found in a checkpoint, but in addition, it can cause the session to exit. Note that if the interaction style is Errors or Any, you may cancel the shutdown. You may also cancel the shutdown if any of the applications report an unsuccessful save of state. ๐
You may choose to shutdown the session with or without performing a checkpoint.
๐ฆ HOW XSM RESPONDS TO SIGNALS ๐ฆ
xsm will respond to a SIGTERM signal by performing a shutdown with the following options: fast, no interaction, save type local. This allows your session to be saved when the system is being shutdown. It can also be used to perform a remote shutdown of a session. iconic multitasking behavior ngl. โจ
xsm will respond to a SIGUSR1 signal by performing a checkpoint with the following options: no interaction, save type local. This signal can be used to perform a remote checkpoint of a session. ๐ซถ
๐ THE PROXY ๐
Since not all applications have been ported to support the X Session Management Protocol, a proxy service exists to allow "old" clients to work with the session manager. For the proxy to detect an application joining a session, one of the following must be true:
- The application maps a top level window containing the
WM_CLIENT_LEADERproperty. This property provides a pointer to the client leader window which contains theWM_CLASS,WM_NAME,WM_COMMAND, andWM_CLIENT_MACHINEproperties.
or ...
- The application maps a top level window which does not contain the
WM_CLIENT_LEADERproperty. However, this top level window contains theWM_CLASS,WM_NAME,WM_COMMAND, andWM_CLIENT_MACHINEproperties.
An application that supports the WM_SAVE_YOURSELF protocol will receive a WM_SAVE_YOURSELF client message each time the session manager issues a checkpoint or shutdown. This lets the application save state. ๐พ If an application does not support the WM_SAVE_YOURSELF protocol, then the proxy will provide enough information to the session manager to restart the application (using WM_COMMAND), but no state will be restored. it's giving vibes only, no memories. ๐ญ
๐ REMOTE APPLICATIONS ๐
xsm requires a remote execution protocol in order to restart applications on remote machines. Currently, xsm supports the rstart protocol. In order to restart an application on remote machine X, machine X must have rstart installed. In the future, additional remote execution protocols may be supported. manifesting. ๐
๐ SEE ALSO ๐
๐ธ AUTHORS ๐ธ
Ralph Mor, X Consortium Jordan Brown, Quarterdeck Office Systems
and that's the whole vibe, bestie ๐ this was xsm 1.0.5 from X Version 11 โ go checkpoint your life and slay ๐
โจ๐
๐ฆ where this page comes from
- debian bookworm: x11-session-utils 7.7+5
- debian trixie: x11-session-utils 7.7+6+b1
- ubuntu noble: x11-session-utils 7.7+6build2
- ubuntu questing: x11-session-utils 7.7+6build2
- ubuntu resolute: x11-session-utils 7.7+6build3
- ubuntu stonking: x11-session-utils 7.7+6build3
- Copyright 1994,1998 The Open Group
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms