Skip to content

Commit

Permalink
Only export XDG_CONFIG_HOME and XDG_DATA_HOME if they aren't already set
Browse files Browse the repository at this point in the history
  • Loading branch information
kenvandine committed Jan 22, 2025
1 parent d7101a9 commit abc18d5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions snap/local/launcher
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#!/bin/sh
set -e

export XDG_CONFIG_HOME="$SNAP_REAL_HOME/.config"
export XDG_DATA_HOME="$SNAP_REAL_HOME/.local/share"
# Set these to reasonable defaults if not already set
if [ -z "$XDG_CONFIG_HOME" ]; then
export XDG_CONFIG_HOME="$SNAP_REAL_HOME/.config"
fi

if [ -z "$XDG_DATA_HOME" ]; then
export XDG_DATA_HOME="$SNAP_REAL_HOME/.local/share"
fi

export HOME="$SNAP_REAL_HOME"

if [ "$SNAP_ARCH" = "amd64" ]; then
Expand Down

0 comments on commit abc18d5

Please sign in to comment.