bépo keyboards workspace switching, additional shortcuts
This commit is contained in:
parent
26766b980c
commit
6b696da9c7
1 changed files with 69 additions and 10 deletions
79
xmonad.hs
79
xmonad.hs
|
|
@ -8,7 +8,11 @@ import XMonad.Actions.CycleWS
|
|||
import XMonad.Layout.ResizableTile
|
||||
import XMonad.Actions.WindowGo
|
||||
import XMonad.Util.Scratchpad (scratchpadSpawnAction, scratchpadManageHook, scratchpadFilterOutWorkspace)
|
||||
import XMonad.Config.Azerty
|
||||
import XMonad.Layout.WindowNavigation
|
||||
import XMonad.Actions.FloatSnap
|
||||
import XMonad.Actions.PhysicalScreens
|
||||
|
||||
import qualified XMonad.Actions.FlexibleManipulate as Flex
|
||||
|
||||
import qualified XMonad.StackSet as W
|
||||
import qualified Data.Map as M
|
||||
|
|
@ -22,12 +26,12 @@ main = xmonad $ gnomeConfig
|
|||
, focusedBorderColor = "#ffbb00"
|
||||
, borderWidth = 3
|
||||
-- Switch workspaces with default first azerty row instead of plain numbers
|
||||
, keys = \c -> azertyKeys c `M.union` keys gnomeConfig c
|
||||
, keys = \c -> bepoKeys c `M.union` keys gnomeConfig c
|
||||
|
||||
-- add a fullscreen tabbed layout that does not avoid covering
|
||||
-- up desktop panels before the desktop layouts
|
||||
-- desktopLayoutModifiers still allow toggling panel visibility
|
||||
, layoutHook = desktopLayoutModifiers( simpleTabbed ||| rtall )
|
||||
, layoutHook = windowNavigation( desktopLayoutModifiers( simpleTabbed ||| rtall ) )
|
||||
}
|
||||
-- Simple notation ala emacs
|
||||
`additionalKeysP`
|
||||
|
|
@ -41,27 +45,58 @@ main = xmonad $ gnomeConfig
|
|||
, ("M-b d", kill )
|
||||
, ("M-x", kill )
|
||||
-- Got to workspaces
|
||||
, ("M-b p", prevWS )
|
||||
, ("M-b p", prevWS )
|
||||
, ("M-b n", nextWS )
|
||||
, ("C-M-<Left>", prevWS )
|
||||
, ("C-M-<Right>", nextWS )
|
||||
-- Move windows among workspaces
|
||||
, ("M-u <Left>", shiftToPrev )
|
||||
, ("M-u <Right>", shiftToNext )
|
||||
-- Shrink the master area
|
||||
, ("M-<Left>", sendMessage Shrink)
|
||||
, ("M-S-r", sendMessage Shrink)
|
||||
-- Expand the master area
|
||||
, ("M-<Right>", sendMessage Expand)
|
||||
, ("M-r", sendMessage Expand)
|
||||
-- Increment the number of windows in the master area
|
||||
, ("M-<Up>", sendMessage (IncMasterN 1))
|
||||
, ("M-s", sendMessage (IncMasterN 1))
|
||||
-- Deincrement the number of windows in the master area
|
||||
, ("M-<Down>", sendMessage (IncMasterN (-1)))
|
||||
, ("M-S-s", sendMessage (IncMasterN (-1)))
|
||||
-- Cycle through the available layout algorithms
|
||||
, ("M-<Return>", sendMessage NextLayout)
|
||||
|
||||
-- Move focus with arrows
|
||||
, ("M-<Right>", sendMessage $ Go R)
|
||||
, ("M-<Left>", sendMessage $ Go L)
|
||||
, ("M-<Up>", sendMessage $ Go U)
|
||||
, ("M-<Down>", sendMessage $ Go D)
|
||||
|
||||
-- Swap windows with arrows
|
||||
, ("M-S-<Right>", sendMessage $ Swap R)
|
||||
, ("M-S-<Left>", sendMessage $ Swap L)
|
||||
, ("M-S-<Up>", sendMessage $ Swap U)
|
||||
, ("M-S-<Down>", sendMessage $ Swap D)
|
||||
|
||||
-- Swap the focused window and the master window
|
||||
, ("C-M-<Return>", windows W.swapMaster)
|
||||
|
||||
-- Move focus to the master window
|
||||
, ("M-m", windows W.focusMaster )
|
||||
-- Scratchpad
|
||||
, ("M-<Space>", scratchpadSpawnAction gnomeConfig { terminal = "$XTERMCMD" } )
|
||||
]
|
||||
-- Extended notation, for F keys (?)
|
||||
, ("M-<XF86Calculator>", scratchpadSpawnAction gnomeConfig { terminal = "$XTERMCMD" } )
|
||||
-- Swap the focused window and the master window
|
||||
, ("M-S-<Return>", windows W.swapMaster)
|
||||
-- Swap the focused window with the next window
|
||||
, ("M-S-<Down>", windows W.swapDown )
|
||||
-- Swap the focused window with the previous window
|
||||
, ("M-S-<Up>", windows W.swapUp )
|
||||
|
||||
-- Move focus to the next physical xinerama screen
|
||||
, ("M-$", onPrevNeighbour W.view)
|
||||
|
||||
, ("<XF86HomePage>", runOrRaise "firefox" (className =? "Firefox" <||> className =? "Firefox-bin"))
|
||||
, ("<XF86Mail>", spawn "thunderbird -remote \"xfeDoCommand(composeMessage)\"")
|
||||
]
|
||||
-- Extended notation, for F keys (?)
|
||||
`additionalKeys`
|
||||
[
|
||||
((modm, xK_F1), spawn "xterm")
|
||||
|
|
@ -71,6 +106,30 @@ main = xmonad $ gnomeConfig
|
|||
-- Launch firefox or raise its window if already running
|
||||
, ((modm, xK_F5), spawn "nautilus --no-desktop")
|
||||
]
|
||||
`additionalMouseBindings`
|
||||
[
|
||||
-- Move window with M-mouse1
|
||||
((modm, 1), (\w -> focus w >> windows W.shiftMaster >> Flex.mouseWindow Flex.position w >> snapMagicMove (Just 50) (Just 50) w))
|
||||
-- Resize windows with M-mouse3
|
||||
, ((modm, 3), (\w -> focus w >> windows W.shiftMaster >> Flex.mouseWindow Flex.resize w >> snapMagicMouseResize 100 (Just 50) (Just 50) w))
|
||||
]
|
||||
where
|
||||
rtall = ResizableTall 1 (3/100) (1/2) []
|
||||
|
||||
|
||||
-- Workspace switching using first row keycodes
|
||||
-- for keyboards that do not use numbers here
|
||||
|
||||
-- bépo with «/» switched with </>
|
||||
numBepoNoj = [0x22,0x3c,0x3e,0x28,0x29,0x40,0x2b,0x2d,0x2f,0x2a]
|
||||
-- normal bépo
|
||||
numBepo = [0x22,0xab,0xbb,0x28,0x29,0x40,0x2b,0x2d,0x2f,0x2a]
|
||||
-- azerty
|
||||
numAzerty = [0x26,0xe9,0x22,0x27,0x28,0x2d,0xe8,0x5f,0xe7,0xe0]
|
||||
|
||||
bepoConfig = gnomeConfig { keys = bepoKeys <+> keys gnomeConfig }
|
||||
bepoKeys conf@(XConfig {modMask = modm}) = M.fromList $
|
||||
[((m .|. modm, k), windows $ f i)
|
||||
| (i, k) <- zip (workspaces conf) numBepoNoj,
|
||||
(f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue