You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Michal Goral 44853bf9ac escape 6 months ago
LICENSE license 7 months ago
Makefile split manpages 7 months ago Update readme 7 months ago
mydm automatically export MYDM_SPAWNED 7 months ago
mydm.1.scdoc Update readme 7 months ago
mydm.5.scdoc export XDG_SESSION_TYPE in manpages 6 months ago
mydm_start escape 6 months ago


mydm is a simple "display manager". It isn't true DM though. It must be spawned separately when you login. Once mydm runs, users can interactively select a session script to start, which will be directly called.

Due to this simplicity users know exactly what's going on during their system startup, which tremendously simplifies their setup and its debugging.

The simplest way to automatically spawn mydm is to source mydm_start file in your login scripts. Depending on your shell this might be for example:

  • .profile for sh
  • .bash_profile for bash
  • .zprofile for zsh
  • for fish

and so on...

Once started, mydm tries to find executable scripts inside $MYDM_SESSION_DIR, then presents them to the user. Selected script is then executed.

mydm doesn't do anything else. It doesn't source any files. Doesn't start anything besides the chosen script. It is a glorious wrapper around Bash select loop.


Use make install to install mydm in a system-wide directory. You can control it by changing the PREFIX variable, for example:

$ PREFIX=$HOME/.local make install

Above command will install all components, including manpages which use scdoc program to generate them. If you don't want to generate manpages, you can install mydm by using make install-base.


mydm isn't terribly configurable, but there are certain options which you can set:

  • $MYDM_SESSION_DIR - a directory which mydm uses to discover start scripts. Default: $HOME/.local/share/mydm-sessions
  • $MYDM_DEFAULT_SESSION - default session which will be automatically executed once mydm is started
  • $MYDM_TTY - TTY on which mydm will be automatically started when sourcing mydm_start file. Default: /dev/tty1
  • $MYDM_SPAWNED - variable automatically exported by mydm. Existence of this variable will prevent spawning a second instance of mydm. If you use systemd to manage your sessions, you might need additional steps to make sure that it is properly propagated to all systemd child processes.

Starting X sessions

mydm will spawn your script through startx executable if it finds a sepecial magic comment #/xsession (xsession string prefixed with a slash) inside the script.

Another hint, which applies for all kind of sessions is that it is a good practice to exec whichever program your script ultimately starts.


export MY_VARIABLE=foo
xrdb -merge "$HOME/.Xresources"

dbus-update-activation-environment --verbose --systemd --all
systemctl --user import-environment
exec /usr/bin/x-window-manager

Wayland sessions


. "${HOME}/.env"
. "${HOME}/.activate-dbus-environment


dbus-update-activation-environment --verbose --systemd --all
systemctl --user unset-environment SWAYSOCK I3SOCK WAYLAND_DISPLAY DISPLAY
systemctl --user import-environment

exec sway