mirror of
https://github.com/Foltik/dotfiles
synced 2024-11-24 04:22:50 -05:00
Xorg as a systemd service
This commit is contained in:
parent
4c8d52f0b3
commit
c315a09d37
9
lain/.config/systemd/user/compton.service
Normal file
9
lain/.config/systemd/user/compton.service
Normal file
@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=X11 Compositor
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
ExecStart=compton --config /home/lain/.config/compton/config -b
|
||||
|
||||
[Install]
|
||||
WantedBy=i3@.service
|
12
lain/.config/systemd/user/emacs.service
Normal file
12
lain/.config/systemd/user/emacs.service
Normal file
@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Emacs text editor
|
||||
Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/emacs --fg-daemon
|
||||
ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)"
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
13
lain/.config/systemd/user/i3@.service
Normal file
13
lain/.config/systemd/user/i3@.service
Normal file
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=i3 Window Manager
|
||||
After=x11@0.target
|
||||
Requisite=x11@0.target
|
||||
|
||||
[Service]
|
||||
Environment=DISPLAY=:0
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/env bash -c 'exec 8>%t/x11-wm@0; exec i3'
|
||||
SyslogIdentifier=i3
|
||||
|
||||
[Install]
|
||||
RequiredBy=x11@0.target
|
9
lain/.config/systemd/user/polybar-bottom.service
Normal file
9
lain/.config/systemd/user/polybar-bottom.service
Normal file
@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Polybar Bottom
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=polybar bottom
|
||||
|
||||
[Install]
|
||||
WantedBy=i3@.target
|
9
lain/.config/systemd/user/polybar-top.service
Normal file
9
lain/.config/systemd/user/polybar-top.service
Normal file
@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Polybar Top
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=polybar top
|
||||
|
||||
[Install]
|
||||
WantedBy=i3@.target
|
@ -3,7 +3,7 @@ Description=Load a random wallpaper and colorscheme
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
ExecStart=/usr/bin/wal -q -i "/home/lain/Pictures/wallpapers" -a "85"
|
||||
ExecStart=/usr/bin/wal -i "/home/lain/Pictures/wallpapers" -a "85"
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
WantedBy=i3@.target
|
||||
|
2
lain/.config/systemd/user/x11@.target
Normal file
2
lain/.config/systemd/user/x11@.target
Normal file
@ -0,0 +1,2 @@
|
||||
[Unit]
|
||||
Description=Connection to X11 display %i
|
@ -2,35 +2,32 @@
|
||||
|
||||
userresources=$HOME/.Xresources
|
||||
usermodmap=$HOME/.Xmodmap
|
||||
sysresources=/etc/X11/xinit/.Xresources
|
||||
sysmodmap=/etc/X11/xinit/.Xmodmap
|
||||
|
||||
xrdb $userresources
|
||||
sysresources=/etc/x11/xinit/.Xresources
|
||||
sysmodmap=/etc/x11/xinit/.Xmodmap
|
||||
|
||||
# merge in defaults and keymaps
|
||||
if [ -f $sysresources ]; then
|
||||
xrdb -merge $sysresources
|
||||
if [ -f $sysresources ]; then xrdb -merge $sysresources; fi
|
||||
if [ -f $sysmodmap ]; then xmodmap $sysmodmap; fi
|
||||
if [ -f $userresources ]; then xrdb -merge $userresources; fi
|
||||
if [ -f $usermodmap ]; then xmodmap $usermodmap; fi
|
||||
|
||||
if [ -d /etc/x11/xinit/xinitrc.d ]; then
|
||||
for f in /etc/x11/xinit/xinitrc.d/?*.sh ; do
|
||||
[ -x "$f" ] && . "$f"
|
||||
done
|
||||
unset f
|
||||
fi
|
||||
|
||||
if [ -f $sysmodmap ]; then
|
||||
xmodmap $sysmodmap
|
||||
fi
|
||||
# The window manager will open this named pipe, closing it once it exits.
|
||||
mkfifo "${XDG_RUNTIME_DIR}/x11-wm@${DISPLAY:1:2}"
|
||||
|
||||
if [ -f "$userresources" ]; then
|
||||
xrdb -merge "$userresources"
|
||||
fi
|
||||
# Delete the pipe on exit
|
||||
trap "rm -f ${XDG_RUNTIME_DIR}/x11-wm@${DISPLAY:1:2}" EXIT
|
||||
|
||||
if [ -f "$usermodmap" ]; then
|
||||
xmodmap "$usermodmap"
|
||||
fi
|
||||
# Fork a process that will exit once the pipe is closed
|
||||
cat < "${XDG_RUNTIME_DIR}/x11-wm@${DISPLAY:1:2}" &
|
||||
|
||||
# start some nice programs
|
||||
|
||||
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
|
||||
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
|
||||
[ -x "$f" ] && . "$f"
|
||||
done
|
||||
unset f
|
||||
fi
|
||||
|
||||
exec i3 >~/.config/i3/log
|
||||
systemctl --user start "x11@${DISPLAY:1:2}.target" &
|
||||
# Wait for the pipe (window manager) to close
|
||||
wait
|
||||
systemctl --user stop "x11@${DISPLAY:1:2}.target" &
|
||||
|
7
lain/.xserverrc
Normal file
7
lain/.xserverrc
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$XDG_VTNR" ]; then
|
||||
exec /usr/bin/Xorg -nolisten tcp -nolisten local "@"
|
||||
else
|
||||
exec /usr/bin/Xorg -nolisten tcp -nolisten local -keeptty "$@" vt$XDG_VTNR
|
||||
fi
|
Loading…
Reference in New Issue
Block a user