Skip to content

Instantly share code, notes, and snippets.

@jefflasslett
Created April 11, 2013 04:21
Show Gist options
  • Save jefflasslett/5360705 to your computer and use it in GitHub Desktop.
Save jefflasslett/5360705 to your computer and use it in GitHub Desktop.
xmonad.hs (xmonad config) to provide swiping touch screen to cycle workspaces. Clicks (taps) don't reach app though.
import XMonad
import XMonad.Hooks.ManageDocks
import XMonad.Util.EZConfig
import XMonad.Actions.MouseGestures
import XMonad.Actions.CycleWS
import XMonad.Actions.SpawnOn
import qualified XMonad.StackSet as W
import qualified Data.Map as M
myManageHook = composeAll
[ className =? "MIM" --> doShift "mim"
, className =? "Sygic FLEET" --> doShift "nav"
, manageDocks
]
myClickJustFocuses :: Bool
myClickJustFocuses = False
myTerminal = "terminator"
--myMouseBindings = [ ( ( mod1Mask .|. shiftMask, button1 ), mouseGesture gestures ) ]
--myMouseBindings = [ ( ( mod1Mask, button1 ), mouseGesture gestures ) ]
myMouseBindings = [ ( ( 0, button1 ), mouseGesture gestures ) ]
gestures = M.fromList
[ ( [ L ], \_ -> nextWS )
, ( [ U ], \_ -> nextWS )
, ( [ R ], \_ -> prevWS )
, ( [ D ], \_ -> prevWS )
]
myStartup :: X ()
myStartup =
do
spawnOn "mim" "terminator"
spawnOn "nav" "chromium-browser"
main = xmonad $ defaultConfig
{ workspaces = ["1:mim","2:nav","3"]
, manageHook = myManageHook <+> manageHook defaultConfig -- uses default too
, startupHook = myStartup
, terminal = myTerminal
, focusFollowsMouse = True
, clickJustFocuses = myClickJustFocuses
-- set terminal, modMask, etc.
} `additionalMouseBindings` myMouseBindings
@rpelizzi
Copy link

Have you solved this problem? I am trying to do something similar, keyboard-free mouse gestures for when I am too lazy to use the keyboard.
http://stackoverflow.com/questions/18304191/keyboard-free-mouse-gestures-for-xmonad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment