Commit e21f83fb authored by Julian Brost's avatar Julian Brost 🦄
Browse files

Import

parents
#!/bin/bash
SSH_HELPER="${0}-ssh"
argv=()
for arg; do
argv+=("$(printf "%s" "$arg" | sed 's/^sudo:\([^:]*\):\([^:]*\)$/ssh:\1@localhost+sudo:\2/')")
done
exec xpra --ssh="$SSH_HELPER" "${argv[@]}"
#!/bin/bash
set -eu
use_sudo=
target_user=
while [[ $1 == -* ]]; do
if [ "$1" = "-T" ] && [ "$2" = "localhost+sudo" ]; then
use_sudo=y
fi
if [ "$1" = "-l" ]; then
target_user="$2"
fi
shift 2
done
if [ "$use_sudo" = "y" ]; then
cd /
# Archlinux uses Xorg.wrap which somewhat breaks but using the actual Xorg
# binary works just fine...
exec env -i sudo --login -u "$target_user" -- \
/bin/sh -c 'PATH="/usr/lib/xorg-server:$PATH"'" $*"
fi
exit 1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment