Skip to content

Instantly share code, notes, and snippets.

@prozacgod
Last active September 4, 2018 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prozacgod/6c7ba261e8ba7fa0dcc88e0f7e9be1ff to your computer and use it in GitHub Desktop.
Save prozacgod/6c7ba261e8ba7fa0dcc88e0f7e9be1ff to your computer and use it in GitHub Desktop.
Just a quicky that I use to get my xauthority file remotely, combined with other script or things like x11vnc, helps when I'm remote and need to login through gdm too
#!/bin/bash
OWNER=`id -u`
if [[ -n "$1" ]]; then
OWNER=$1
fi
ps ax | grep auth | grep $OWNER | python -c "import sys; print sys.stdin.read().split('-auth ')[1].split(' ')[0]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment