Skip to content

Instantly share code, notes, and snippets.

@vansoest
Created March 13, 2016 19:54
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 vansoest/c437b5c256f49ad660fc to your computer and use it in GitHub Desktop.
Save vansoest/c437b5c256f49ad660fc to your computer and use it in GitHub Desktop.
#!/bin/bash
WINDOWMANAGER=i3
if [[ -z "$DBUS_SESSION_BUS_ADDRESS" ]]; then # Looks like we are outside X
eval $(tr '\0' '\n' < /proc/$(pgrep $WINDOWMANAGER | head -1 )/environ | sed -e 's/^/export /') #export all environment variables
fi
$@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment