My systemd user units for managing X sessions
Latest commit a960cab Apr 14, 2016 @alezost Last commit
Permalink
Failed to load latest commit information.
.gitignore Total reconstruction for multiple instances of X Nov 10, 2013
README.md Last commit Apr 14, 2016
conkeror@.service Total reconstruction for multiple instances of X Nov 10, 2013
dbus.service Update dbus units for systemd 209 Mar 10, 2014
dbus.socket Update dbus units for systemd 209 Mar 10, 2014
default.target Initial commit Nov 6, 2013
emacs-trunk@.service Add service for emacs-trunk Mar 16, 2014
emacs@.service Total reconstruction for multiple instances of X Nov 10, 2013
emacsclient@.service Add services for emacs daemon/client Feb 5, 2014
emacsd.service Add services for emacs daemon/client Feb 5, 2014
env.service env: Add missing backslashes Jul 20, 2015
firefox@.service Total reconstruction for multiple instances of X Nov 10, 2013
gpg-agent.service gpg-agent: Update the service for GPG 2.1 Apr 5, 2015
gui@.target Total reconstruction for multiple instances of X Nov 10, 2013
guilewm@.service Add guile-wm service May 3, 2014
irexec.service Total reconstruction for multiple instances of X Nov 10, 2013
lxde@.service Total reconstruction for multiple instances of X Nov 10, 2013
midi.service Add "midi.service" Mar 14, 2015
mosd@.service mosd: Move config file (again) Apr 5, 2015
numlock@.service Total reconstruction for multiple instances of X Nov 10, 2013
openbox@.service Total reconstruction for multiple instances of X Nov 10, 2013
setxkbmap@.service Total reconstruction for multiple instances of X Nov 10, 2013
stumpwm@.service Total reconstruction for multiple instances of X Nov 10, 2013
timidity.service Add "timidity.service" Mar 14, 2015
tvguide.service tvguide: Change file name of 'tvguide-refresh' Jul 20, 2015
tvguide.timer tvguide: Change the timer values Mar 14, 2015
unclutter@.service Add unclutter service Dec 28, 2013
x@.service Total reconstruction for multiple instances of X Nov 10, 2013
xbase@.target Add environment service May 3, 2014
xmodmap@.service Total reconstruction for multiple instances of X Nov 10, 2013
xrdb@.service Total reconstruction for multiple instances of X Nov 10, 2013
xset@.service Total reconstruction for multiple instances of X Nov 10, 2013
xsetroot@.service Total reconstruction for multiple instances of X Nov 10, 2013
xterm@.service Total reconstruction for multiple instances of X Nov 10, 2013

README.md

This repository is dead: nowadays I use GNU Shepherd to manage my user services: https://github.com/alezost/shepherd-config

About

These are my systemd user units located in $HOME/.config/systemd/user. I use systemd not only for running daemons, but for starting X session, window manager, various GUI utils and applications.

For information about systemd user session and about managing X session with user services, you may read:

Description

Basically the structure of my user units is the following:

  • user daemons (like gpg-agent) and gui@.target are "attached" to (WantedBy) default.target;
  • gui@.target provides a GUI interface – it starts:
    • xbase@.target – X server with configuration utils (xmodmap, xset, ...);
    • GUI applications (emacs, xterm, ...) "attacted" to this target.

For turning X server into a daemon (for x@.service), notifying when it is ready, i use a wonderful tiny bash script x-daemon from joukewitteveen/xlogin. Previously i used sofar/xorg-launch-helper.

It is possible to organize multiple X sessions with different settings and starting applications: DISPLAY :0 will be run on vt7, DISPLAY :1 on vt8 and so on.

Example

Here is my configuration of X session.

Window manager and vital apps:

systemctl --user enable stumpwm@0
systemctl --user enable emacs@0
systemctl --user enable conkeror@0

X settings:

systemctl --user enable numlock@0
systemctl --user enable setxkbmap@0
systemctl --user enable xmodmap@0
systemctl --user enable xrdb@0
systemctl --user enable xset@0
systemctl --user enable xsetroot@0

I want this X session to start on login, so:

systemctl --user enable gui@0.target

(I set up autologin as described at Automatic login to virtual console - ArchWiki)

Sometimes i need another instance of X server with another configuration:

systemctl --user enable numlock@1
systemctl --user enable xmodmap@1
systemctl --user enable xrdb@1
systemctl --user enable xset@1
systemctl --user enable openbox@1
systemctl --user enable xterm@1

Actually i have a shell alias scu for systemctl --user (and sc for systemctl), so i can run the second X session with scu start gui@1.target (it will be started on virtual terminal 8, i.e. Ctrl+Alt+F7/F8 to switch between X sessions) and if i don't need it anymore, then just scu stop gui@1.target and there is no sign of it.