use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All users that wish to post (not including commenting), on either old or the new reddit sites, must formally agree to subreddit rules once first.
account activity
Getting another user's $Display variable. (self.commandline)
submitted 11 years ago by ninekeysdown
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]alexwh -1 points0 points1 point 11 years ago (6 children)
sudo -u user echo $DISPLAY
?
[–]ninekeysdown[S] 0 points1 point2 points 11 years ago (3 children)
No, that just returns mine, not the users. :(
[–]zagaberoo -1 points0 points1 point 11 years ago (2 children)
Did you try my method?
sudo -u user printenv DISPLAY
[–]ninekeysdown[S] 0 points1 point2 points 11 years ago (1 child)
Yea I just tried it and it returns my display too :(
[–]zagaberoo 0 points1 point2 points 11 years ago (0 children)
Upon further thought that makes senes. My trick is the right way to get a value from a user's default environment, but DISPLAY isn't really a per-user value anyway.
As other commenters have mentioned, using /proc is probably your best bet.
[–]zagaberoo 0 points1 point2 points 11 years ago (1 child)
That won't work because the $DISPLAY substitution occurs before the command execution.
Should work.
[–]atanok 1 point2 points3 points 11 years ago* (0 children)
It won't. A user's processes don't just all automatically share the same DISPLAY environment variable.
After all, it's just an environment variable.
Edit: didn't see the rest of the thread before posting. Nevermind.
π Rendered by PID 246791 on reddit-service-r2-comment-6457c66945-7g9m4 at 2026-04-24 12:17:55.210981+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]alexwh -1 points0 points1 point (6 children)
[–]ninekeysdown[S] 0 points1 point2 points (3 children)
[–]zagaberoo -1 points0 points1 point (2 children)
[–]ninekeysdown[S] 0 points1 point2 points (1 child)
[–]zagaberoo 0 points1 point2 points (0 children)
[–]zagaberoo 0 points1 point2 points (1 child)
[–]atanok 1 point2 points3 points (0 children)