Skip to content

Instantly share code, notes, and snippets.

@jraygauthier
jraygauthier / docker-dbus-session-launcher.sh
Created July 29, 2021 18:39
Docker launcher for proper dbus session support in between separate exec calls
#!/usr/bin/env bash
set -euf -o pipefail
declare uid
uid="$(id -u)"
declare tmp_dir="${TMPDIR:-/run/user/${uid}}"
if ! [[ -d "$tmp_dir" ]]; then
# Fallback to unsafe tmp dir (docker case).
tmp_dir="/tmp"