Switching between HDMI and internal display on A311D

As it is known, noone has yet figured out how to make A311D output to the internal display and HDMI on MNT Reform / MNT Pocket Reform at the same time, and switching from one to the other is not automatic. We might integrate buttons for this in a future wayland desktop panel, but in the meantime here are two commands I use (you could also bind these to keyboard shortcuts in .config/sway/config).

To use these, you need to sudo apt install wlr-randr once.

MNT Pocket Reform with A311D

Switching to HDMI (and a resolution of choice)

wlr-randr --output DSI-1 --off --output HDMI-A-1 --on --custom-mode "1920x1080@60Hz"

Switching back to Internal Display

wlr-randr --output DSI-1 --on --output HDMI-A-1 --off

MNT Reform with A311D

Switching to HDMI (and a resolution of choice)

wlr-randr --output eDP-1 --off --output HDMI-A-1 --on --custom-mode "1920x1080@60Hz"

Switching back to Internal Display

wlr-randr --output eDP-1 --on --output HDMI-A-1 --off
2 Likes

Interesting… on MNT Reform Classic with A311D I used to have:

Switching to HDMI (and a resolution of choice)

swaymsg output eDP-1 disable; swaymsg output HDMI-A-1 enable
swaymsg output HDMI-A-1 modeline 148.50 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync

Switching back to Internal Display

swaymsg output eDP-1 enable
swaymsg output HDMI-A-1 disable
swaymsg output eDP-1 enable
swaymsg output HDMI-A-1 disable

Especially when switching back, enabling and disabling the display twice used to be necessary. This restriction is gone with wlr-randr? That’s nice! :smiley:

1 Like

I’ve just tried Kanshi on my A311D Reform and it seems to work wonderfully! I added this to my Kanshi config:

profile "Reform - Home" {
        output "Philips Consumer Electronics Company PHL 246V5 AU01438007831" enable mode 1920x1080 position 0,0
        output eDP-1 disable
}

profile "Reform Undocked" {
        output eDP-1 enable
}

…and my Reform now outputs to my HDMI monitor if it’s plugged in and switches back to the internal display automatically when I unplug it.

3 Likes

Uuuh kanshi is for wayland what autorandr is for xorg. I used to be a autorandr user. This is perfect! If only one display can be used at a time, why would one not automatically switch to hdmi right as it is plugged in? Thank you!

1 Like

No problem! :slight_smile:

I used to use autorandr too, and the one thing I miss about it when using Kanshi is that you have to manage the config file manually; there’s no equivalent of autorandr --save. But the upside to that is that I have my Kanshi config in my dotfiles so it applies to all my machines as well.

For now I only have it configured to switch if I plug into specific monitors, but if you find a way to have it switch to any connected HDMI device when plugged in I’d be interested in seeing what that config looks like.

Unfortunately, I don’t seem to be having much success with kanshi. It works “sometimes” but after a few unplugs and replugs I start getting messages like:

failed to apply configuration for profile 'Reform Undocked'

So my internal screen stays black. Re-plugging HDMI brings at least that one back but at some point, turning on HDMI will fail as well with:

no profile matched

And then I have literally no output anymore. :frowning: