Skip to content

Instantly share code, notes, and snippets.

@fumieval
Created September 17, 2011 14:00
Show Gist options
  • Select an option

  • Save fumieval/1223965 to your computer and use it in GitHub Desktop.

Select an option

Save fumieval/1223965 to your computer and use it in GitHub Desktop.
Xmonad Configuration
{-# LANGUAGE TypeSynonymInstances, DeriveDataTypeable, MultiParamTypeClasses #-}
import XMonad
import XMonad.Config.Kde
import XMonad.Config.Desktop (desktopLayoutModifiers)
import XMonad.Actions.WindowGo
import XMonad.Layout.MultiToggle
import XMonad.Layout.Spiral
import XMonad.Layout.Mosaic
import XMonad.Layout.Reflect
import XMonad.Util.EZConfig
import qualified XMonad.StackSet as W
-- `xprop | grep WM_CLASS` でクラス名を取得できる
myKeys = -- キーバインド
[ -- ウィンドウ操作
("M-z", sendMessage $ Wider)
,("M-x", sendMessage $ Taller)
,("M-r", sendMessage $ Reset)
,("M-c", sendMessage $ Toggle REFLECTH)
,("M-v", sendMessage $ Toggle REFLECTV)
,("M-f", sendMessage $ Toggle FULLM)
-- アプリケーション起動
,("M-C-a", runOrRaise "AptanaStudio3" (className =? "Aptana Studio 3"))
,("M-C-m", runOrRaise "kmail" (className =? "Kmail"))
,("M-C-o", runOrRaise "opera" (className =? "Opera"))
,("M-C-s", runOrRaise "ksnapshot" (className =? "Ksnapshot"))
,("M-C-c", spawn "google-chrome")
,("M-C-e", spawn "kate")
,("M-C-f", spawn "dolphin")
,("M-C-w", spawn "konsole --profile ~/.kde/share/apps/konsole/workspace.profile")
]
myLayoutHook = id
. mkToggle (single FULLM)
. mkToggle (single REFLECTV)
. mkToggle (single REFLECTH)
$ desktopLayoutModifiers
$ spiral (6/7) ||| mosaic 3 [2, 3]
myWorkspaces = ["火", "水", "風", "土"]
myFloats = ["Plasma-desktop", "Knotes"] -- 起動時にフロートする
myUnFloats = ["Kpackagekit"] -- 起動時にフロートを解除
myIgnores = ["desktop_window", "kdesktop"] -- 管理しない
data MyTransformers = FULLM | REFLECTH | REFLECTV
deriving (Read, Show, Eq, Typeable)
instance Transformer MyTransformers Window where
transform FULLM _ k = k $ desktopLayoutModifiers $ Full
transform REFLECTH x k = k $ desktopLayoutModifiers $ reflectHoriz x
transform REFLECTV x k = k $ desktopLayoutModifiers $ reflectVert x
main = xmonad $ kdeConfig
{
modMask = mod4Mask -- use the Windows button as mod
,workspaces = myWorkspaces
,manageHook = manageHook kdeConfig <+> myManageHook
,layoutHook = myLayoutHook
} `additionalKeysP` myKeys where
myManageHook = composeAll . concat $ [
[className =? c --> doFloat | c <- myFloats]
,[className =? c --> unFloat | c <- myUnFloats]
,[resource =? c --> doIgnore | c <- myIgnores]
] where unFloat = ask >>= doF . W.sink
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment