我有一台全新的华硕 N76,新安装了 12.10。Ubuntu 无法识别 HDMI 端口,但在 Windows 8 上运行良好。xrandr 甚至没有显示为已知连接器:
输出 xrandr
:
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
LVDS1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 382mm x 215mm
1920x1080 60.0*+ 59.9 40.0
[...]
VGA1 disconnected (normal left inverted right x axis y axis)
欢迎任何帮助。
答案1
Asus N76 通过 nVidia 显卡连接了 HDMI。请参阅 bumblebee 多显示器设置:https://github.com/Bumblebee-Project/Bumblebee/wiki/Multi-monitor-setup
配置 bumblebee(更改 bumblebee nvidia xorg.conf conf 文件并重新启动)后,您可以使用以下命令在 HDMI 屏幕上运行应用程序:
export DISPLAY=:8 LD_LIBRARY_PATH=/usr/lib/nvidia-current:$LD_LIBRARY_PATH
optirun some-command
我正在使用此命令来运行另一个 gnome 会话:
optirun gnome-session --session=gnome-classic
您还可以使用 xinput 命令管理输入。在 HDMI 屏幕激活后连接外部键盘并使用命令
export DISPLAY=:0 // for internal display
export export DISPLAY=:8 LD_LIBRARY_PATH=/usr/lib/nvidia-current:$LD_LIBRARY_PATH // for HDMI
xinput // find your device and it id, you can use xinput | grep "part of name"
xinput list-props <device id> | grep "Device Enabled" // find enabled property state and (property id).
xinput set-prop <device id> <property id> <value> // to set value
这是我的脚本,它在 HDMI 屏幕上启用联想设备(如果存在):
#!/bin/bash
# switch to main display to make sure, that Xserver is running and xinput will provide list of devices.
export DISPLAY=:0
unset LD_LIBRARY_PATH
# find list of devices to work with. See `xintput` command output
DEVICES="`xinput | grep "Lenovo Multimedia Remote with Keyboard N5902" | sed -e 's/.*id=\([0-9]*\).*/\1/'`"
echo $DEVICES
# switch to nVidia Xserver at DISPLAY 8
export DISPLAY=:8 LD_LIBRARY_PATH=/usr/lib/nvidia-current:$LD_LIBRARY_PATH
# Test xinput command. If it fail, enable DEVICES at main Xserver.
# Otherwise enable DEVICES at Xserver running on DISPLAY 8
xinput>/dev/null&>/dev/null
if [ $? != 0 ]; then
{
echo "HDMI Xserver is not running."
MAIN_STATUS=1
} else {
echo "HDMI Xserver is running."
MAIN_STATUS=0
for DEV in $DEVICES
do
PROP=`xinput list-props $DEV | grep "Device Enabled" | sed -e 's/.*(\([0-9]*\).*/\1/'`
echo "$DEV - $PROP"
xinput set-prop $DEV $PROP 1
xinput list-props $DEV | grep "Device Enabled"
done
} fi
# switch back to DISPLAY 0 and update DEVICES status according to MAIN_STATUS.
export DISPLAY=:0
unset LD_LIBRARY_PATH
for DEV in $DEVICES
do
PROP=`xinput list-props $DEV | grep "Device Enabled" | sed -e 's/.*(\([0-9]*\).*/\1/'`
xinput set-prop $DEV $PROP $MAIN_STATUS
xinput list-props $DEV | grep "Device Enabled"
done
这是另一种方法,使用协同服务器/客户端进行键/鼠标切换。但对于游戏来说,它太慢了。
http://www.webupd8.org/2012/08/get-hdmi-working-with-nvidia-optimus-on.html
祝你好运。