LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices



Reply
 
Search this Thread
Old 09-29-2012, 10:14 AM   #1
Siljrath
Member
 
Registered: Nov 2004
Location: the internet
Distribution: sid, slack, gentoo, witch, bedrock, exherbo
Posts: 162

Rep: Reputation: 43
Cool [solved] XMonad translate workspace switching to emacs-style keybind syntax


additionalKeysP from EZConfig, is really nice for cleaning up and sweetening xmonad.hs. also expands keybind paradigms, opening up way more possibilities.

however, i am stuck without move and switch to workspace.

i tried figuring this out from reading about XMonad.Util.EZConfig, but i'm not quite getting it.


as lifted from default example xmonad.hs i found on my other computer:
Code:
     ++

     --
     -- 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)]]
i have the rest of it easily translated, and have been using the short format for many more keybinds for use with other extensions, but i still have not figured out how to translate the workspace/screen switching/moving portion.

anyone know how to get me a "M-[1-9]" sort of switching keybind setup?

Last edited by Siljrath; 10-01-2012 at 10:10 AM. Reason: marked as solved
 
Old 09-29-2012, 03:20 PM   #2
Siljrath
Member
 
Registered: Nov 2004
Location: the internet
Distribution: sid, slack, gentoo, witch, bedrock, exherbo
Posts: 162

Original Poster
Rep: Reputation: 43
-- (2012-09-29 15:14:37) dr_bs:
zip (map (\x -> fst x++[snd x]) ((zip (repeat "M-") (['1'..'9'])))) (map (withNthWorkspace W.greedyView) [0..])

-- and extrapolated to also have move window to workspace in emacs keybind format:
zip (map (\x -> fst x++[snd x]) ((zip (repeat "M-S-") (['1'..'9'])))) (map (withNthWorkspace W.shift) [0..])

Last edited by Siljrath; 10-01-2012 at 10:08 AM. Reason: extrapolation
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Switching workspaces in xmonad using programmer dvorak keyboard layout hda7 Linux - Software 6 03-25-2012 01:09 PM
turn off scroller as method of workspace switching jmite Linux - Newbie 2 01-03-2009 02:21 AM
Leopard-like workspace switching kahlil88 Linux - Software 0 01-01-2008 12:43 AM
Redhat 9 workspace switching crofty13 Linux - Software 1 02-05-2005 05:11 PM
Redhat 9 Workspace Switcher not switching. oneferna Linux - Distributions 2 05-26-2003 12:04 PM


All times are GMT -5. The time now is 07:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration