mirror of https://github.com/fairyglade/ly.git
Use XDG_RUNTIME_DIR for storing Xauthority
This commit is contained in:
parent
609b3f9ddc
commit
908ebf8964
14
src/login.c
14
src/login.c
|
@ -304,10 +304,10 @@ void remove_utmp_entry(struct utmp *entry) {
|
|||
endutent();
|
||||
}
|
||||
|
||||
void xauth(const char* display_name, const char* shell, const char* dir)
|
||||
void xauth(const char* display_name, const char* shell)
|
||||
{
|
||||
char xauthority[256];
|
||||
snprintf(xauthority, 256, "%s/%s", dir, ".lyxauth");
|
||||
snprintf(xauthority, 256, "%s/%s", getenv("XDG_RUNTIME_DIR"), "lyxauth");
|
||||
setenv("XAUTHORITY", xauthority, 1);
|
||||
setenv("DISPLAY", display_name, 1);
|
||||
|
||||
|
@ -343,18 +343,10 @@ void xorg(
|
|||
const char* vt,
|
||||
const char* desktop_cmd)
|
||||
{
|
||||
// generate xauthority file
|
||||
const char* xauth_dir = getenv("XDG_CONFIG_HOME");
|
||||
|
||||
if ((xauth_dir == NULL) || (*xauth_dir == '\0'))
|
||||
{
|
||||
xauth_dir = pwd->pw_dir;
|
||||
}
|
||||
|
||||
char display_name[4];
|
||||
|
||||
snprintf(display_name, 3, ":%d", get_free_display());
|
||||
xauth(display_name, pwd->pw_shell, xauth_dir);
|
||||
xauth(display_name, pwd->pw_shell);
|
||||
|
||||
// start xorg
|
||||
pid_t pid = fork();
|
||||
|
|
Loading…
Reference in New Issue