How can I create a shortcut that launches Urxvt with set DISPLAY=0?
Add the following to ~/.bashrc
:
export DISPLAY=:0
Note:
DISPLAY
should be set to:0
not0
Making Permanent Environment Variables:
Environment variables are variables that any command, program, or script can access. If a variable is set in a script, only that script can use it. If a user creates a variable in a terminal, the variable can only be used in that terminal until it closes. Then, the variable is gone forever. Users can make permanent environment variables by putting them in the file ~/.bashrc. This file contains functions and variables that the shell sets up when the user opens a terminal. Because the file is in the user's home folder, only that user can access the data that is created from that file. Users may put aliases in here instead of the alias file. The bashrc file loads the alias file into itself. Users typically put their aliases in the alias file, but this is not required.
To create a permanent environment variable, open ~/.bashrc in a preferred text editor. If a user wanted to make a variable that contained the uppercase Greek alphabet, they would set this variable assignment with the other variables being set in this file. To prevent an accidental code mess up in this file, put the new variable at the very end of the file.
Source Customize BASH