$ pgadmin3
$ pcmanfm
$ gksudo pcmanfm
Invoke the programs fine but:
$ gksudo --user postgres pgadmin3
Produces:
19:38:10: Error: Unable to initialize GTK+, is DISPLAY set properly?
Why?
$ pgadmin3
$ pcmanfm
$ gksudo pcmanfm
Invoke the programs fine but:
$ gksudo --user postgres pgadmin3
Produces:
19:38:10: Error: Unable to initialize GTK+, is DISPLAY set properly?
Why?
By default, another user does not have permission to use the X screen.
This works for me:
xhost SI:localuser:postgres
gksudo --user postgres pgadmin3
# or sudo -u postgres -H pgadmin3
Related answer: What does this `xhost ...` command do?