Skip to content

Instantly share code, notes, and snippets.

@MasseGuillaume
Created March 13, 2017 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MasseGuillaume/7409809fe78c79c69ac81a32f2af49ae to your computer and use it in GitHub Desktop.
Save MasseGuillaume/7409809fe78c79c69ac81a32f2af49ae to your computer and use it in GitHub Desktop.
xmonad dvorak/querty
import XMonad
import qualified XMonad as XMonad
import XMonad.Hooks.SetWMName
import qualified XMonad.StackSet as W
import qualified Data.Map as Map
import System.Exit
dvorak conf@(XConfig {XMonad.modMask = modm}) = Map.fromList $
keyBase conf ++
[
((modm, xK_t), windows W.focusDown)
, ((modm, xK_n), windows W.focusUp)
, ((modm .|. shiftMask, xK_t), windows W.swapDown)
, ((modm .|. shiftMask, xK_n), windows W.swapUp)
, ((modm, xK_h), sendMessage Shrink)
, ((modm, xK_s), sendMessage Expand)
, ((modm, xK_g), withFocused $ windows . W.sink)
]
++
[((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
| (key, sc) <- zip [xK_e, xK_u] [0..]
, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
querty conf@(XConfig {XMonad.modMask = modm}) = Map.fromList $
keyBase conf ++
[
((modm, xK_j), windows W.focusDown)
, ((modm, xK_k), windows W.focusUp)
, ((modm .|. shiftMask, xK_j), windows W.swapDown)
, ((modm .|. shiftMask, xK_k), windows W.swapUp)
, ((modm, xK_h), sendMessage Shrink)
, ((modm, xK_l), sendMessage Expand)
, ((modm, xK_t), withFocused $ windows . W.sink)
]
++
[((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
| (key, sc) <- zip [xK_e, xK_r] [0..]
, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
keyBase conf@(XConfig {XMonad.modMask = modm}) =
[
((modm, xK_Tab ), windows W.focusDown)
, ((modm .|. shiftMask, xK_Tab ), windows W.focusUp )
, ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
, ((modm, xK_p ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")
, ((modm .|. shiftMask, xK_c ), kill)
, ((modm, xK_space ), sendMessage NextLayout)
, ((modm .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
, ((modm , xK_q ), spawn "xmonad --recompile; xmonad --restart")
]
++
[((m .|. modm, k), windows $ f i)
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
main = xmonad $ defaultConfig {
keys = dvorak,
startupHook = setWMName "LG3D",
borderWidth = 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment