博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

剑心通明的资料库

文章均为转载,本人不负因参考它所导致的一切后果,请谨慎参考!如您的文章不愿被转载,请点击此处联系本人!
  jxtm.cublog.cn

关于作者
姓名:剑心通明
职业:高级工程师(专修灵魂^_^)
年龄:20出头30不到
位置:网络上一节点
个性介绍:努力学习每一天!
倾心打造:http://www.bsdlover.cn
http://bbs.bsdlover.cn
BSD爱好者的乐园!
|| << >> ||
我的分类


Stupid GUI Tricks: OpenBSD + Xinerama + x11/awesom
Contributed by merdely on Tue May 6 18:01:15 2008 (GMT)
from the xinerama-is-awesome dept.

Xinerama(3) [Wikipedia] has been part of the OpenBSD X distribution for some time. I was able to get a chance to play with it when I got my hands on a second video card and monitor.

As an x11/dwm user, I leaned towards x11/awesome as my Xinerama-aware window manager. More information about how I got Xinerama working and how I configured x11/awesome below.

Prior to adding the second video card and monitor to my system, I was previously able to run xenocara without an xorg.conf on my i386 machine. After installing the second card and attaching the monitor, I used 'X -configure' to generate a configuration file. After that, I only had to modify a couple pieces of my xorg.conf. My ServerLayout section looks like this. I had to add the "Xinerama" "On" Option:

Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen 0       "Screen0" 0 0
        Screen 1       "Screen1" RightOf "Screen0"
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
        Option         "Xinerama" "On"
EndSection

Not all window managers are Xinerama-aware/capable. The "awesome" window manager is a fork of the dwm window manager that supports Xinerama and run-time configuration. Since I use dwm on my laptop, I felt comfortable using awesome on my dual-head desktop. The only pertinent changes I made to my ~/.awesomerc (to make it more useful to me) are changing:

    key
    {
        modkey = {"Mod1"}
        key = "Tab"
        command = "focus_history"
        arg = "-1"
    }
to
    key
    {
        modkey = {"Mod1"}
        key = "Tab"
        command = "screen_focus"
        arg = "+1"
    }
    key
    {
        modkey = {"Mod1", "Shift"}
        key = "Tab"
        command = "screen_focus"
        arg = "-1"
    }
The above change allows <alt>+<tab> and <alt>+<shift>+<tab> to cycle between screens instead of windows. I also added:
    key
    {
        modkey = {"Mod1"}
        key = "p"
        command = "spawn"
        arg = "exec dmenu_run"
    }
    key
    {   
        modkey = {"Mod1", "Shift", "Control"}
        key = "j"
        command = "client_movetoscreen"
        arg = "+1"
    }
    key
    {   
        modkey = {"Mod1", "Shift", "Control"}
        key = "k"
        command = "client_movetoscreen"
        arg = "-1"
    }
This makes <alt>+<p> launch x11/dmenu, <alt>+<shift>+<ctrl>+<j> move a window to the screen to the right and <alt>+<shift>+<ctrl>+<k> move a window to the screen to the left.

With my two screen set up, I generally have my GUI applications on the left-hand screen (firefox, thunderbird) and a local xterm. On the right-hand screen, I have my "main" xterm running screen with mutt, irssi and different connections to the different hosts I manage. [screenshot]

Even though Xinerama has generally been deprecated by XRandR (and it's accompanying command: xrandr(1)), XRandR isn't supported by older X drivers (like the one I'm using). Also, XRandR is designed for use with multiple outputs on one card, not multiple cards as in this case. I don't have a dual-head card to test, so can't comment on it. If anyone with such hardware would like to comment, please do so below.

If you've got some "Stupid User Tricks" you'd like to share, please submit a story.

 原文地址 http://undeadly.org/cgi?action=article&sid=20080506180146
发表于: 2008-05-07,修改于: 2008-05-07 16:07,已浏览690次,有评论1条 推荐 投诉


网友评论
网友: BruceShea 时间:2008-05-12 12:11:48 IP地址:60.28.236.★
很好!学习了!

 发表评论