How can I force applications to open in a specified display in Arch Linux?
Hello LinuxQuestions!
I have two displays connected to my desktop PC, my computer monitor and my TV. There are a few programs I'd like to open on my TV rather than my desktop monitor. How can I do so? I'm thinking of something on the lines of something I'd put before the command to run the program, so I use it in some config files for programs that start other programs. I'm using GNOME on Arch Linux. |
I think that is the variable DISPLAY or option --display good for.
|
Alright! So for example, would I type something like this?
Code:
[user@localhost ~]$ command DISPLAY=:1 Code:
DISPLAY=:0 |
On my system (XFCE on NVIDIA with separate X sessions) the displays are :0.0 and :0.1 and I can, for example, run Firefox on the first by running:
Code:
DISPLAY=:0.0 firefox |
Thanks! Gave that a try and got
Code:
Invalid MIT-MAGIC-COOKIE-1 key Did you set it up to run separate X sessions, or is this the default for most desktop environments? |
I have seen something similar but, sorry, can't recall whether it was with VNC or plain X11 or how I fixed it (I mess around a lot).
|
Yeah, this error goes for anything except
Code:
DISPLAY=:1 (Previously I said DISPLAY:1 didn't work, my bad) |
Quote:
Which graphics card are you using and how are you achieving dual monitor? I have a sneaking suspicion that you won't be able to do what you want via DISPLAY though an easy check come to mind and that is to open a terminal in the display you want to open the application on and type: Code:
echo $DISPLAY |
Quote:
Quote:
By entering Code:
echo $DISPLAY Code:
:1 |
Then you can't do what you want using DISPLAY. I use the proprietary NVIDIA drivers and have "separate X sessions" which means I can't move windows between the two monitors but can refer to the displays separately. All dual display settings come with their own advantages, issues and cludges though so you might just need to research things and/or play around.
|
Quote:
How do you access the NVIDIA settings? I did a Code:
pacman -Qs nvidia |
I know in Retroarch there's a "monitor index" option in the video settings. Setting it to "2" makes it run only on my second monitor.
|
I'm afraid I don't know how the NVIDIA drivers are installed in Arch or whether you have the proprietary drivers or the open source ones. If you have the proprietary drivers then you ought to have nvidia-settings installed -- if it needs to modify xorg.conf it has to be run with root privileges but can otherwise be run as the logged in user.
|
Awesome. My other monitor no longer displays the same wallpaper and shows an "x" as my cursor. That tells me it worked.
Unfortunately, nothing works except for DISPLAY=:1 (still). I don't know how to open a terminal on my new display, and I can't drag anything over to my second display. For example, entering Code:
DISPLAY=1:0 gedit Code:
** (gedit:1973): WARNING **: Could not open X display I really want to do a Code:
echo $DISPLAY |
Remember I was using :0.0 and :0.1 myself so to you that would likely be :1.0 and :1.1. It may also be worth finding a window manager or DE which can use both monitors to use for testing purposes if nothing else. nvidia-settings may also give you a clue as to which display is named what.
|
All times are GMT -5. The time now is 07:37 PM. |