diff --git a/sx b/sx index 528750b..92facc8 100755 --- a/sx +++ b/sx @@ -24,11 +24,10 @@ tty=${tty#/dev/tty} cfgdir=${XDG_CONFIG_HOME:-$HOME/.config}/sx datadir=${XDG_DATA_HOME:-$HOME/.local/share}/sx +mkdir -p -- "$cfgdir" "$datadir" -mkdir -p "$cfgdir" "$datadir" - -export XAUTHORITY=${XAUTHORITY:-$datadir/xauthority} -touch "$XAUTHORITY" +export XAUTHORITY="${XAUTHORITY:-$datadir/xauthority}" +touch -- "$XAUTHORITY" trap 'cleanup' EXIT xauth add :"$tty" MIT-MAGIC-COOKIE-1 "$(od -An -N16 -tx /dev/urandom | tr -d ' ')"