LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 09:14 AM   #1
Siljrath
Bedrock Linux Advocate
 
Registered: Nov 2004
Location: the internet
Distribution: server:Gentoo | workstation:Bedrock (hijacked:void, fetched:Gentoo,Devuan,Artix)
Posts: 226

Rep: Reputation: 66
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 09:10 AM. Reason: marked as solved
 
Old 09-29-2012, 02:20 PM   #2
Siljrath
Bedrock Linux Advocate
 
Registered: Nov 2004
Location: the internet
Distribution: server:Gentoo | workstation:Bedrock (hijacked:void, fetched:Gentoo,Devuan,Artix)
Posts: 226

Original Poster
Rep: Reputation: 66
-- (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 09:08 AM. Reason: extrapolation
 
  


Reply



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 12:09 PM
turn off scroller as method of workspace switching jmite Linux - Newbie 2 01-03-2009 01:21 AM
Leopard-like workspace switching kahlil88 Linux - Software 0 12-31-2007 11:43 PM
Redhat 9 workspace switching crofty13 Linux - Software 1 02-05-2005 04:11 PM
Redhat 9 Workspace Switcher not switching. oneferna Linux - Distributions 2 05-26-2003 11:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 09:16 PM.

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
Open Source Consulting | Domain Registration