Desktop Session

From antiX Linux fan

Different from most Linux based operating systems, antiX Linux enables you to switch between one window manager to another without having to log out from your user account. It is so that even the windows you have open are moved to the other window manager selected. This is all possible thanks to the antiX Desktop Session program.

nuts-n-bolts: some background info and terminology
 
Several components are involved in achieving a graphical (aka "desktop") linux experience.
After the system boots, it starts multiple tty (aka "terminal") instances 
then, from within one of the terminal instances, launches the X server... 
(bear in mind: linux is a multi-user, multi "seat" platform)
...which, in turn, launches a "login manager" (aka "display manager").
SLiM, LightDM, SDDM ~~ each alternative login manager has differing features.
Their shared common features are username+password challenge and, typically,
ability to select which graphical "environment" to invoke for the current "desktop login session".
 
The login manager launches a (configurable, per user) "session startup" script which, in turn,
launches a "window manager" component.
             
An all-in-one "desktop environment" (aka "DE") like Xfce, KDE, Gnome, Cinnamon...
is typically comprised of a fixed set of (interlocking//interdependent) components. 
For instance, the Xfce panel and taskbar are only usable in conjunction with the XFWM window manager.
 
The antiX Full edition contains multiple preinstalled "window managers" (JWM, iceWM, fluxbox) 
which are capable of running alone or, optionally, along with (y)our choice of various, loosely-coupled, components.
 
For the component serving the role of "desktop (icon) manager", antiX Full edition offers a choice of rox or spacefm.
These both can also be launched as windowed "file manager" instances, in addition to handling drag-n-drop (and click) 
interactions with desktop icons (launchers) and, optionally, placement and tiling of "wallpaper" (root window background image).

Default antiX Sessions[edit | edit source]

antiX Full and Base editions have antiX Desktop Session installed by default. They come with 3 different desktop configurations. From more features (and more RAM use) to less, are:

Desktop + Window manager: a file manager (ROX or SPaceFM) displays the icons/launchers on the desktop, manages the wallpaper, automounting devices and files. The window manager (IceWM, JWM or fluxbox) will control the window, window decorations and menus. Apart from startup commands managed by antiX Desktop Session, the ones added to the Window manager's startup file will also launch. They are (from more to less RAM use):
Space-fluxbox
Space-Icewm
Space-jwm
Rox-fluxbox
Rox-icewm
Rox-jwm
Window Manager: There are no icons on the desktop. The window manager is in charge of everyting (except outpmounting devices and managing files), from wallpaper to window decorations and menu. The default file manager can be selected using Preferred Applications. From more to less RAM:
Fluxbox
Icewm
JWM
herbstluftwm (a tile based window manager not recommended for novices).
Minimal desktop sessions: The most minimal of all sessions. These desktop sessions will only launch the window manager and disable the startup programs (no matter if configured with Desktop Session or in the Window manager's own startup file). It is recommended for those systems with extremely limited RAM (less than 512 MBs). From most RAM intensive:
min-fluxbox
min-icewm
min-jwm

Changing between Desktop sessions can be done by:

Logging out and changing the Desktop session from SLiM (using F1 to toggle between different sessions before log in).
Selecting the desired session from the menu (menu > Desktop > Other Desktops).
Selecting the Desktop session from the Other Desktops window (launched from menu > Applications > Accessories or from App Select, searching and launching "Other Desktops").
Running /usr/local/lib/desktop-session/desktop-session-restart desktop_session_name

The last selected Desktop Session (which becomes the default upon selection) is stored in ~/.desktop-session/desktop-code.[0-9]. The number in the name represents the X server instance. Default options are listed above; additionally openbox is listed for variants.(openbox, space-openbox, rox-openbox) An up to date list for *your* system of names and session switch commands can be found in /usr/share/desktop-session/wm-menus/RAW-wm-menu


Desktop Session functions[edit | edit source]

antiX Desktop Session not only manages switching between Window Managers, but also takes control of other system aspects (like the desktop, the menu updater, the startup programs, etc.), making any of the Window Managers function very close to how Desktop Environments do. Some of these functions are:

Enable the user to change/switch between different window managers and session
Select what program will manage the desktop icons and wallpaper (depending on the session selected). This functionality is complemented by the wallpaper-antiX program and the File Manager related to each desktop session.
Manage the prefered applications (default applications).
Manage the script that updates the Applications menu with new apps and programs recently installed.
Manages the programs and scripts that auto-starts with the Desktop session
Manages the menu option and "Exit Session" window, to Suspend/PowerOff/Reboot the system, restart the session and log out (dependent on pm-utils package).
Removing and adding new Window Managers and Desktop Environments to the SLiM entries (for later selecting from the login screen).
Control the automounting behavior of devices (with automount-antix extra package as support).

As previously stated, this complex program tries to emulate the Desktop Environment behaviour. Each of its different functions requires further study to better understand them.

Preferred Applications[edit | edit source]

Preferred applications [a GUI utility, accessible via antiX ControlCentre]
sets the default application to launch and open certain file types (except customizations done on the File manager), and changes the Freedesktop behavior for certain commands and options (mainly the xdg-open command). These changes are unique to each user.

The possible preferred applications that can be selected are:

Terminal = determines the default Terminal emulator and what the "Terminal" menu option does (related to the command desktop-defaults-run -t).
Web Browser = determines the default Web Browser and what the "Web Browser" menu option does (related to the command desktop-defaults-run -b).
File Manager = determines the default File Manager, launches it every time you mount a device, and controls what the menu entry "File Manager" (and IceWM taskbar button) does (related to the command desktop-defaults-run -fm).
Email Client = determines the default Email Client program.
Text Editor = determines the default Text Editor and what the "Text Editor" menu option does (related to the command desktop-defaults-run -te).
Image Viewer = determines the default Image Viewer program.
Video Player = determines the default Video Player program.
Audio Player = determines the default Audio Player program.

You can launch the Preferred Applications selection window from the Control Centre (Desktop tab) or from terminal

$ desktop-defaults-set

Installation[edit | edit source]

The antiX Desktop Session manager is already included in antiX Full and Base editions.
For those who have accidentally removed it or want to include it when building from the Core or Net editions, they can install it manually, downloading the package desktop-session-antix from the antiX repos.

$ sudo apt install desktop-session-antix

It may be necessary to also copy the .desktop-session folder to your home folder

$ cp -r /etc/skel/.desktop-session ~/

For each new user created after installing desktop-session-antix, this step is done automatically (no need for user input).

For updating the default Applications menu automatically (for any of the supported Window managers) every time a new program is installed, the packages desktop-defaults-base-antix, xdg-utils, python-gtk2 and python-xdg are also needed.

$ sudo apt install desktop-defaults-base-antix xdg-utils python-gtk2 python-xdg

For the "Exit Session" window to work, the packages pm-utils and python-gtk2 are also needed.

To change the wallpapers, you will need to install wallpaper-antix program.

The desktop-session-antix is very interlinked with the customized SLiM Login manager, but it can also work without it (requiring some changes, like launching it from the startup file corresponding to the window manager you are using).

Configuration[edit | edit source]

Most options will be found in the folder .desktop-session inside your home folder. Some can also be configured using supporting programs.

tip: in antiX Full and Base editions, via ControlCentre you can open a tabbed text editor
containing various configuration files for convenient editing.

Main Desktop Session Configuration[edit | edit source]

The file ~/.desktop-session/desktop-session.conf contains the most important configuration options. All the options need to be edited in a Text editor manually. They are all accompanied of a comment that explains their function and some valid changes. Some of the most important options are:

STARTUP_DELAY: It will give a delay (in seconds) before it starts loading different options after the Window manager has started. For some old computers, the window manager may take longer than expected to load, and that may interfere with some programs auto-starting from the desktop session startup file, or even impede the proper loading of the desktop-icon manager. For those cases, changing the value between 3 and 5 should suffice.
LOAD_CONKY: If you dislike the System monitor on your desktop (Conky), or you are in need to conserve hardware resources, you can disable it permanently by changing the value from "true" to "false".
LOAD_STARTUP_FILE: If you only want the Window Manager's startup file to control the programs that auto-start, you can disable this option (changing it to "false", or leave the startup file empty. It will be "false" for minimal desktop sessions.
SCREEN_BLANK_TIME: Instead of an auto-suspend or screensaver option, antiX "blanks" your screen (turns off your display) after certain amount of time. Change here the amount of time in seconds (or use the Set Screen Blanking program from the Session section in the Control Centre).
STARTUP_SOUND_LEVEL: If you want to change the default volume when the system starts, change it here. It can be set from "0%" to "100%".
A full copy of the configuration file:
#This is the desktop-session config file.
#This is structured in a bash script format, so all options must be option="desired-option"

#Session service delay.
#This is to set how long to delay startup to give enough time for the wm to completely load.
#before starting to load other applications. This wait period will be started after the 
#window manager has been found running.
#TIME is expressed in seconds
#Options: 0-9...
STARTUP_DELAY="2"

#Session window manager check
#This is to set the amount of times desktop-session checks for a running window manager
#before giving up and denying the session to load.
#Options: 0-9...
TIMES_TO_CHECK="20"

#Session give up override
#This is to set the override if the window manager is never found to be running by 
#desktop-session. This will force the session to load if set to true.
#Options: true | false
FORCE_LOAD="false"

#Session Protect.
#This is how to protect the user from automatic updating of any file within desktop-session.
#Examples are the menu, any file compare within file_compare, etc
#Options for this are: 
#SESSION_PROTECT="true #Strictly protect the user, leave the user to deal with any of the updating
#SESSION_PROTECT="ask #Notify me at startup of any changes and allow me to choose what to update
#SESSION_PROTECT="false #Just update me, I dont want to worry about falling behind.
SESSION_PROTECT="false"

#Notification Dialog
#This is where to enable / disable the session loading dialog
#Options: true | false
NOTIFICATION_DIALOG="false"

#Notification text or program
#This is where the text is set for the notification that the session is loading.
#This can be a specified text string or a program that will return a text string
#Examples:
#NOTIFICATION_TEXT="Session is Loading, Please Wait....."
#NOTIFICATION_TEXT="/usr/games/fortune"
NOTIFICATION_TEXT="Session is Loading, Please Wait....."

#Startup Sound
#Play Sound when loading the desktop (uses terminal command play)
#Options: true | false
STARTUP_SOUND="false"

#Startup Sound File
#Location of the file for the startup sound 
STARTUP_SOUND_FILE="$HOME/.desktop-session/startup.ogg"

#Startup Dialog
#This is where to enable / disable the session startup dialog
#Options: true | false
STARTUP_DIALOG="false"

#Startup Dialog Command
#This is where to set the startup dialog command
#Examples: 
#STARTUP_DIALOG_CMD="leafpad ~/.startup-text
#STARTUP_DIALOG_CMD="yad --image='info' --text='this is my startup dialog'"
STARTUP_DIALOG_CMD="/usr/local/lib/desktop-session/startup-dialog.py"

#Session load conky
#This will load a window manager specific conky from ~/.conky
#There must be a corresponding conkyrc in ~/.conky in the form of windowmanager-conkyrc
#Else we will load conky without the -c parameter
#Options: true | false
LOAD_CONKY="true"

#Session load xdg autostart
#This will load any application that is setup to autostart via xdg autostart directories /
#.desktop files.
#Options: true | false
LOAD_XDG_AUTOSTART="false"

#Session load startup
#This will load any application that is setup to autostart via /etc/desktop-session/startup
#Options: true | false
LOAD_STARTUP_FILE="true"

#Session screen blank
#This is to set the amount of time that the screen stays visible.
#Desktop-session sets the dpms settings according to the screen blank value set here.
#TIME expressed in seconds
#Options: 0-9...
SCREEN_BLANK_TIME="3600"

#Session other desktops window
#This is to set the other desktops window to pop up or not.
#true = pop up
#false = no pop up
OTHER_DESKTOPS_WINDOW="true"

#Default Sound Level
#Set the sound volume level when starting up to default level when startup sound is true
#Set using amixer sset 'Master' -M
#Level is set from 0% - 100%
STARTUP_SOUND_LEVEL="65%"

Startup applications[edit | edit source]

Add all programs and commands you want to auto-start with your user session to the ~/.desktop-session/startup file in this format:

name-of-command &

Example:

firefox-esr &


Tips:

  • If you want a certain command to startup for only a specific window manager, add the command to the window manager's startup file instead.
  • If, after having edited your configuration file, you later wonder "What's changed, compared to the 'original' copy?"...
    you can find an original copy here: /etc/desktop-session/desktop-session.conf

Automount[edit | edit source]

Most of automounting options can also be configured with the Configure Automount (from the package automount-antix) program included in antiX Base and Full editions (launched from the Control Centre, Disk section).