|
|
|
|
@@ -1,335 +1,221 @@
|
|
|
|
|
--
|
|
|
|
|
-- xmonad example config file.
|
|
|
|
|
--
|
|
|
|
|
-- A template showing all available configuration hooks,
|
|
|
|
|
-- and how to override the defaults in your own xmonad.hs conf file.
|
|
|
|
|
--
|
|
|
|
|
-- Normally, you'd only override those defaults you care about.
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
import XMonad
|
|
|
|
|
import XMonad.Hooks.DynamicLog
|
|
|
|
|
import Data.Monoid
|
|
|
|
|
import System.Exit
|
|
|
|
|
|
|
|
|
|
-- XMonad Contrib
|
|
|
|
|
import XMonad.Actions.Submap
|
|
|
|
|
import XMonad.Actions.Minimize
|
|
|
|
|
import XMonad.Actions.CopyWindow
|
|
|
|
|
import XMonad.Actions.CycleWS
|
|
|
|
|
import XMonad.Hooks.DynamicLog
|
|
|
|
|
import XMonad.Hooks.ManageDocks
|
|
|
|
|
import XMonad.Hooks.ManageHelpers
|
|
|
|
|
import XMonad.Layout.Gaps
|
|
|
|
|
import XMonad.Layout.Minimize
|
|
|
|
|
import XMonad.Layout.NoBorders
|
|
|
|
|
import XMonad.Layout.Tabbed
|
|
|
|
|
import XMonad.Util.Run
|
|
|
|
|
import XMonad.Util.Run(spawnPipe)
|
|
|
|
|
import XMonad.Util.SpawnOnce
|
|
|
|
|
|
|
|
|
|
import qualified XMonad.StackSet as W
|
|
|
|
|
import qualified Data.Map as M
|
|
|
|
|
import qualified Data.Map as M
|
|
|
|
|
|
|
|
|
|
-- The preferred terminal program, which is used in a binding below and by
|
|
|
|
|
-- certain contrib modules.
|
|
|
|
|
--
|
|
|
|
|
myTerminal = "alacritty"
|
|
|
|
|
-- Main Terminal Program
|
|
|
|
|
term :: String
|
|
|
|
|
term = "alacritty"
|
|
|
|
|
|
|
|
|
|
-- Whether focus follows the mouse pointer.
|
|
|
|
|
myFocusFollowsMouse :: Bool
|
|
|
|
|
myFocusFollowsMouse = True
|
|
|
|
|
-- Launcher Program
|
|
|
|
|
menu :: String
|
|
|
|
|
menu = "rofi -show drun"
|
|
|
|
|
|
|
|
|
|
-- Whether clicking on a window to focus also passes the click to the window
|
|
|
|
|
myClickJustFocuses :: Bool
|
|
|
|
|
myClickJustFocuses = False
|
|
|
|
|
-- Focus Follows Mouse
|
|
|
|
|
ffm :: Bool
|
|
|
|
|
ffm = True
|
|
|
|
|
|
|
|
|
|
-- Width of the window border in pixels.
|
|
|
|
|
--
|
|
|
|
|
myBorderWidth = 1
|
|
|
|
|
-- Click Focus
|
|
|
|
|
cf :: Bool
|
|
|
|
|
cf = False
|
|
|
|
|
|
|
|
|
|
-- modMask lets you specify which modkey you want to use. The default
|
|
|
|
|
-- is mod1Mask ("left alt"). You may also consider using mod3Mask
|
|
|
|
|
-- ("right alt"), which does not conflict with emacs keybindings. The
|
|
|
|
|
-- "windows key" is usually mod4Mask.
|
|
|
|
|
--
|
|
|
|
|
myModMask = mod4Mask
|
|
|
|
|
-- Border Width
|
|
|
|
|
bw :: Dimension
|
|
|
|
|
bw = 1
|
|
|
|
|
|
|
|
|
|
-- The default number of workspaces (virtual screens) and their names.
|
|
|
|
|
-- By default we use numeric strings, but any string may be used as a
|
|
|
|
|
-- workspace name. The number of workspaces is determined by the length
|
|
|
|
|
-- of this list.
|
|
|
|
|
--
|
|
|
|
|
-- A tagging example:
|
|
|
|
|
--
|
|
|
|
|
-- > workspaces = ["web", "irc", "code" ] ++ map show [4..9]
|
|
|
|
|
--
|
|
|
|
|
myWorkspaces = ["term", "web", "code", "debug", "docs"] ++ map show [6..9]
|
|
|
|
|
-- Modifier Key (1: left alt, 2: right alt, 4: win key)
|
|
|
|
|
modKey :: KeyMask
|
|
|
|
|
modKey = mod4Mask
|
|
|
|
|
|
|
|
|
|
-- Border colors for unfocused and focused windows, respectively.
|
|
|
|
|
--
|
|
|
|
|
myNormalBorderColor = "#dddddd"
|
|
|
|
|
myFocusedBorderColor = "#ff0000"
|
|
|
|
|
-- workspace
|
|
|
|
|
ws :: [String]
|
|
|
|
|
ws = ["term", "web", "school", "docs", "code", "debug", "media", "games", "other"]
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
|
-- Key bindings. Add, modify or remove key bindings here.
|
|
|
|
|
--
|
|
|
|
|
myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
|
|
|
|
|
-- Border Color Normal
|
|
|
|
|
bcn :: String
|
|
|
|
|
bcn = "#dddddd"
|
|
|
|
|
|
|
|
|
|
-- launch a terminal
|
|
|
|
|
[ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
|
|
|
|
|
-- Border Color Focused
|
|
|
|
|
bcf :: String
|
|
|
|
|
bcf = "#ff0000"
|
|
|
|
|
|
|
|
|
|
-- launch dmenu
|
|
|
|
|
, ((modm, xK_p ), spawn "rofi -show drun")
|
|
|
|
|
-- Key Bindings
|
|
|
|
|
keyBinds conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
|
|
|
|
|
[
|
|
|
|
|
-- Program Launch KB
|
|
|
|
|
((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf),
|
|
|
|
|
((modm, xK_r), spawn menu),
|
|
|
|
|
|
|
|
|
|
-- close focused window
|
|
|
|
|
, ((modm .|. shiftMask, xK_c ), kill)
|
|
|
|
|
-- Program Close KB
|
|
|
|
|
((modm .|. shiftMask, xK_c), kill),
|
|
|
|
|
((modm .|. shiftMask .|. controlMask, xK_c), spawn "xkill"),
|
|
|
|
|
|
|
|
|
|
-- Rotate through the available layout algorithms
|
|
|
|
|
, ((modm, xK_space ), sendMessage NextLayout)
|
|
|
|
|
-- WM Related KB
|
|
|
|
|
((modm, xK_Escape), visualSubmap def $ M.fromList $
|
|
|
|
|
[
|
|
|
|
|
((shiftMask, xK_q), subName "Exit" $ io exitSuccess),
|
|
|
|
|
((0, xK_r), subName "Restart" $ spawn "xmonad --recompile; xmonad --restart")
|
|
|
|
|
]
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
-- Reset the layouts on the current workspace to default
|
|
|
|
|
, ((modm .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
|
|
|
|
|
-- Layout Related KB
|
|
|
|
|
((modm, xK_space), sendMessage NextLayout),
|
|
|
|
|
((modm .|. shiftMask, xK_space), setLayout $ XMonad.layoutHook conf),
|
|
|
|
|
((modm, xK_comma), sendMessage (IncMasterN 1)),
|
|
|
|
|
((modm, xK_period), sendMessage (IncMasterN (-1))),
|
|
|
|
|
((modm, xK_f), sendMessage $ JumpToLayout "Full"),
|
|
|
|
|
|
|
|
|
|
-- Resize viewed windows to the correct size
|
|
|
|
|
, ((modm, xK_n ), refresh)
|
|
|
|
|
-- Gaps Related KB
|
|
|
|
|
(
|
|
|
|
|
(modm, xK_g), visualSubmap def $ M.fromList $
|
|
|
|
|
[
|
|
|
|
|
((0, xK_g), subName "Toggle Gaps" $ sendMessage $ ToggleGaps),
|
|
|
|
|
((controlMask, xK_h), subName "Toggle Left Gap" $ sendMessage $ ToggleGap L),
|
|
|
|
|
((controlMask, xK_l), subName "Toggle Right Gap" $ sendMessage $ ToggleGap R),
|
|
|
|
|
((controlMask, xK_k), subName "Toggle Up Gap" $ sendMessage $ ToggleGap U),
|
|
|
|
|
((controlMask, xK_j), subName "Toggle Down Gap" $ sendMessage $ ToggleGap D),
|
|
|
|
|
((0, xK_h), subName "Inc Left Gap" $ sendMessage $ IncGap 5 L),
|
|
|
|
|
((0, xK_l), subName "Inc Right Gap" $ sendMessage $ IncGap 5 R),
|
|
|
|
|
((0, xK_k), subName "Inc Up Gap" $ sendMessage $ IncGap 5 U),
|
|
|
|
|
((0, xK_j), subName "Inc Down Gap" $ sendMessage $ IncGap 5 D),
|
|
|
|
|
((shiftMask, xK_h), subName "Dec Left Gap" $ sendMessage $ DecGap 5 L),
|
|
|
|
|
((shiftMask, xK_l), subName "Dec Right Gap" $ sendMessage $ DecGap 5 R),
|
|
|
|
|
((shiftMask, xK_k), subName "Dec Up Gap" $ sendMessage $ DecGap 5 U),
|
|
|
|
|
((shiftMask, xK_j), subName "Dec Down Gap" $ sendMessage $ DecGap 5 D)
|
|
|
|
|
]
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
-- Move focus to the next window
|
|
|
|
|
, ((modm, xK_Tab ), windows W.focusDown)
|
|
|
|
|
|
|
|
|
|
-- Move focus to the next window
|
|
|
|
|
, ((modm, xK_j ), windows W.focusDown)
|
|
|
|
|
|
|
|
|
|
-- Move focus to the previous window
|
|
|
|
|
, ((modm, xK_k ), windows W.focusUp )
|
|
|
|
|
|
|
|
|
|
-- Move focus to the master window
|
|
|
|
|
, ((modm, xK_m ), windows W.focusMaster )
|
|
|
|
|
|
|
|
|
|
-- Swap the focused window and the master window
|
|
|
|
|
, ((modm, xK_Return), windows W.swapMaster)
|
|
|
|
|
|
|
|
|
|
-- Swap the focused window with the next window
|
|
|
|
|
, ((modm .|. shiftMask, xK_j ), windows W.swapDown )
|
|
|
|
|
|
|
|
|
|
-- Swap the focused window with the previous window
|
|
|
|
|
, ((modm .|. shiftMask, xK_k ), windows W.swapUp )
|
|
|
|
|
|
|
|
|
|
-- Shrink the master area
|
|
|
|
|
, ((modm, xK_h ), sendMessage Shrink)
|
|
|
|
|
|
|
|
|
|
-- Expand the master area
|
|
|
|
|
, ((modm, xK_l ), sendMessage Expand)
|
|
|
|
|
|
|
|
|
|
-- Push window back into tiling
|
|
|
|
|
, ((modm, xK_t ), withFocused $ windows . W.sink)
|
|
|
|
|
|
|
|
|
|
-- Increment the number of windows in the master area
|
|
|
|
|
, ((modm , xK_comma ), sendMessage (IncMasterN 1))
|
|
|
|
|
|
|
|
|
|
-- Deincrement the number of windows in the master area
|
|
|
|
|
, ((modm , xK_period), sendMessage (IncMasterN (-1)))
|
|
|
|
|
|
|
|
|
|
-- Toggle the status bar gap
|
|
|
|
|
-- Use this binding with avoidStruts from Hooks.ManageDocks.
|
|
|
|
|
-- See also the statusBar function from Hooks.DynamicLog.
|
|
|
|
|
--
|
|
|
|
|
-- , ((modm , xK_b ), sendMessage ToggleStruts)
|
|
|
|
|
|
|
|
|
|
-- Quit xmonad
|
|
|
|
|
, ((modm .|. shiftMask, xK_q ), io exitSuccess)
|
|
|
|
|
|
|
|
|
|
-- Restart xmonad
|
|
|
|
|
, ((modm , xK_q ), spawn "xmonad --recompile; xmonad --restart")
|
|
|
|
|
|
|
|
|
|
-- Run xmessage with a summary of the default keybindings (useful for beginners)
|
|
|
|
|
, ((modm .|. shiftMask, xK_slash ), xmessage help)
|
|
|
|
|
]
|
|
|
|
|
++
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- mod-[1..9], Switch to workspace N
|
|
|
|
|
-- mod-shift-[1..9], Move client to workspace N
|
|
|
|
|
--
|
|
|
|
|
[((m .|. modm, k), windows $ f i)
|
|
|
|
|
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
|
|
|
|
|
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
|
|
|
|
|
++
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
|
|
|
|
|
-- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
|
|
|
|
|
--
|
|
|
|
|
[((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
|
|
|
|
|
| (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
|
|
|
|
|
, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
|
-- Mouse bindings: default actions bound to mouse events
|
|
|
|
|
--
|
|
|
|
|
myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList
|
|
|
|
|
|
|
|
|
|
-- mod-button1, Set the window to floating mode and move by dragging
|
|
|
|
|
[ ((modm, button1), \w -> focus w >> mouseMoveWindow w
|
|
|
|
|
>> windows W.shiftMaster)
|
|
|
|
|
|
|
|
|
|
-- mod-button2, Raise the window to the top of the stack
|
|
|
|
|
, ((modm, button2), \w -> focus w >> windows W.shiftMaster)
|
|
|
|
|
|
|
|
|
|
-- mod-button3, Set the window to floating mode and resize by dragging
|
|
|
|
|
, ((modm, button3), \w -> focus w >> mouseResizeWindow w
|
|
|
|
|
>> windows W.shiftMaster)
|
|
|
|
|
|
|
|
|
|
-- you may also bind events to the mouse scroll wheel (button4 and button5)
|
|
|
|
|
-- Windows Related KB
|
|
|
|
|
((modm, xK_a), refresh),
|
|
|
|
|
((modm, xK_Tab), windows W.focusDown),
|
|
|
|
|
((modm, xK_j), windows W.focusDown),
|
|
|
|
|
((modm, xK_k), windows W.focusUp),
|
|
|
|
|
((modm, xK_m), windows W.focusMaster),
|
|
|
|
|
((modm, xK_Return), windows W.swapMaster),
|
|
|
|
|
((modm .|. shiftMask, xK_j), windows W.swapDown),
|
|
|
|
|
((modm .|. shiftMask, xK_k), windows W.swapUp),
|
|
|
|
|
((modm, xK_h), sendMessage Expand),
|
|
|
|
|
((modm, xK_l), sendMessage Shrink),
|
|
|
|
|
((modm, xK_t), withFocused $ windows . W.sink),
|
|
|
|
|
((modm, xK_m), withFocused minimizeWindow),
|
|
|
|
|
((modm .|. shiftMask, xK_m), withLastMinimized maximizeWindowAndFocus),
|
|
|
|
|
((modm .|. controlMask, xK_c), windows copyToAll),
|
|
|
|
|
((modm .|. controlMask .|. shiftMask, xK_c), killAllOtherCopies),
|
|
|
|
|
((modm .|. shiftMask, xK_c), kill1)
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
|
-- Layouts:
|
|
|
|
|
++
|
|
|
|
|
|
|
|
|
|
-- You can specify and transform your layouts by modifying these values.
|
|
|
|
|
-- If you change layout bindings be sure to use 'mod-shift-space' after
|
|
|
|
|
-- restarting (with 'mod-q') to reset your layout state to the new
|
|
|
|
|
-- defaults, as xmonad preserves your old layout settings by default.
|
|
|
|
|
--
|
|
|
|
|
-- The available layouts. Note that each layout is separated by |||,
|
|
|
|
|
-- which denotes layout choice.
|
|
|
|
|
--
|
|
|
|
|
myLayout = tiled ||| Mirror tiled ||| Full
|
|
|
|
|
where
|
|
|
|
|
-- default tiling algorithm partitions the screen into two panes
|
|
|
|
|
tiled = Tall nmaster delta ratio
|
|
|
|
|
-- Workspace Related KB
|
|
|
|
|
[
|
|
|
|
|
((modm, xK_Page_Up), nextWS),
|
|
|
|
|
((modm, xK_Page_Down), prevWS),
|
|
|
|
|
((modm, xK_n), nextWS),
|
|
|
|
|
((modm, xK_p), prevWS)
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
-- The default number of windows in the master pane
|
|
|
|
|
nmaster = 1
|
|
|
|
|
++
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
((m .|. modm, k), windows $ f i)
|
|
|
|
|
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
|
|
|
|
|
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask), (copy, controlMask)]
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
-- Default proportion of screen occupied by master pane
|
|
|
|
|
ratio = 1/2
|
|
|
|
|
mouseBinds (XConfig {XMonad.modMask = modm}) = M.fromList
|
|
|
|
|
[
|
|
|
|
|
((modm, button1), \w -> focus w >> mouseMoveWindow w >> windows W.shiftMaster),
|
|
|
|
|
((modm, button2), \w -> focus w >> windows W.shiftMaster),
|
|
|
|
|
((modm, button3), \w -> focus w >> mouseResizeWindow w >> windows W.shiftMaster)
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
-- Percent of screen to increment by when resizing panes
|
|
|
|
|
delta = 3/100
|
|
|
|
|
layouts = avoidStruts(tiled ||| Mirror tiled ||| gaped_tiled ||| tabbed shrinkText tabConfig) ||| noBorders Full ||| gaped_full
|
|
|
|
|
where
|
|
|
|
|
tiled = minimize(Tall nmaster delta ratio)
|
|
|
|
|
gaped_tiled = gaps surrounded_gap $ minimize(Tall nmaster delta ratio)
|
|
|
|
|
gaped_full = gaps surrounded_gap $ noBorders Full
|
|
|
|
|
surrounded_gap = [(U,10),(D,10),(L,10),(R,10)]
|
|
|
|
|
nmaster = 1
|
|
|
|
|
ratio = 1/2
|
|
|
|
|
delta = 3/100
|
|
|
|
|
tabConfig = def {
|
|
|
|
|
fontName = "xft:DejaVu Sans Mono",
|
|
|
|
|
activeColor = "#aaaaaa",
|
|
|
|
|
inactiveColor = "#8a8a8a"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
|
-- Window rules:
|
|
|
|
|
-- Manage Hook
|
|
|
|
|
mh = composeAll
|
|
|
|
|
[
|
|
|
|
|
title =? "Picture-in-Picture" --> doSideFloat SE,
|
|
|
|
|
isFullscreen --> doFullFloat,
|
|
|
|
|
isDialog --> doCenterFloat
|
|
|
|
|
]
|
|
|
|
|
-- Event Hook
|
|
|
|
|
eh = mempty
|
|
|
|
|
-- Log Hook
|
|
|
|
|
lh h = dynamicLogWithPP $ statbarPipe { ppOutput = hPutStrLn h }
|
|
|
|
|
|
|
|
|
|
-- Execute arbitrary actions and WindowSet manipulations when managing
|
|
|
|
|
-- a new window. You can use this to, for example, always float a
|
|
|
|
|
-- particular program, or have a client always appear on a particular
|
|
|
|
|
-- workspace.
|
|
|
|
|
--
|
|
|
|
|
-- To find the property name associated with a program, use
|
|
|
|
|
-- > xprop | grep WM_CLASS
|
|
|
|
|
-- and click on the client you're interested in.
|
|
|
|
|
--
|
|
|
|
|
-- To match on the WM_NAME, you can use 'title' in the same way that
|
|
|
|
|
-- 'className' and 'resource' are used below.
|
|
|
|
|
--
|
|
|
|
|
myManageHook = composeAll
|
|
|
|
|
[ className =? "MPlayer" --> doFloat
|
|
|
|
|
, className =? "Gimp" --> doFloat
|
|
|
|
|
, resource =? "desktop_window" --> doIgnore
|
|
|
|
|
, resource =? "kdesktop" --> doIgnore ]
|
|
|
|
|
-- Startup Hook
|
|
|
|
|
sh = do
|
|
|
|
|
spawn "launch-polybar-xmonadAppTray"
|
|
|
|
|
spawnOnce "feh --bg-scale ~/画像/wallpaper/85444653_p0.jpg"
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
|
-- Event handling
|
|
|
|
|
-- Status bar used in WM
|
|
|
|
|
statbar :: String
|
|
|
|
|
statbar = "xmobar"
|
|
|
|
|
|
|
|
|
|
-- * EwmhDesktops users should change this to ewmhDesktopsEventHook
|
|
|
|
|
--
|
|
|
|
|
-- Defines a custom handler function for X Events. The function should
|
|
|
|
|
-- return (All True) if the default handler is to be run afterwards. To
|
|
|
|
|
-- combine event hooks use mappend or mconcat from Data.Monoid.
|
|
|
|
|
--
|
|
|
|
|
myEventHook = mempty
|
|
|
|
|
statbarPipe = xmobarPP {
|
|
|
|
|
ppOrder = \(ws:l:t:_) -> [ws,t],
|
|
|
|
|
ppCurrent = xmobarColor "red" "black" . \s -> wrap "[" "]" (s ++ " ●"),
|
|
|
|
|
ppUrgent = xmobarColor "gray" "black" . \s -> wrap "{" "}" (s ++ " ●"),
|
|
|
|
|
ppVisible = xmobarColor "red" "black" . \s -> pad (s ++ " ◎"),
|
|
|
|
|
ppHidden = xmobarColor "gray" "black" . \s -> pad (s ++ " ●"),
|
|
|
|
|
ppHiddenNoWindows = xmobarColor "gray" "black" . \s -> pad (s ++ " ○"),
|
|
|
|
|
ppTitle = xmobarColor "red" "black" . shorten 32,
|
|
|
|
|
ppLayout = id,
|
|
|
|
|
ppOutput = putStrLn,
|
|
|
|
|
ppWsSep = " ",
|
|
|
|
|
ppSep = " | "
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
|
-- Status bars and logging
|
|
|
|
|
|
|
|
|
|
-- Perform an arbitrary action on each internal state change or X event.
|
|
|
|
|
-- See the 'XMonad.Hooks.DynamicLog' extension for examples.
|
|
|
|
|
--
|
|
|
|
|
myLogHook = return ()
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
|
-- Startup hook
|
|
|
|
|
|
|
|
|
|
-- Perform an arbitrary action each time xmonad starts or is restarted
|
|
|
|
|
-- with mod-q. Used by, e.g., XMonad.Layout.PerWorkspace to initialize
|
|
|
|
|
-- per-workspace layout choices.
|
|
|
|
|
--
|
|
|
|
|
-- By default, do nothing.
|
|
|
|
|
myStartupHook = do
|
|
|
|
|
spawn "feh --bg-scale ~/画像/wallpaper/85444653_p0.jpg"
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
|
-- Now run xmonad with all the defaults we set up.
|
|
|
|
|
|
|
|
|
|
-- Run xmonad with the settings you specify. No need to modify this.
|
|
|
|
|
--
|
|
|
|
|
main :: IO()
|
|
|
|
|
main = do
|
|
|
|
|
xmobar myConfig >>= xmonad
|
|
|
|
|
wsbar <- spawnPipe statbar
|
|
|
|
|
xmonad . docks $ myConfig wsbar
|
|
|
|
|
|
|
|
|
|
-- A structure containing your configuration settings, overriding
|
|
|
|
|
-- fields in the default config. Any you don't override, will
|
|
|
|
|
-- use the defaults defined in xmonad/XMonad/Config.hs
|
|
|
|
|
--
|
|
|
|
|
-- No need to modify this.
|
|
|
|
|
--
|
|
|
|
|
myConfig = def {
|
|
|
|
|
-- simple stuff
|
|
|
|
|
terminal = myTerminal,
|
|
|
|
|
focusFollowsMouse = myFocusFollowsMouse,
|
|
|
|
|
clickJustFocuses = myClickJustFocuses,
|
|
|
|
|
borderWidth = myBorderWidth,
|
|
|
|
|
modMask = myModMask,
|
|
|
|
|
workspaces = myWorkspaces,
|
|
|
|
|
normalBorderColor = myNormalBorderColor,
|
|
|
|
|
focusedBorderColor = myFocusedBorderColor,
|
|
|
|
|
|
|
|
|
|
-- key bindings
|
|
|
|
|
keys = myKeys,
|
|
|
|
|
mouseBindings = myMouseBindings,
|
|
|
|
|
|
|
|
|
|
-- hooks, layouts
|
|
|
|
|
layoutHook = myLayout,
|
|
|
|
|
manageHook = myManageHook,
|
|
|
|
|
handleEventHook = myEventHook,
|
|
|
|
|
logHook = myLogHook,
|
|
|
|
|
startupHook = myStartupHook
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-- | Finally, a copy of the default bindings in simple textual tabular format.
|
|
|
|
|
help :: String
|
|
|
|
|
help = unlines ["The default modifier key is 'alt'. Default keybindings:",
|
|
|
|
|
"",
|
|
|
|
|
"-- launching and killing programs",
|
|
|
|
|
"mod-Shift-Enter Launch xterminal",
|
|
|
|
|
"mod-p Launch dmenu",
|
|
|
|
|
"mod-Shift-p Launch gmrun",
|
|
|
|
|
"mod-Shift-c Close/kill the focused window",
|
|
|
|
|
"mod-Space Rotate through the available layout algorithms",
|
|
|
|
|
"mod-Shift-Space Reset the layouts on the current workSpace to default",
|
|
|
|
|
"mod-n Resize/refresh viewed windows to the correct size",
|
|
|
|
|
"mod-Shift-/ Show this help message with the default keybindings",
|
|
|
|
|
"",
|
|
|
|
|
"-- move focus up or down the window stack",
|
|
|
|
|
"mod-Tab Move focus to the next window",
|
|
|
|
|
"mod-Shift-Tab Move focus to the previous window",
|
|
|
|
|
"mod-j Move focus to the next window",
|
|
|
|
|
"mod-k Move focus to the previous window",
|
|
|
|
|
"mod-m Move focus to the master window",
|
|
|
|
|
"",
|
|
|
|
|
"-- modifying the window order",
|
|
|
|
|
"mod-Return Swap the focused window and the master window",
|
|
|
|
|
"mod-Shift-j Swap the focused window with the next window",
|
|
|
|
|
"mod-Shift-k Swap the focused window with the previous window",
|
|
|
|
|
"",
|
|
|
|
|
"-- resizing the master/slave ratio",
|
|
|
|
|
"mod-h Shrink the master area",
|
|
|
|
|
"mod-l Expand the master area",
|
|
|
|
|
"",
|
|
|
|
|
"-- floating layer support",
|
|
|
|
|
"mod-t Push window back into tiling; unfloat and re-tile it",
|
|
|
|
|
"",
|
|
|
|
|
"-- increase or decrease number of windows in the master area",
|
|
|
|
|
"mod-comma (mod-,) Increment the number of windows in the master area",
|
|
|
|
|
"mod-period (mod-.) Deincrement the number of windows in the master area",
|
|
|
|
|
"",
|
|
|
|
|
"-- quit, or restart",
|
|
|
|
|
"mod-Shift-q Quit xmonad",
|
|
|
|
|
"mod-q Restart xmonad",
|
|
|
|
|
"mod-[1..9] Switch to workSpace N",
|
|
|
|
|
"",
|
|
|
|
|
"-- Workspaces & screens",
|
|
|
|
|
"mod-Shift-[1..9] Move client to workspace N",
|
|
|
|
|
"mod-{w,e,r} Switch to physical/Xinerama screens 1, 2, or 3",
|
|
|
|
|
"mod-Shift-{w,e,r} Move client to screen 1, 2, or 3",
|
|
|
|
|
"",
|
|
|
|
|
"-- Mouse bindings: default actions bound to mouse events",
|
|
|
|
|
"mod-button1 Set the window to floating mode and move by dragging",
|
|
|
|
|
"mod-button2 Raise the window to the top of the stack",
|
|
|
|
|
"mod-button3 Set the window to floating mode and resize by dragging"]
|
|
|
|
|
myConfig bar = def {
|
|
|
|
|
terminal = term,
|
|
|
|
|
focusFollowsMouse = ffm,
|
|
|
|
|
clickJustFocuses = cf,
|
|
|
|
|
borderWidth = bw,
|
|
|
|
|
modMask = modKey,
|
|
|
|
|
workspaces = ws,
|
|
|
|
|
normalBorderColor = bcn,
|
|
|
|
|
focusedBorderColor = bcf,
|
|
|
|
|
keys = keyBinds,
|
|
|
|
|
mouseBindings = mouseBinds,
|
|
|
|
|
layoutHook = layouts,
|
|
|
|
|
manageHook = mh <+> manageDocks,
|
|
|
|
|
handleEventHook = eh,
|
|
|
|
|
logHook = lh bar,
|
|
|
|
|
startupHook = sh
|
|
|
|
|
}
|
|
|
|
|
|