1

Confusing title, I know. Here's the problem:

To launch Urxvt in such a way that my extensions work, I'd open up Cygwin and use export DISPLAY=:0 and then urxvt. If I launch urxvt just with urxvt then various extensions like clipboard don't work since the original Cygwin window that I launched urxvt from receives the extension inputs (which is why export DISPLAY=:0 is important.

It was annoying to have to open Cygwin everytime I wanted to run a Urxvt window, so I modified my Cygwin.bat from this:

@echo off
C:
chdir C:\cygwin64\bin
bash --login -i

to this to launch Urxvt as my default terminal emulator:

@echo off
C:
chdir C:\cygwin64\bin
urxvt -e /bin/bash --login -i

And it worked fine for launching Urxvt without having to open any other windows, but the only issue is that my extensions don't work since I obviously didn't put set DISPLAY=:0 somewhere in the process before launching Urxvt.

So my question is, how can I create a shortcut that launches Urxvt but also prefaces the launch with set DISPLAY=0?

1 Answer 1

0

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 not 0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .