Skip to content

Commit

Permalink
properly support xdg:
Browse files Browse the repository at this point in the history
  • Loading branch information
zunda-arrow committed May 18, 2024
1 parent 19a6a4c commit 068af71
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Aporia

Aporia is a login manager that displays ascii art. It supports x11 and wayland sessions.
Aporia is a login manager that displays ascii art. It supports x11 and wayland sessions, and the [XDG base directory specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html).

<img src="https://github.com/Lunarmagpie/aporia/assets/65521138/98e321a7-9bd7-4ef8-9b1d-da0be0a3c7dc" alt="drawing" width="700"/>

Only systemd is supported.

## Installtion
## Compilation & Installtion
Install the dependencies:
- Go compiler
- gcc
- pam (libpam-dev on ubuntu)
- pam (libpam-dev on debian based distros)

Run the install.sh script as root.
```sh
Expand Down Expand Up @@ -68,15 +68,13 @@ font and all font sizes available on your computer.

<details>
<summary>Why does my ascii art show up as diamonds?</summary><br>

Some terminal fonts do not support certain braille characters. Using a different ascii art generator will likely
fix your problem.
Some terminal fonts do not support braille characters. Using an ascii art generator that does not output braille characters will fix your problem.
</details>

<details>
<summary>Is aporia production ready?</summary><br>

There is a bug where somethimes the window manager will refuse to launch. I am looking into this.
I daily drive aporia with no issues.

</details>

Expand Down
15 changes: 11 additions & 4 deletions login/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,22 @@ func makeEnv(pam_handle *C.struct_pam_handle, pwnam *C.struct_passwd, desktopNam

setEnv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin")

// pam_systemd options
// XDG Session environment.
// See: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
setEnv("XDG_SESSION_TYPE", sessionType)
setEnv("XDG_SESSION_DESKTOP", desktopName)
setEnv("XDG_SESSION_DESKTOP", desktopName)
setEnv("XDG_SESSION_CLASS", "user")

setEnv("XDG_CONFIG_HOME", fmt.Sprint(homeDir, "/.config"))
setEnv("XDG_CACHE_HOME", fmt.Sprint(homeDir, "/.cache"))
setEnv("XDG_DATA_HOME", fmt.Sprint(homeDir, "/.local/share"))
setEnv("XDG_STATE_HOME", fmt.Sprint(homeDir, "/.local/state"))
setEnv("XDG_RUNTIME_DIR", user)
// setEnv("XDG_SESSION_ID", "1")
// setEnv("XDG_SEAT", "seat0")
// setEnv("XDG_VTNR", "1")

// System Directories
setEnv("XDG_DATA_DIRS", "/usr/local/share:/usr/share")
setEnv("XDG_CONFIG_DIRS", "/etc/xdg")

os.Chown(user, int(pwnam.pw_uid), int(pwnam.pw_gid))

Expand Down

0 comments on commit 068af71

Please sign in to comment.