3

I have a Kali Linux boot that I'm using on a laptop with a broken screen connected to an external monitor via HDMI. At the moment when the laptop boots, it displays the primary screen on the broken monitor (I can just about make out what's happening on the laptop monitor but not enough to interact) and an empty Kali desktop on the external one.

I can get the Kali install to open the command line on the external monitor, but I'm not sure how to launch the display settings from there, or otherwise force Kali to display on the external monitor without having to use the GUI, which I can't see properly.

How do I get I open the display properties on the external monitor, or otherwise change the primary display to the external monitor, without having to interact with the GUI on the broken display?

I have tried Shift+Ctrl+Alt+Left and Shift+Ctrl+Alt+Right as found here but nothing happens.

I have also tried Super/WindowsKey+Page Up and Super/Windows Key+Page Down as found here. Again, nothing happens.

closed as too broad by Ipor Sircer, GAD3R, Wildcard, Satō Katsura, countermode Mar 15 '17 at 7:51

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • I don't understand how this is too broad to be answered. It has been answered and the answer looks good. I will test the answer given as soon as I have time. Sorry, but a lot of people demand my attention and I have to prioritize. – Angular4 Kiddie Mar 17 '17 at 20:11
  • Well, so have you tested my script? (just curious) – ddnomad Mar 20 '17 at 11:56
  • Apologies. I've not had chance to reply to this yet. Will test as soon as I get a free minute. I haven't forgotten! – Angular4 Kiddie Mar 26 '17 at 11:41
0

I managed to solve the problem by finding a function key combination on the laptop that switched the external display output, unrelated to Linux itself, but I would still be interested to find out if anyone knows a way of fixing the issue the way I was originally trying.

  • 1
    Take a look in the file $HOME/.config/monitors.xml. – user192526 Mar 14 '17 at 7:49
0

Well, I use the following script on my arch linux installation to automatically switch to an external monitor when it's connected. I could try this script (I believe that Kali also uses xrandr as an underlying display manager, so it should work).

The only thing that is needed to be tweaked is variables declaration. Just run xrandr from the console to see the names of your built-in and external display. And change INT and EXT variables accordingly.

Then you can add this script to run on the startup (after X was started) and that's all.

#!/usr/bin/env bash

# monitor constants
INT=eDP1
EXT=HDMI1

# keep polling xrandr 
while true; do
    # using internal monitor but external was connected
    if [ ! "${ACT}" == "${EXT}" ] && xrandr | grep "${EXT} connected"; then
        # setup xrandr to use external monitor only
        xrandr --output "${INT}" --off --output "${EXT}" --auto
        ACT="${EXT}"
    fi

    # using external monitor but it was disconnected
    if [ "${ACT}" == "${EXT}" ] && xrandr | grep "${EXT} disconnected"; then
        # setup xrandr to use internal monitor only
        xrandr --output "${EXT}" --off --output "${INT}" --auto
        ACT="${INT}"
    fi

    # sleep for a moment
    sleep 1
done
  • Looks promising. I'm current using another computer at the moment but as soon as I'm back on the computer with the broken display I'll give it a try and accept it as the answer if it works. – Angular4 Kiddie Mar 14 '17 at 20:27
  • 1
    Good luck! At least on my Arch installation it works like a charm :) – ddnomad Mar 14 '17 at 20:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.