G

Untitled

public
Guest Jun 17, 2026 178 days 18
Clone
Plaintext paste1.txt 99 lines (77 loc) | 3.95 KB
1
# -------------------------------------------------------------------
2
# GENERAL ENVIRONMENT STRATEGY NOTES
3
# -------------------------------------------------------------------
4
#
5
# Profile scripts are the general and better alternative to PAM.
6
#
7
# This file pam_env.conf (read 1st) is a bad place to set variables.
8
# File /etc/environment (read 2nd) also belongs to PAM with similar
9
# function, but can be sourced by shells. Old ~/.pam_environment
10
# (read 3rd, if at all) is no longer enabled by default, but can be.
11
#
12
# Corner cases involving "su --login" commands and such might
13
# inspire use of pam_env files. Consider /etc/environment as
14
# the place for customization. Also, PAM can be directed via
15
# "envfile" to read some other file than /etc/environment.
16
#
17
# https://wiki.archlinux.org/title/Environment_variables
18
# https://liolok.com/set-environment-variables-with-pam-env/
19
#
20
21
22
# -------------------------------------------------------------------
23
# APPS: OFFICIAL LINUX AND FREEDESKTOP VARIABLES
24
# -------------------------------------------------------------------
25
26
# Just establish base defaults from PAM, they will change in
27
# profile scripts as needed. BROWSER is pretty "standard" if not
28
# specified by Freedesktop; prefer text browsing for recovery use.
29
30
EDITOR DEFAULT=nano
31
VISUAL DEFAULT=nano
32
BROWSER DEFAULT=elinks
33
34
35
# -------------------------------------------------------------------
36
# XDG: OFFICIAL FREEDESKTOP VARIABLES
37
# -------------------------------------------------------------------
38
39
# Set standard default values. If profile scripts detect custom
40
# directories, these values will be overridden.
41
#
42
# CONFIG and CACHE default in ~/.config and ~/.cache
43
# STATE and DATA default in ~/.local/state and ~/.local/share/
44
45
XDG_CONFIG_HOME DEFAULT="@{HOME}/.config"
46
XDG_CACHE_HOME DEFAULT="@{HOME}/.cache"
47
XDG_STATE_HOME DEFAULT="@{HOME}/.local/state"
48
XDG_DATA_HOME DEFAULT="@{HOME}/.local/share"
49
50
XDG_DATA_DIRS DEFAULT="/usr/local/share:/usr/share"
51
XDG_CONFIG_DIRS DEFAULT="/etc/xdg"
52
53
54
# -------------------------------------------------------------------
55
# EPHEMERAL DIRS VIS A VIS FREEDESKTOP INCL. XDG_RUNTIME_DIR
56
# -------------------------------------------------------------------
57
58
# Even more prefer profile scripts over PAM for ephemeral-data
59
# XDG vars for cache, state, and runtime. State is for history
60
# and logs, little used.
61
62
# For illustration, an ephemeral dir PAM possibility not used:
63
#
64
# XDG_CACHE_HOME DEFAULT="/tmp/@{PAM_USER}/xdg/cache"
65
# XDG_STATE_HOME DEFAULT="/tmp/@{PAM_USER}/xdg/state"
66
67
# XDG_RUNTIME_DIR is set in profile scripts. However it could
68
# alternatively be set by a pam_rundir module, which is not stock.
69
# The distro package must first be installed, then invoked from
70
# /etc/pam.d/system-login per its man page. It's simpler to use
71
# scripts for this important XDG variable.
72
73
74
# -------------------------------------------------------------------
75
# Problems with HOME and UID
76
# -------------------------------------------------------------------
77
#
78
# https://unix.stackexchange.com/questions/413965
79
# ("For future visitors...")
80
# https://www.linuxquestions.org/questions/linux-general-1/umask-and-permissions-has-umask-007-bad-side-effects-869068/
81
82
# @{HOME} is a special PAM var, since ${HOME} fails
83
84
# No @PAM_UID as of late 2022 per
85
# github.com/linux-pam/linux-pam/issues/501
86
# only @PAM_USER is available
87
88
89
# -------------------------------------------------------------------
90
# FLATPAK NOTES
91
# -------------------------------------------------------------------
92
93
# Flatpak plays with XDG_DATA_DIRS in /etc/profile.d/flatpak
94
# to add its "--installations" list to the stack. This setup
95
# should be harmless.
96
97
# Flatpak uses sandboxed versions of XDG vars in any case.
98
# https://github.com/flatpak/flatpak/wiki/FileSystem
99
# "In addition to /app and /usr, each application sandbox..."