diff -Naur a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt	2013-10-02 00:38:05.000000000 +0200
+++ b/CMakeLists.txt	2021-04-06 16:48:07.797604702 +0200
@@ -119,6 +119,7 @@
 	if(PAM_FOUND)
 		message("\tPAM Found")
 		set(SLIM_DEFINITIONS ${SLIM_DEFINITIONS} "-DUSE_PAM")
+		target_link_libraries(libslim ${PAM_LIBRARY})
 		target_link_libraries(${PROJECT_NAME} ${PAM_LIBRARY})
 		target_link_libraries(slimlock ${PAM_LIBRARY})
 		include_directories(${PAM_INCLUDE_DIR})
@@ -178,6 +179,8 @@
 )
 
 target_link_libraries(libslim
+	${X11_Xft_LIB}
+	${X11_Xrandr_LIB}
     ${JPEG_LIBRARIES}
 	${PNG_LIBRARIES}
 )
diff -Naur a/app.cpp b/app.cpp
--- a/app.cpp	2013-10-02 00:38:05.000000000 +0200
+++ b/app.cpp	2021-04-06 17:02:48.093291059 +0200
@@ -811,8 +811,13 @@
 
 	StopServer();
 	RemoveLock();
-	while (waitpid(-1, NULL, WNOHANG) > 0); /* Collects all dead childrens */
-	Run();
+	if (force_nodaemon) {
+		delete LoginPanel;
+		exit(ERR_EXIT); /* use ERR_EXIT so that systemd's Restart=on-failure works */
+	} else {
+		while (waitpid(-1, NULL, WNOHANG) > 0); /* Collects all dead childrens */
+		Run();
+	}
 }
 
 void App::KillAllClients(Bool top) {
diff -Naur a/slim.conf b/slim.conf
--- a/slim.conf	2013-10-02 00:38:05.000000000 +0200
+++ b/slim.conf	2021-04-06 17:45:22.985121305 +0200
@@ -1,8 +1,8 @@
 # Path, X server and arguments (if needed)
 # Note: -xauth $authfile is automatically appended
-default_path        /bin:/usr/bin:/usr/local/bin
+default_path        /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
 default_xserver     /usr/bin/X
-#xserver_arguments   -dpi 75
+#xserver_arguments  -nolisten tcp vt07
 
 # Commands for halt, login, etc.
 halt_cmd            /sbin/shutdown -h now
@@ -33,7 +33,7 @@
 # to adjust the command according to your preferred shell,
 # i.e. for freebsd use:
 # login_cmd           exec /bin/sh - ~/.xinitrc %session
-login_cmd           exec /bin/bash -login ~/.xinitrc %session
+login_cmd           exec dbus-launch --exit-with-session %session
 
 # Commands executed when starting and exiting a session.
 # They can be used for registering a X11 session with
@@ -47,11 +47,9 @@
 # options "-d" and "-nodaemon"
 # daemon	yes
 
-# Available sessions (first one is the default).
-# The current chosen session name is replaced in the login_cmd
-# above, so your login command can handle different sessions.
-# see the xinitrc.sample file shipped with slim sources
-sessions            xfce4,icewm-session,wmaker,blackbox
+# Set directory that contains the xsessions.
+# slim reads xsesion from this directory, and be able to select.
+sessiondir            /usr/share/xsessions/
 
 # Executed when pressing F11 (requires imagemagick)
 screenshot_cmd      import -window root /slim.png
@@ -84,7 +82,7 @@
 current_theme       default
 
 # Lock file
-lockfile            /var/run/slim.lock
+lockfile            /var/lock/slim.lock
 
 # Log file
 logfile             /var/log/slim.log
diff -Naur a/slim.service b/slim.service
--- a/slim.service	2013-10-02 00:38:05.000000000 +0200
+++ b/slim.service	2021-04-06 16:59:56.330060038 +0200
@@ -4,6 +4,7 @@
 
 [Service]
 ExecStart=/usr/bin/slim -nodaemon
+Restart=on-failure
 
 [Install]
 Alias=display-manager.service
diff -Naur a/themes/default/slim.theme b/themes/default/slim.theme
--- a/themes/default/slim.theme	2013-10-02 00:38:05.000000000 +0200
+++ b/themes/default/slim.theme	2021-04-06 21:13:13.049728133 +0200
@@ -4,8 +4,8 @@
 # Messages (ie: shutdown)
 msg_color               #FFFFFF
 msg_font                Verdana:size=18:bold:dpi=75
-msg_x                   50%
-msg_y                   40%
+msg_x                   25%
+msg_y                   50%
 msg_shadow_color #702342
 msg_shadow_xoffset 1
 msg_shadow_yoffset 1
@@ -15,23 +15,25 @@
 background_color        #eedddd
 
 # Input controls
-input_panel_x           25%
-input_panel_y           65%
-input_name_x            394
-input_name_y            181
-input_font          	Verdana:size=12:dpi=75
-input_color             #000000
+input_panel_x           50%
+input_panel_y           50%
+input_name_x            275
+input_name_y            244
+input_pass_x            275
+input_pass_y            284
+input_font          	Verdana:size=21:bold:dpi=75
+input_color             #FFFFFF
 
 # Username / password request
-username_font          	Verdana:size=14:bold:dpi=75
-username_color        	#f9f9f9
-username_x              280
-username_y              183
-password_x              50%
-password_y              183
-username_shadow_color   #702342
-username_shadow_xoffset 1
-username_shadow_yoffset 1
+username_font          	Verdana:size=21:bold:dpi=75
+username_color        	#FFFFFF
+username_x              20%
+username_y              60%
+password_x              20%
+password_y              800%
+username_shadow_color   #000000
+username_shadow_xoffset 2
+username_shadow_yoffset 3
 
-username_msg            Username:
-password_msg            Password:
+username_msg
+password_msg
