Created
May 29, 2014 17:15
-
-
Save mniip/7242fd613ab5617966e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Ever wanted to spawn a process in X from a VT? | |
# This little tool spawns a shell whose environment is copied from a specified PID. | |
# Example: ./copyenv.sh $(pidof mate-session) | |
# That will launch a shell with $DISPLAY, $XAUTORITY, and others set to appropriate values and thus you'll be able to spawn your process | |
xargs -0 -a <(cat "/proc/$1/environ";echo -n $SHELL;echo -ne "\0-i") env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment