Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
steam-runtime-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
steamrt
steam-runtime-tools
Commits
a8d8b31d
Commit
a8d8b31d
authored
6 years ago
by
Simon McVittie
Browse files
Options
Downloads
Patches
Plain Diff
Cope with games that don't follow the XDG basedir spec
Signed-off-by:
Simon McVittie
<
smcv@collabora.com
>
parent
16c04715
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+11
-11
11 additions, 11 deletions
README.md
pressure-vessel-wrap
+18
-8
18 additions, 8 deletions
pressure-vessel-wrap
with
29 additions
and
19 deletions
README.md
+
11
−
11
View file @
a8d8b31d
...
...
@@ -287,14 +287,6 @@ TODO
They'll need some new special-case option analogous to
Flatpak's
`--filesystem=xdg-music:ro`
.
*
To avoid
[
weird behaviour
][]
when part of a game respects
`XDG_CONFIG_HOME`
and part of it hard-codes
`~/.config`
, maybe we
should make
`$fake_home/config`
a synonym (bind-mount) for
`$fake_home/.config`
, and the same for
`$fake_home/.local/share`
with
`$fake_home/data`
and
`$fake_home/.cache`
with
`$fake_home/cache`
?
[
weird behaviour
]:
https://www.ctrl.blog/entry/flatpak-steamcloud-xdg
Design
------
...
...
@@ -307,14 +299,22 @@ freedesktop.org app ID is based on its Steam AppID, for example
`com.steampowered.App70`
for Half-Life.
For the game,
`XDG_CONFIG_HOME`
,
`XDG_DATA_HOME`
and
`XDG_CACHE_HOME`
are set to the
`./config`
,
`./data`
and
`./cache`
directories inside
its private home directory, so well-behaved freedesktop-style apps
will write there.
are set to the
`./.config`
,
`./.local/share`
and
`./.cache`
directories
inside its private home directory, so that well-behaved freedesktop-style
apps will write there, and badly-behaved freedesktop-style apps that
ignore the environment variables and hard-code their default values will
*also*
write there.
*
Example:
[
X3: Terran Conflict
][]
writes to
`$XDG_CONFIG_HOME/EgoSoft/X3TC`
*
Example: Mesa writes to
`$XDG_CACHE_HOME/mesa`
(assuming
`$MESA_GLSL_CACHE_DIR`
is unset)
`./config`
,
`./data`
and
`./cache`
in the private home directory are symbolic
links to
`.config`
,
`.local/share`
and
`.cache`
respectively, for better
discoverability and compatibility with Flatpak (which uses those directories in
`~/.var/app`
as its usual values for
`XDG_CONFIG_HOME`
,
`XDG_DATA_HOME`
and
`XDG_CACHE_HOME`
).
Anything that hard-codes a path relative to
`$HOME`
(including
`.config`
,
`.local/share`
or
`.cache`
) will write to the corresponding directory in
`~/.var/app`
. This is the same as the behaviour of a Flatpak app with
...
...
This diff is collapsed.
Click to expand it.
pressure-vessel-wrap
+
18
−
8
View file @
a8d8b31d
...
...
@@ -642,14 +642,24 @@ else
bwrap_options+
=(
--bind
"
$fake_home
"
"
$fake_home
"
)
# Set up /var/tmp, XDG_*_HOME like Flatpak does
mkdir
-m700
-p
"
$fake_home
/cache"
mkdir
-m700
-p
"
$fake_home
/cache/tmp"
bwrap_options+
=(
--bind
"
$fake_home
/cache/tmp"
/var/tmp
)
bwrap_options+
=(
--setenv
XDG_CACHE_HOME
"
$fake_home
/cache"
)
mkdir
-m700
-p
"
$fake_home
/config"
bwrap_options+
=(
--setenv
XDG_CONFIG_HOME
"
$fake_home
/config"
)
mkdir
-m700
-p
"
$fake_home
/data"
bwrap_options+
=(
--setenv
XDG_DATA_HOME
"
$fake_home
/data"
)
mkdir
-m700
-p
"
$fake_home
/.cache"
mkdir
-m700
-p
"
$fake_home
/.cache/tmp"
if
[
!
-e
"
$fake_home
/cache"
]
;
then
ln
-fns
.cache
"
$fake_home
/cache"
fi
bwrap_options+
=(
--bind
"
$fake_home
/.cache/tmp"
/var/tmp
)
bwrap_options+
=(
--setenv
XDG_CACHE_HOME
"
$fake_home
/.cache"
)
mkdir
-m700
-p
"
$fake_home
/.config"
if
[
!
-e
"
$fake_home
/config"
]
;
then
ln
-fns
.config
"
$fake_home
/config"
fi
bwrap_options+
=(
--setenv
XDG_CONFIG_HOME
"
$fake_home
/.config"
)
mkdir
-m700
-p
"
$fake_home
/.local"
mkdir
-m700
-p
"
$fake_home
/.local/share"
if
[
!
-e
"
$fake_home
/data"
]
;
then
ln
-fns
.local/share
"
$fake_home
/data"
fi
bwrap_options+
=(
--setenv
XDG_DATA_HOME
"
$fake_home
/.local/share"
)
}
# These might be API entry points, according to .steam/steam/steam.sh.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment