JTK – Notes and Ramblings Things we have found …

8/14/2016

mythbuntu 16.04 on the NUC

Filed under: General,MythTV,Router/PC Config — taing @ 1:33 am

The Gigabyte NUC GB-BXBT-1900 and Mythbuntu 16.04 have a few minor issues.

The first and biggest problem is the HDMI port shuts down after the monitor powers down. When the monitor is turned back on there is no display. Yikes.

The first part of the solution is a short shell script ~/screenfix.sh :

#!/bin/sh

export DISPLAY=:0
export XAUTHORITY=/home/taine/.Xauthority
sleep 8
/usr/bin/xrandr --verbose --display :0 --output HDMI1 --mode 1920x1080

Be sure to make the script executable with chmod u+x screenfix.sh

The second step is to make this a keyboard shortcut in the Keyboard Settings Shortcut tab. I chose Windows-S for my shortcut. The short cut command is:

xrandr --verbose --display :0 --output HDMI1 --mode 1920x1080

The final step is to automate this based a UDEV rule triggered when the display connects. Create /etc/udev/rules.d/95-monitor-hotplug.rules :

ACTION=="change", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/youruser/.Xauthority", RUN+="/home/taine/screenfix.sh"

The sleep line in the shell script was required to give the display time to actually be seen as “connected”.

The connected status of the display can be found with cat /sys/class/drm/card0-HDMI-A-1/status

The triggering UDEV event can be seen with udevadm monitor

Use xrandr -d :0 to display current display info.

Another minor annoyance was the failure of the CTRL-Escape keyboard shortcut to bring up the application menu. The shortcut appears to be set for xfce4-popup-menu. This has been around for quite a while. Change CTRL-Escape to run xfce4-popup-applicationsmenu in the Keyboard Settings Shortcut tab.

Powered by WordPress