mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 03:20:21 -07:00
Move example configuration file into xmonad-contrib for better visibility
This commit is contained in:
parent
7136394282
commit
65ac029636
78
XMonad/Config/Example.hs
Normal file
78
XMonad/Config/Example.hs
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- | Example.hs
|
||||||
|
--
|
||||||
|
-- Example configuration file for xmonad using the latest recommended
|
||||||
|
-- features (e.g., 'desktopConfig').
|
||||||
|
module Main (main) where
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
import System.Exit
|
||||||
|
import XMonad
|
||||||
|
import XMonad.Config.Desktop
|
||||||
|
import XMonad.Hooks.DynamicLog
|
||||||
|
import XMonad.Hooks.ManageHelpers
|
||||||
|
import XMonad.Layout.BinarySpacePartition (emptyBSP)
|
||||||
|
import XMonad.Layout.NoBorders (noBorders)
|
||||||
|
import XMonad.Layout.ResizableTile (ResizableTall(..))
|
||||||
|
import XMonad.Layout.ToggleLayouts (ToggleLayout(..), toggleLayouts)
|
||||||
|
import XMonad.Prompt
|
||||||
|
import XMonad.Prompt.ConfirmPrompt
|
||||||
|
import XMonad.Prompt.Shell
|
||||||
|
import XMonad.Util.EZConfig
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
main = do
|
||||||
|
spawn "xmobar" -- Start a task bar such as xmobar.
|
||||||
|
|
||||||
|
-- Start xmonad using the main desktop configuration with a few
|
||||||
|
-- simple overrides:
|
||||||
|
xmonad $ desktopConfig
|
||||||
|
{ modMask = mod4Mask -- Use the "Win" key for the mod key
|
||||||
|
, manageHook = myManageHook <+> manageHook desktopConfig
|
||||||
|
, layoutHook = desktopLayoutModifiers $ myLayouts
|
||||||
|
, logHook = dynamicLogString def >>= xmonadPropLog
|
||||||
|
}
|
||||||
|
|
||||||
|
`additionalKeysP` -- Add some extra key bindings:
|
||||||
|
[ ("M-S-q", confirmPrompt myXPConfig "exit" (io exitSuccess))
|
||||||
|
, ("M-p", shellPrompt myXPConfig)
|
||||||
|
, ("M-<Esc>", sendMessage (Toggle "Full"))
|
||||||
|
]
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- | Customize layouts.
|
||||||
|
--
|
||||||
|
-- This layout configuration uses two primary layouts, 'ResizableTall'
|
||||||
|
-- and 'BinarySpacePartition'. You can also use the 'M-<Esc>' key
|
||||||
|
-- binding defined above to toggle between the current layout and a
|
||||||
|
-- full screen layout.
|
||||||
|
myLayouts = toggleLayouts (noBorders Full) others
|
||||||
|
where
|
||||||
|
others = ResizableTall 1 (1.5/100) (3/5) [] ||| emptyBSP
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- | Customize the way 'XMonad.Prompt' looks and behaves. It's a
|
||||||
|
-- great replacement for dzen.
|
||||||
|
myXPConfig = def
|
||||||
|
{ position = Top
|
||||||
|
, alwaysHighlight = True
|
||||||
|
, promptBorderWidth = 0
|
||||||
|
, font = "xft:monospace:size=9"
|
||||||
|
}
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- | Manipulate windows as they are created. The list given to
|
||||||
|
-- @composeOne@ is processed from top to bottom. The first matching
|
||||||
|
-- rule wins.
|
||||||
|
--
|
||||||
|
-- Use the `xprop' tool to get the info you need for these matches.
|
||||||
|
-- For className, use the second value that xprop gives you.
|
||||||
|
myManageHook = composeOne
|
||||||
|
[ className =? "Pidgin" -?> doFloat
|
||||||
|
, className =? "XCalc" -?> doFloat
|
||||||
|
, className =? "mpv" -?> doFloat
|
||||||
|
, isDialog -?> doCenterFloat
|
||||||
|
|
||||||
|
-- Move transient windows to their parent:
|
||||||
|
, transience
|
||||||
|
]
|
@ -31,6 +31,7 @@ extra-source-files: README.md CHANGES.md scripts/generate-configs scripts/run-xm
|
|||||||
tests/SwapWorkspaces.hs
|
tests/SwapWorkspaces.hs
|
||||||
tests/XPrompt.hs
|
tests/XPrompt.hs
|
||||||
XMonad/Config/dmwit.xmobarrc
|
XMonad/Config/dmwit.xmobarrc
|
||||||
|
XMonad/Config/Example.hs
|
||||||
cabal-version: >= 1.6
|
cabal-version: >= 1.6
|
||||||
build-type: Simple
|
build-type: Simple
|
||||||
bug-reports: https://github.com/xmonad/xmonad-contrib/issues
|
bug-reports: https://github.com/xmonad/xmonad-contrib/issues
|
||||||
|
Loading…
x
Reference in New Issue
Block a user