Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Make 'xhost +' work in iTerm' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Make 'xhost +' work in iTerm
Authored by: EddEdmondson on Jun 27, '05 10:51:11AM
There's no guarantee the DISPLAY variable will be 0. Those who fast-user-switch in particular risk it being something else. Here's a script snippet that finds out what it should be and sets it appropriately:
X11_FOLDER=/tmp/.X11-unix
currentUser=`(set \`whoami\`; echo $1)`
bb=`ls -l $X11_FOLDER | grep $currentUser`
bbb=${bb/*X/:}
usedDISPLAY=$bbb.0
export DISPLAY=$usedDISPLAY
Credit for this goes to Dietrich Onnasch.

[ Reply to This | # ]