import XMonad import Data.Monoid import System.Exit import XMonad.Hooks.FadeInactive import XMonad.Hooks.ManageHelpers import XMonad.Hooks.Place import XMonad.Hooks.UrgencyHook import XMonad.Hooks.EwmhDesktops import XMonad.Actions.CycleWS --import XMonad.Layout.Spiral import XMonad.Layout.Spacing import XMonad.Layout.Tabbed import XMonad.Layout.NoBorders --import XMonad.Layout.PerWorkspace import qualified XMonad.StackSet as W import qualified Data.Map as M varFocusFollowsMouse :: Bool varClickJustFocuses :: Bool varMyLogHook :: X () -- SETTING VARIABLES -- ================================================================================= varFocusFollowsMouse = True varClickJustFocuses = False varBorderWidth = 0 varBorderColor = "#0099CC" varBorderFocusColor = "#7EC0EE" varXmonadKey = mod1Mask varAppKey = mod4Mask varWorkspaces = ["default","web","text","term","video", "audio"] varFadeAmount = 0.4 varOpenAsRoot = "gksu -u root" -- APPLICATION VARIABLES -- ================================================================================= varTerminalApp = "urxvt" varAppTerminalApp = "urxvt -fg green" varRootTerminalApp = varOpenAsRoot ++ " 'urxvt -fg redI '" varMusicApp = varAppTerminalApp ++ " mocp" varVideoApp = "vlc" varBrowserApp = "chromium" varPrivateBrowserApp = varBrowserApp ++ " --incognito" varMailApp = varBrowserApp ++ " --app=http://mail.google.com" varFileMngrApp = "pcmanfm" varRunApp = "gmrun" varSoundApp = varAppTerminalApp ++ " -class pop-up -g 120x30 -e 'alsamixer --card=0'" varTextApp = "sublime_text" varSreenshotApp = varAppTerminalApp ++ " -class pop-up -g 50x1 -e 'scrot -c -d 5 -e mv -v $f ~/Afbeeldingen/Screenshots'" varApp1Name = "Tumblr" varUserApp1 = varBrowserApp ++ " --app=http://tumblr.com --user-data-dir=/home/eddie/.config/google-chrome/tumblr" varApp2Name = "Tumblr 2" varUserApp2 = varBrowserApp ++ " --app=http://tumblr.com --user-data-dir=/home/eddie/.config/google-chrome/tumblr2" varApp3Name = "Tumblr 3" varUserApp3 = varBrowserApp ++ " --app=http://tumblr.com --user-data-dir=/home/eddie/.config/google-chrome/tumblr3" varApp4Name = "Facebook" varUserApp4 = varBrowserApp ++ " http://facebook.com/" varApp5Name = "Undefined" varUserApp5 = "" varApp6Name = "Undefined" varUserApp6 = "" varApp7Name = "Undefined" varUserApp7 = "" varApp8Name = "Undefined" varUserApp8 = "" varApp9Name = "KeePassX" varUserApp9 = "keepassx" varApp10Name = "Connect thuis" varUserApp10 = varAppTerminalApp ++ " '/opt/tools/bin/connect thuis'" varApp11Name = "GTK Theme" varUserApp11 = "lxappearance" varApp12Name = "Maik Cam" varUserApp12 = varVideoApp ++ " /home/eddie/BabyCam.m3u" -- HELP MENU -- ================================================================================= varHelp = unlines ["", " -- Start Applications [AppKey]", " ==================================================", " Terminal", " ===[ AppKey-Return ]===", " Run Program", " ===[ AppKey-R ]===", " Browser", " ===[ AppKey-B ]===", " Private Browser", " ===[ AppKey-Shift-T ]===", " eMail", " ===[ AppKey-E ]===", " Music player", " ===[ AppKey-M ]===", " Video Player", " ===[ AppKey-V ]===", " Text Editor", " ===[ AppKey-T ]===", " File Manager", " ===[ AppKey-F ]===", " Manage Sound", " ===[ AppKey-S ]===", " Screenshot", " ===[ PrtSc ]===", "", " -- User Definable keys [Function keys]", " Appkey-F1 ----- " ++ varApp1Name, " Appkey-F2 ----- " ++ varApp2Name, " Appkey-F3 ----- " ++ varApp3Name, " Appkey-F4 ----- " ++ varApp4Name, " Appkey-F5 ----- " ++ varApp5Name, " Appkey-F6 ----- " ++ varApp6Name, " Appkey-F7 ----- " ++ varApp7Name, " Appkey-F8 ----- " ++ varApp8Name, " Appkey-F9 ----- " ++ varApp9Name, " Appkey-F10 ----- " ++ varApp10Name, " Appkey-F11 ----- " ++ varApp11Name, " Appkey-F12 ----- " ++ varApp12Name, "", "", " -- Desktop Keys [ModKey]", " ==================================================", " Close", " ----- modKey-Shift-K", " Rotate Layout", " ----- modKey-Space", " Push back in to tiling", " ----- modKey-Shift-F", " Go To Next Window", " ----- modKey-Tab", " Go To Previous Window", " ----- modKey-Shift-Tab", " Rotate Layout", " ----- modKey-Space ]===", " Rotate Layout", " ----- modKey-Space ]===", " Rotate Layout", " ----- modKey-Space ]===", " Rotate Layout", " ----- modKey-Space ]===", "modKey-Shift-f Unfloat - Push in to tiling", "modKey-Shift-Tab Go To Next Window", "modKey-Return Swap with Master", "modKey-Up Shrink Master Area", "modKey-Down Expand Master Area", "modKey-Left Previous Workspace", "modKey-Right Next Workspace", "", "modKey-Shift-i Show this help menu", "modKey-q Reconfigure", "modKey-Shift-q Logout"] --"modKey-Shift-space Reverse Rotate Layout", --"modKey-f Float - Push out of tiling", -- XMONAD LAYOUT -- ================================================================================= varLayout = spacing 3 $ simpleTabbed ||| Mirror tiled ||| tiled ||| noBorders Full where tiled = Tall nmaster delta ratio nmaster = 1 ratio = 1/2 delta = 3/100 -- Hooks -- ================================================================================= varManageHook = placeHook simpleSmart <+> composeAll -- varManageHook = composeAll [ className =? "toWSAudio" --> doShift "audio" , className =? "toWSVideo" --> doShift "video" , className =? "toWSDefault" --> doShift "default" , className =? "toWSWeb" --> doShift "web" , className =? "toWStext" --> doShift "text" , className =? "toWSTerm" --> doShift "term" , stringProperty "WM_WINDOW_ROLE" =? "pop-up" --> doFloat , appName =? "mail.google.com" --> doFloat , appName =? "feh" --> doFullFloat , className =? "Vlc" --> doFloat , className =? "pop-up" --> doFloat , className =? "Xmessage" --> doFloat , className =? "Gxmessage" --> doFloat , className =? "Lxappearance" --> doFloat , isFullscreen --> doFullFloat , isDialog --> doFloat ] -- KEYS -- ================================================================================ varKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $ -- APPLICATION KEYS -- ----------------------------------------------------------------------------- -- launch Terminal [ ((varAppKey, xK_Return), spawn varTerminalApp) , ((varAppKey .|. shiftMask, xK_Return), spawn varRootTerminalApp) -- launch Video , ((varAppKey, xK_v ), spawn varVideoApp) -- launch Music , ((varAppKey, xK_m ), spawn varMusicApp) -- launch Sound Manager , ((varAppKey, xK_s ), spawn varSoundApp) -- launch Sound Manager , ((varAppKey, xK_f ), spawn varFileMngrApp) -- launch text Editor , ((varAppKey, xK_t ), spawn varTextApp) -- launch Browser , ((varAppKey, xK_b ), spawn varBrowserApp) , ((varAppKey .|. shiftMask, xK_b ), spawn varPrivateBrowserApp) -- launch Mail , ((varAppKey, xK_e ), spawn varMailApp) -- print Sreen , ((0, xK_Print ), spawn varSreenshotApp) -- User Apps - Function keys , ((varAppKey, xK_F1 ), spawn varUserApp1) , ((varAppKey, xK_F2 ), spawn varUserApp2) , ((varAppKey, xK_F3 ), spawn varUserApp3) , ((varAppKey, xK_F4 ), spawn varUserApp4) , ((varAppKey, xK_F5 ), spawn varUserApp5) , ((varAppKey, xK_F6 ), spawn varUserApp6) , ((varAppKey, xK_F7 ), spawn varUserApp7) , ((varAppKey, xK_F8 ), spawn varUserApp8) , ((varAppKey, xK_F9 ), spawn varUserApp9) , ((varAppKey, xK_F10 ), spawn varUserApp10) , ((varAppKey, xK_F11 ), spawn varUserApp11) , ((varAppKey, xK_F12 ), spawn varUserApp12) -- XF86AudioLowerVolume , ((controlMask, xK_Up ), spawn "amixer set Master playback 3-") -- XF86AudioRaiseVolume , ((controlMask, xK_Down ), spawn "amixer set Master playback 3+") -- XF86AudioMute , ((controlMask, xK_space ), spawn "amixer set Master playback 0") -- launch gmrun , ((varAppKey, xK_r ), spawn varRunApp) , ((varAppKey .|. shiftMask, xK_r ), spawn varOpenAsRoot) -- WINDOW MANAGEMENT KEYS -- ------------------------------------------------------------------------------ -- close focused window , ((varXmonadKey .|. shiftMask, xK_k ), kill) -- Rotate through the available layout algorithms , ((varXmonadKey, xK_space ), sendMessage NextLayout) --, ((varXmonadKey .|. shiftMask, xK_space ), sendMessage PrevLayout) -- Move focus to the next window , ((varXmonadKey, xK_Tab ), windows W.focusDown) -- Move focus to the previous window , ((varXmonadKey .|. shiftMask, xK_Tab ), windows W.focusUp ) -- Swap the focused window and the master window , ((varXmonadKey, xK_Return), windows W.swapMaster) -- Shrink the master area , ((varXmonadKey, xK_Up ), sendMessage Shrink) -- Expand the master area , ((varXmonadKey, xK_Down ), sendMessage Expand) -- Move to previous workspace , ((varXmonadKey, xK_Left ), prevWS) -- Move to next workspace , ((varXmonadKey, xK_Right ), nextWS) -- Push window back into tiling , ((varXmonadKey .|. shiftMask, xK_f ), withFocused $ windows . W.sink) -- , ((varXmonadKey, xK_f ), withFocused $ windows . doFloat) -- Quit xmonad , ((varXmonadKey .|. shiftMask, xK_q ), io (exitWith ExitSuccess)) -- Restart xmonad , ((varXmonadKey, xK_q ), spawn "xmonad --recompile; xmonad --restart") -- Run xmessage with a summary of the default keybindings (useful for beginners) , ((varXmonadKey .|. shiftMask, xK_i ), spawn ("echo \"" ++ varHelp ++ "\" | gxmessage -wrap -file -")) -- Media Keys , ((0, 0x1008ff12 ), spawn "vol mute") -- XF86AudioMute , ((0, 0x1008ff11 ), spawn "vol down") -- XF86AudioLowerVolume , ((0, 0x1008ff13 ), spawn "vol up") -- XF86AudioRaiseVolume ] varMyLogHook = fadeInactiveLogHook fadeAmount where fadeAmount = varFadeAmount main = xmonad $ withUrgencyHook dzenUrgencyHook { args = ["-bg", "darkgreen", "-xs", "1"] } $ defaultConfig { modMask = varXmonadKey , terminal = varTerminalApp , borderWidth = varBorderWidth , workspaces = varWorkspaces , normalBorderColor = varBorderColor , focusedBorderColor = varBorderFocusColor , keys = varKeys , layoutHook = varLayout , logHook = varMyLogHook , manageHook = varManageHook , handleEventHook = fullscreenEventHook }