Solved Brand new shiny monitor

I got a brand new 24" Lenovo monitor today and thought I'd hook it up to my ThinkPad T420 to see how YouTube looked...

but problems.... I'm running LXDE which comes up on the monitor as well as the laptop screen, but strange things happen... The mouse cursor only appears on the monitor, but the full screen does not fit on the monitor and the bottom section where the menu bar is, is cut off so I can't run any programs. The mouse cursor does not appear on the laptop screen.

What to do?

I'm connecting the monitor to the laptop using an HDMI cable with a Displayport - HDMI adapter at the laptop end if that makes any difference. Maybe I should try a VGA cable...
 
VGA is analog and very obsolete. I would not expect good results from that but you can try for sure.
Use the program x11/xrandr and set the native resolution for your monitor.
Here is my dualmonitor script:
Bash:
#!/bin/sh

MONITOR0=DisplayPort-0
MONITOR1=DisplayPort-1

#vertical
#xrandr --output ${MONITOR0} --auto --pos 0x0 --rotate right --output ${MONITOR1} --auto --pos 1440x860

#horizontal
xrandr --output ${MONITOR0} --auto --pos 0x0 --rotate normal --output ${MONITOR1} --auto --pos 2560x0 --primary

Call xrandr without parameters to list the available monitors and resolutions.

To install xrandr (thanks aragats):
pkg install xrandr
 
You've lost me with this script... where do I run it.

I got 'Command not found when trying to run it'. Not sure what was not found.
 
I got 'Command not found when trying to run it'. Not sure what was not found.
Look at the shebang line, it's looking for /bin/bash, which doesn't exist on FreeBSD. Change it to /bin/sh.
 
Look at the shebang line, it's looking for /bin/bash, which doesn't exist on FreeBSD. Change it to /bin/sh.

Should this work: ?
Code:
cat  <<EOF > monit
#!/bin/sh

MONITOR0=DisplayPort-0
MONITOR1=DisplayPort-1

#vertical
#xrandr --output ${MONITOR0} --auto --pos 0x0 --rotate right --output ${MONITOR1} --auto --pos 1440x860

#horizontal
xrandr --output ${MONITOR0} --auto --pos 0x0 --rotate normal --output ${MONITOR1} --auto --pos 2560x0 --primary
EOF
chmod +x monit
./monit

I get
Can't open display

Do I need to run this under X? I'm running it in text mode, since when I start LXDE my monitor cuts off the bottom section of the screen where the menu bar is, and my laptop screen does not have the mouse cursor on it so I can launch any programs... A kind of Catch 22 situation...

Is there an option to put the menu bar at the top of the screen in LXDE or how do I launch an app just using the keyboard.

It's a strange experience having a mouse and keyboard operating on different screens.
 
A suggestion. Rather than scripting xrandr, run it interactively from the command line. You can change the output (LVDS -> HDMI)
and then futz with the resolution. Once you determine the settings you like, you can incorporate them into either a script or xorg.conf.d settings. You have alot of options including spreading your display across two monitors. Arch linux has a wiki
Arch Linux wiki Multihead. There are additional example linked at the bottom the the wiki.
 
Run xrandr without parameters to list the available monitors and resolutions. Take a look at the instructions above.
Do I need to run this under X? I'm running it in text mode, since when I start LXDE my monitor cuts off the bottom section of the screen where the menu bar is, and my laptop screen does not have the mouse cursor on it so I can launch any programs... A kind of Catch 22 situation...

Is there an option to put the menu bar at the top of the screen in LXDE or how do I launch an app just using the keyboard.

It's a strange experience having a mouse and keyboard operating on different screens.

Oh, yeah. xrandr needs to run in the X server.
Try pressing Alt-F2 when you login. This opens a command box, and then start your preferred console - konsole, gnome-terminal or whatever you have installed. Something graphical.
 
It finally clicked that if I moved my mouse past the left hand end of my monitor it would appear on my laptop screen - a bit counter intuitive since my laptop is to the right of the monitor.

After running xrandr() I get the following:-

Code:
Screen 0: minimum 320 x 200, current 3286 x 1080, maximum 8192 x 8192
LVDS-1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 277mm x 156mm
   1366x768      60.00*+
   1024x768      60.04    60.00
   960x720       60.00
   928x696       60.05
   896x672       60.01
   800x600       60.00    60.32    56.25
   700x525       59.98
   640x512       60.02
   640x480       60.00    59.94
   512x384       60.00
   400x300       60.32    56.34
   320x240       60.05
VGA-1 disconnected (normal left inverted right x axis y axis)
HDMI-1 connected 1920x1080+1366+0 (normal left inverted right x axis y axis) 527mm x 296mm
   1920x1080     60.00*+  50.00
   1920x1080i    60.00    50.00
   1680x1050     59.88
   1280x1024     75.02    72.05    60.02
   1440x900      59.90
   1152x864      75.00
   1280x720      60.00    50.00
   1024x768      75.08    70.07    60.00
   800x600       72.19    75.00    60.32
   720x576       50.00
   720x480       59.94
   640x480       75.00    72.81    66.67    60.00    59.94
   720x400       70.08
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-2 disconnected (normal left inverted right x axis y axis)
HDMI-3 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)

No idea what to make of any of this.

Any advice would be appreciated.

I 'm not really interested in having the monitor and laptop as separate screens. How do I make adjustments?
 
You have two monitors that are detected: LVDS-1 (probably your laptop's panel) and HDMI-1 (probably your external monitor connected via HDMI).
The resolutions are 1366x768 and 1920x1080. Check your monitor specs and see if this is the native resolution. If not, you need to change it to the native one.
Your laptop is on the left hand side and the monitor is on the right hand side (I see this from the x-offset 1366: 1920x1080+1366+0

Modify the script as follows:

Bash:
#!/bin/sh

MONITOR0=LVDS-1
MONITOR1=HDMI-1

#horizontal
xrandr --output ${MONITOR0} --auto --pos 0x0 --rotate normal --primary --output ${MONITOR1} --auto --pos 1366x0

This will put your laptop as primary monitor at coordinates 0x0 at the default resolution and the monitor at coordinates 1366x0 (to the right of the laptop) at the default resolution.
If you need to change the resolution, then instead of --auto use "--mode 1920x1080". You can change the numbers to fit your monitor's native resolution. If you give us the model, we could look that up if you don't know how.

For more info you can see xrandr(1)
 
how do I preserve this setting between reboots?
There are a couple of ways.
1) Some Desktop environments have monitor config option. It will usually save on logout/reboot.
2) You can put your xrandr line into a display manager - if you use xdm append it to Xsetup_0
3) You can also put it your ~/.xinitrc
4) You can put it into your xorg.conf.d. The Arch linux wiki I provided in my first post tells how.
5) Some people write scripts that sense the hdmi monitor and will only disable lvds if the external monitor is connected.
 
Last edited:
how do I preserve this setting between reboots?
I think there is a common place that is read by the display manager and it can be configured also per user. I use KDE.
For me the most practical way so far has been:
- use xrandr and configure the displays how I like them
- open the "Monitors" settings page in KDE and change something small, just to make KDE save it's metadata
- copy the settings file from my user to the common place.

KDE uses the file ~/.config/monitors.xml to store the per user setting but I don't know if your display manager has a different file.
The monitors.xml can be copied to the display manager's ~/.config in order to configure what happens on the login screen.

This tutorial might help you: https://wiki.ubuntu.com/X/Config/Resolution
It's for Ubuntu, so read mindfully and adapt paths if necessary.
 
Back
Top