Advertising

Welcome to SparkyLinux forums
Zapraszamy również na polsko-języczne Forum Linuxiarze.pl

Author Topic: How change monitors from terminal ? "xrandr: Cant open display"  (Read 533 times)

Offline vic131

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
I'm booting sparklinux from a live-usb in a notebook with broken screen, so there is a external monitor conected by VGA. The external monitor is booted dual with the notebook monitor. And the external monitor resolution is booted with some issues. To fix it i need to put the external monitor as the primary monitor, or even better, shutdown the notebook monior. In Ubuntu i cant use the fn+special key to change monitors. In Lubuntu i can open the start menu, type 'monitor' and change it manually. In Sparkylinux the special key dosent work and start menu is tricky, so i cant acess the monitor menu whitout seeing. I'm trying xrandr to change it then, but aparently i cant open the terminal ( ctrl+alt+T), the bad resolution sends it to another realm. So i used alt+ctrl+f1 to try xrandr, but for most but not all xrandr comands i get "xrandr: Cant open display". Help.
« Last Edit: May 24, 2021, 11:03:16 pm by vic131 »

Offline kanliot

  • Jr. Member
  • **
  • Posts: 90
  • Karma: 0
Re: How change monitors from terminal ? "xrandr: Cant open display"
« Reply #1 on: June 09, 2021, 07:23:41 pm »
You should be able to use this command in a bash script.  I'm not currently using two monitors (lost my displayport cable) or else I'd fix it for you. https://superuser.com/a/155132

if you export an environmental variable called `DISPLAY` ...

(in the shell)  you should be able to change monitors in the *Console*  ( which is what you were doing with Ctrl+alt+f1)

/usr/bin/lxqt-config-globalkeyshortcuts aka "shortcut keys" will be able to run your script when you press special keys, or when you logon.

I hope this helps, I might check this thread  again next week.

so really you should be able to do this I think.  Maybe hop on IRC for more help?
« Last Edit: June 09, 2021, 07:25:37 pm by kanliot »