From 9da237b6202c203def8a77f4690ac06791096ea8 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Thu, 21 Feb 2013 14:51:52 +0100 Subject: Add initial systemd user service units for awesome and screen --- .config/systemd/user/awesome.service | 11 +++++++++++ .config/systemd/user/default.target | 1 + .config/systemd/user/graphical.target | 18 +++++++++++++++++ .../user/graphical.target.wants/awesome.service | 1 + .../graphical.target.wants/xressources.service | 1 + .config/systemd/user/multiplexer.target | 8 ++++++++ .../user/multiplexer.target.wants/screen.service | 1 + .config/systemd/user/screen.service | 10 ++++++++++ .config/systemd/user/xorg.service | 23 ++++++++++++++++++++++ .config/systemd/user/xressources.service | 11 +++++++++++ .scripts/set_xressources.sh | 2 ++ 11 files changed, 87 insertions(+) create mode 100644 .config/systemd/user/awesome.service create mode 120000 .config/systemd/user/default.target create mode 100644 .config/systemd/user/graphical.target create mode 120000 .config/systemd/user/graphical.target.wants/awesome.service create mode 120000 .config/systemd/user/graphical.target.wants/xressources.service create mode 100644 .config/systemd/user/multiplexer.target create mode 120000 .config/systemd/user/multiplexer.target.wants/screen.service create mode 100644 .config/systemd/user/screen.service create mode 100644 .config/systemd/user/xorg.service create mode 100644 .config/systemd/user/xressources.service diff --git a/.config/systemd/user/awesome.service b/.config/systemd/user/awesome.service new file mode 100644 index 0000000..06a0e6a --- /dev/null +++ b/.config/systemd/user/awesome.service @@ -0,0 +1,11 @@ +[Unit] +Description=Awesome window manager +After=xorg.target +Wants=xorg.target + +[Service] +Type=simple +ExecStart=/usr/bin/awesome + +[Install] +WantedBy=graphical.target diff --git a/.config/systemd/user/default.target b/.config/systemd/user/default.target new file mode 120000 index 0000000..ad8a2bc --- /dev/null +++ b/.config/systemd/user/default.target @@ -0,0 +1 @@ +/home/ben/.config/systemd/user/graphical.target \ No newline at end of file diff --git a/.config/systemd/user/graphical.target b/.config/systemd/user/graphical.target new file mode 100644 index 0000000..77d8aa1 --- /dev/null +++ b/.config/systemd/user/graphical.target @@ -0,0 +1,18 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Graphical Interface +Documentation=man:systemd.special(7) +#Requires=multi-user.target +#After=multi-user.target +#Conflicts=rescue.target +#Wants=display-manager.service +#AllowIsolate=yes + +[Install] +Alias=default.target diff --git a/.config/systemd/user/graphical.target.wants/awesome.service b/.config/systemd/user/graphical.target.wants/awesome.service new file mode 120000 index 0000000..4243f39 --- /dev/null +++ b/.config/systemd/user/graphical.target.wants/awesome.service @@ -0,0 +1 @@ +/home/ben/.config/systemd/user/awesome.service \ No newline at end of file diff --git a/.config/systemd/user/graphical.target.wants/xressources.service b/.config/systemd/user/graphical.target.wants/xressources.service new file mode 120000 index 0000000..8602d06 --- /dev/null +++ b/.config/systemd/user/graphical.target.wants/xressources.service @@ -0,0 +1 @@ +/home/ben/.config/systemd/user/xressources.service \ No newline at end of file diff --git a/.config/systemd/user/multiplexer.target b/.config/systemd/user/multiplexer.target new file mode 100644 index 0000000..2b4ca63 --- /dev/null +++ b/.config/systemd/user/multiplexer.target @@ -0,0 +1,8 @@ +[Unit] +Description=Terminal multiplexer +Documentation=info:screen man:screen(1) man:tmux(1) +#After=cruft.target +#Wants=cruft.target + +[Install] +Alias=default.target diff --git a/.config/systemd/user/multiplexer.target.wants/screen.service b/.config/systemd/user/multiplexer.target.wants/screen.service new file mode 120000 index 0000000..afb9096 --- /dev/null +++ b/.config/systemd/user/multiplexer.target.wants/screen.service @@ -0,0 +1 @@ +/home/ben/.config/systemd/user/screen.service \ No newline at end of file diff --git a/.config/systemd/user/screen.service b/.config/systemd/user/screen.service new file mode 100644 index 0000000..639360e --- /dev/null +++ b/.config/systemd/user/screen.service @@ -0,0 +1,10 @@ +[Unit] +Description=Terminal multiplexer + +[Service] +Type=forking +ExecStart=/usr/bin/screen -dmS session +ExecStop=/usr/bin/screen -S session -X quit + +[Install] +WantedBy=multiplexer.target diff --git a/.config/systemd/user/xorg.service b/.config/systemd/user/xorg.service new file mode 100644 index 0000000..1aaa1ed --- /dev/null +++ b/.config/systemd/user/xorg.service @@ -0,0 +1,23 @@ + +# +# Minimal Xorg service file - launches Xorg as a service unit +# + +# The Xorg launch helper forks, launches Xorg and waits for Xorg to +# accept incoming connections to $DISPLAY, and then signals READY +# to systemd. This guarantees that services that require access to +# $DISPLAY during the session don't start too early. +# +# If you implement a service that requires access to $DISPLAY, your +# service unit file needs to include 'After=xorg.target'. + +[Unit] +Description=Xorg server launch helper +Before=xorg.target + +[Service] +Type=notify +ExecStart=/usr/bin/xorg-launch-helper :0 -nolisten tcp -noreset -ardelay 250 -arinterval 20 vt1 +Restart=always +RestartSec=10 + diff --git a/.config/systemd/user/xressources.service b/.config/systemd/user/xressources.service new file mode 100644 index 0000000..6bce40a --- /dev/null +++ b/.config/systemd/user/xressources.service @@ -0,0 +1,11 @@ +[Unit] +Description=Xorg Ressources +After=xorg.target +Wants=xorg.target + +[Service] +Type=simple +ExecStart=/home/ben/.scripts/set_xressources.sh + +[Install] +WantedBy=graphical.target diff --git a/.scripts/set_xressources.sh b/.scripts/set_xressources.sh index ef56179..a24f8ef 100755 --- a/.scripts/set_xressources.sh +++ b/.scripts/set_xressources.sh @@ -1,3 +1,5 @@ +#!/bin/sh + find ~/.config/ \ -mindepth 2 -maxdepth 2 \ -type f -iname "*.xdefaults" \ -- cgit