分类: LINUX
2010-07-26 15:11:55
import XMonad import XMonad.Config.Gnome import XMonad.Hooks.SetWMName myManageHook = composeAll [ (className =? "Firefox" <&&> resource=? "Download") --> doFloat , (className =? "Firefox" <&&> resource =? "DTA") --> doFloat ] main = do xmonad $ gnomeConfig { modMask = mod4Mask -- set the mod key to the windows key , XMonad.focusFollowsMouse = False --不设置鼠标跟随 , manageHook = myManageHook <+> manageHook gnomeConfig , startupHook = setWMName "LG3D" } |
[] 3.16 I need to find the class title or some other X property of my programIf you are using something like XMonad.Actions.WindowGo, or a hook, or some other feature like that where XMonad needs to know detailed information about a window, you can generally find what you need by splitting your screen between the window and a terminal; in the terminal, run xprop | grep CLASS or the like, and then click on the window. xprop will then print out quite a bit of useful information about the window.
For example, in (Applications may change the title after window creation, before xprop sees it. If possible, use resource or class in such cases.) stringProperty "WM_WINDOW_ROLE" can also be useful. Sample output might look like: _MOTIF_DRAG_RECEIVER_INFO(_MOTIF_DRAG_RECEIVER_INFO) = 0x6c, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 Note: the last several lines contain useful information like the CLASS and hinting information. [] 3.16.1 What about other properties, such as WM_WINDOW_ROLE?Use stringProperty "WM_WINDOW_ROLE" =? "presentationWidget" --> doFloat For non-string properties, try . Consult the documentation for more information. |
import XMonad import XMonad.Config.Gnome import XMonad.ManageHook import qualified XMonad.StackSet as W import XMonad.Hooks.SetWMName myWorkspaces = ["1:main","2:web","3:gvim","4:media","5:graph","6:browse","7:dev","8:office","9:other"] myManageHook = composeAll [ (className =? "Firefox" <&&> resource=? "Download") --> doFloat , (className =? "Firefox" <&&> resource =? "DTA") --> doFloat , (className =? "Vmplayer" <&&> title=? "new of Windows XP office - VMware Player") --> doF (W.shift "8:office") ] main = do xmonad $ gnomeConfig { modMask = mod4Mask -- set the mod key to the windows key , XMonad.focusFollowsMouse = False --不设置鼠标跟随 , workspaces = myWorkspaces , manageHook = myManageHook <+> manageHook gnomeConfig , startupHook = setWMName "LG3D" } |