From da52e705df65e6ceb728593c9af443fe8c2fd96f Mon Sep 17 00:00:00 2001 From: nullgemm Date: Wed, 27 Sep 2017 22:48:44 +0200 Subject: [PATCH] added .xsession/display-setup support --- makefile | 1 + src/config.h | 1 + src/login.c | 4 +++- src/login.h | 3 ++- xsetup.sh | 4 ++++ 5 files changed, 11 insertions(+), 2 deletions(-) create mode 100755 xsetup.sh diff --git a/makefile b/makefile index 79ab22a..bb95c4f 100755 --- a/makefile +++ b/makefile @@ -5,6 +5,7 @@ build/ly : install : build/ly install -d ${DESTDIR}/etc/ly install -D build/ly -t ${DESTDIR}/usr/bin + install -D xsetup.sh -t ${DESTDIR}/etc/ly install -D ly.service -t ${DESTDIR}/usr/lib/systemd/system ln -sf /usr/lib/security/pam_loginuid.so ${DESTDIR}/usr/lib/pam_loginuid.so diff --git a/src/config.h b/src/config.h index 4b03fd3..f6aa376 100755 --- a/src/config.h +++ b/src/config.h @@ -28,6 +28,7 @@ #define LY_CMD_HALT "/sbin/shutdown" #define LY_CMD_XINITRC "~/.xinitrc" #define LY_CMD_MCOOKIE "/usr/bin/mcookie" +#define LY_CMD_XSETUP "/etc/ly/xsetup.sh" #define LY_XAUTHORITY ".lyxauth" /* paths */ diff --git a/src/login.c b/src/login.c index d7ee889..dc6c5e1 100644 --- a/src/login.c +++ b/src/login.c @@ -483,7 +483,9 @@ int xinitrc) waitpid(child, &status, 0); reset_terminal(pwd); snprintf(cmd, sizeof(cmd), - "exec xinit %s%s -- %s %s %s -auth %s", xinitrc ? "" : "/usr/bin/", + "exec xinit %s %s%s -- %s %s %s -auth %s", + LY_CMD_XSETUP, + xinitrc ? "" : "/usr/bin/", de_command, LY_CMD_X, display_name, vt, getenv("XAUTHORITY")); execve(pwd->pw_shell, argv, environ); diff --git a/src/login.h b/src/login.h index e157d42..567bce0 100644 --- a/src/login.h +++ b/src/login.h @@ -10,7 +10,8 @@ struct pam_response** resp, void* appdata_ptr); int start_env(const char* username, const char* password, const char* de_command, enum deserv_t display_server); void launch_xorg(struct passwd* pwd, pam_handle_t* pam_handle, -const char* de_command, const char* display_name, const char* vt, int xinitrc); +const char* de_command, const char* display_name, const char* vt, +int xinitrc); void launch_wayland(struct passwd* pwd, pam_handle_t* pam_handle, const char* de_command); void launch_shell(struct passwd* pwd, pam_handle_t* pam_handle); diff --git a/xsetup.sh b/xsetup.sh new file mode 100755 index 0000000..84b8d54 --- /dev/null +++ b/xsetup.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +~/.xsession +exec $@