Skip to content

Commit

Permalink
initialize XDG_RUNTIME_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
cylgom committed Jun 4, 2019
1 parent 4ab41f0 commit 1e6ec95
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/login.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ enum err init_env(pam_handle_t* handle, struct passwd* pw)
void init_xdg(const char* tty_id, const char* display_name,
enum display_server display_server)
{
char user[15];
snprintf(user, 14, "/run/user/%d", getuid());

setenv("XDG_RUNTIME_DIR", user, 0);
setenv("XDG_SESSION_CLASS", "user", 0);
setenv("XDG_SEAT", "seat0", 0);
setenv("XDG_VTNR", tty_id, 0);
Expand Down

0 comments on commit 1e6ec95

Please sign in to comment.