gpt4 book ai didi

ubuntu - 将 DE 与 XMonad 配对

转载 作者:太空宇宙 更新时间:2023-11-03 16:58:25 24 4
gpt4 key购买 nike

由于 MATE 只是 GNOME2 的一个分支,显然可以使用以下命令将窗口管理器替换为另一个(即 xmonad):mateconftool-2 -s/desktop/mate/session/required_components/windowmanager xmonad --类型字符串。这在我登录 MATE 时启动 XMonad 的意义上是有效的,但是,看起来 xmonad 正在尝试平铺面板或其他东西。其中一个面板实际上填满了它不该填满的所有空间(顶部和底部留空),系统完全无法使用(该重启了)。

我的 xmonad.hs:

{-# LANGUAGE OverloadedStrings #-}

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.SetWMName
import Control.Monad
import qualified XMonad.StackSet as W
import XMonad.Util.EZConfig
import qualified XMonad.Actions.FlexibleResize as Flex
import XMonad.Hooks.EwmhDesktops

import XMonad.Config.Desktop
import XMonad.Hooks.ManageDocks
import XMonad.Layout.NoBorders
import XMonad.Layout.LayoutHints

import XMonad.Util.Run (safeSpawn)

import System.Environment (getEnvironment)

main = xmonad mateConfig

mateConfig = desktopConfig
{ logHook = spawn "wmname LG3D"
, manageHook = myManageHook <+> manageHook mateConfig
, workspaces = ["1", "2", "3", "4", "5", "="]
, modMask = mod4Mask
, terminal = "gnome-terminal"
, startupHook = takeTopFocus >> setWMName "LG3D"
, handleEventHook = fullscreenEventHook
--, layoutHook = layoutHints $ avoidStruts (noBorders Full) ||| Mirror (Tall (1 (3/100) (1/2)))
, layoutHook = avoidStruts ((noBorders Full) ||| Mirror (Tall 1 (3/100) (1/2)))
}

`additionalKeys` [ ((mod4Mask, xK_d), spawn "dmenu_run -fn \"Ubuntu_Mono-13:Normal\" -nb black -nf skyblue -sb skyblue -sf black")
,((mod4Mask, xK_v), spawn "gvim")
,((mod4Mask, xK_x), spawn "gvim ~/.xmonad/xmonad.hs")
,((mod4Mask, xK_p), spawn "gnome-terminal")
-- ,((0 , xF86XK_AudioPlay), spawn "echo \"PLAY\" > ~/Desktop/hi")
]

`additionalMouseBindings` [ ((mod4Mask, button3), (\w -> focus w >> Flex.mouseResizeWindow w))
]


myManageHook = composeAll
[ className =? "Amarok" --> doShift "="
, manageDocks
]


{--- DBus Stuff-}
-- | Register xmonad with mate. 'dbus-send' must be in the $PATH with which
-- xmonad is started.
--
-- This action reduces a delay on startup only only if you have configured
-- mate-session>=2.26: to start xmonad with a command as such:
--
-- > mateconftool-2 -s /desktop/mate/session/required_components/windowmanager xmonad --type string
mateRegister :: MonadIO m => m ()
mateRegister = io $ do
x <- lookup "DESKTOP_AUTOSTART_ID" `fmap` getEnvironment
whenJust x $ \sessionId -> safeSpawn "dbus-send"
["--session"
,"--print-reply=string"
,"--dest=org.mate.SessionManager"
,"/org/mate/SessionManager"
,"org.mate.SessionManager.RegisterClient"
,"string:xmonad"
,"string:"++sessionId]




atom_WM_TAKE_FOCUS ::
X Atom
atom_WM_TAKE_FOCUS =
getAtom "WM_TAKE_FOCUS"

takeFocusX ::
Window
-> X ()
takeFocusX w =
withWindowSet . const $ do
dpy <- asks display
wmtakef <- atom_WM_TAKE_FOCUS
wmprot <- atom_WM_PROTOCOLS
protocols <- io $ getWMProtocols dpy w
when (wmtakef `elem` protocols) $
io . allocaXEvent $ \ev -> do
setEventType ev clientMessage
setClientMessageEvent ev w wmprot 32 wmtakef currentTime
sendEvent dpy w False noEventMask ev

takeTopFocus ::
X ()
takeTopFocus =
withWindowSet $ maybe (setFocusX =<< asks theRoot) takeFocusX . W.peek

我唯一的假设是 xmonad 没有正确地忽略面板。

我正在使用从 12.04 升级而来的 Ubuntu x64 12.10

编辑:我尝试添加 className =? "mate-panel"--> doIgnore 到 manageHooks in xmonad.hs。没有区别。

最佳答案

我正在使用 XMonad 运行 MATE。检查配置。在这个repo

关于ubuntu - 将 DE 与 XMonad 配对,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13104391/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com