Replies: 10 comments 17 replies
-
You can bind a key to something like gets windowset >>= mapM_ (windows . W.shiftWin "1") . W.allWindows (with |
Beta Was this translation helpful? Give feedback.
-
Hmmm. Not sure what I did wrong. Here is my xmonad.hs:
```
import XMonad
import qualified XMonad.StackSet as W
main = xmonad defaultConfig
{ modMask = mod4Mask
, terminal = "xterm -e vifm -c empty /home/wgm"
, borderWidth = 0
, layoutHook = Full ||| tiled ||| Mirror tiled
}
tiled = Tall 1 (3/100) (1/2)
gets windowset >>= mapM_ (windows . W.shiftWin "1") . W.allWindows
```
And I get the error:
```
xmonad --recompile
XMonad will use ghc to recompile, because "/home/wgm/.xmonad/build" does not exist.
Error detected while loading xmonad configuration file: /home/wgm/.xmonad/xmonad.hs
xmonad.hs:13:1: error:
Parse error: module header, import declaration
or top-level declaration expected.
|
13 | gets windowset >>= mapM_ (windows . W.shiftWin "1") . W.allWindows
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Please check the file for errors.
xmonad: xmessage: executeFile: does not exist (No such file or directory)
```
Also, if I wanted to bind it to Windows key shift key spacebar, what
would the code look like?
|
Beta Was this translation helpful? Give feedback.
-
On Sun, Jan 16 2022 21:34, wgmayer0 wrote:
Hmmm. Not sure what I did wrong.
Geekosaur gave you what you are supposed to bind to a key; this wasn't
supposed to be a top-level definition.
Also, if I wanted to bind it to Windows key shift key spacebar, what
would the code look like?
Before I give you something which I believe would work, let me first say
that I _strongly_ suggest you go through the tutorial:
https://xmonad.org/TUTORIAL.html
It'll probably save you a lot of headaches down the line.
Anyways, try something like
import XMonad
import XMonad.EZConfig
import qualified XMonad.StackSet as W
main = xmonad $ def
{ modMask = mod4Mask
, terminal = "xterm -e vifm -c empty /home/wgm"
, borderWidth = 0
, layoutHook = Full ||| tiled ||| Mirror tiled
}
`additionalKeysP`
[("M-S-<Space>", gets windowset >>= mapM_ (windows . W.shiftWin "1") . W.allWindows)]
tiled = Tall 1 (3/100) (1/2)
Lastly, I think this is a big of an x-y problem; if you just want to get
an overview over what's open, something like X.P.Window[1] sounds like
the better option.
[1]: https://hackage.haskell.org/package/xmonad-contrib-0.17.0/docs/XMonad-Prompt-Window.html
|
Beta Was this translation helpful? Give feedback.
-
For some reason nothing happens when I press the Windows Shift Spacebar key combination. Here is my code:
It compiles fine:
|
Beta Was this translation helpful? Give feedback.
-
On Tue, Jan 18 2022 11:00, wgmayer0 wrote:
For some reason nothing happens when I press the Windows Shift
Spacebar key combination. Here is my code:
Did you restart xmonad? (M-q or `xmonad --restart`). That code has the
desired behaviour for me.
|
Beta Was this translation helpful? Give feedback.
-
Agreed, I just tested it here and it works fine if a little suboptimally because getting it all into a single call to |
Beta Was this translation helpful? Give feedback.
-
Can I also reset the tiles to their default layout when I press the keybinding? This link shows this line: Code:
Output:
|
Beta Was this translation helpful? Give feedback.
-
You can't use that keybinding you took from conf = def {modMask = mod4Mask
, terminal = "xterm -e vifm -c empty /home/wgm"
, borderWidth = 0
, layoutHook = Full ||| tiled
} into its own function, which you could go ahead and call main = xmonad $ conf
`additionalKeysP`
... |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot! I really appreciate your help!
…On Wed, Jan 26, 2022, 7:17 PM brandon s allbery kf8nh < ***@***.***> wrote:
You can insert the sequence I gave you above before the >>, with another
>> in front of it:
, ("M-C-<Space>", doTo Next EmptyWS getSortByIndex
(\ws -> withFocused (\w -> windows (W.view ws . W.shiftWin ws w))) >>
asks (layoutHook . config) >>= setLayout >>
sendMessage (JumpToLayout "Tall"))
(I've reformatted this to multiple lines to make it easier to read.)
—
Reply to this email directly, view it on GitHub
<#363 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARTB5TKOFNYNWBDKQCXHBNLUYCFH5ANCNFSM5L5VR34Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign=notification-email&utm_medium=email&utm_source=github>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
New question: When I run Modkey Shift enter, can it also set all other workspaces to their default layouts? In other words, set all other workspaces to
|
Beta Was this translation helpful? Give feedback.
-
Would it be possible to move all currently existent windows on all workspaces to the first workspace in one keystroke? This helps me keep track of what I have open
Beta Was this translation helpful? Give feedback.
All reactions