Logs on 2024-11-12 (liberachat/#xmonad)
| 01:00:54 | × | td_ quits (~td@i5387091E.versanet.de) (Ping timeout: 260 seconds) |
| 01:02:17 | → | td_ joins (~td@i53870914.versanet.de) |
| 01:37:37 | → | beastwick joins (~brian@user/beastwick) |
| 01:39:00 | <beastwick> | Hi, curious if I can convert the code for dynamic workspace keys to work with a submap. So something like meta - h -> a function that generates the code for the submaps, specically A-Z keys. I have done it without a submap, but I still don't have a good grip on Haskell. |
| 01:39:25 | <beastwick> | basically want A-Z under a submap to dynamically assign hotkeys to the workspace. |
| 01:41:09 | <geekosaur> | dynamically assigning keys isn't really a thing in xmonad |
| 01:42:05 | <geekosaur> | you can rerun the code to bind keys in X11 but you can't change the mapping that it will rebind without restarting xmonad |
| 01:43:57 | <beastwick> | so, zip (zip (repeat (modm)) [xK_1..xK_9]) (map (withNthWorkspace W.greedyView) [0..]) can't be rewritten to return a structure that can be supplied to , ((modm, xK_a), submap . M.fromList $ [ ... |
| 01:44:40 | <geekosaur> | is that actually what you want? ypou made it sound like you wanted a keymap to be dynamically added when you dynamically ad a workspace |
| 01:44:51 | <geekosaur> | that can't be done without restarting xmonad |
| 01:45:07 | <beastwick> | don't mind restarting, trying to add to my config |
| 01:45:20 | <beastwick> | no not when I add a workspace |
| 01:45:29 | <beastwick> | when xmonad loads, from the config |
| 01:46:09 | <beastwick> | basically, I want the submap to be a set of keys, A-Z that can be assigned to a workspace, or used to switch to a workspace. |
| 01:46:13 | <geekosaur> | mm, actually I think it's hatrder than that because (a) once added, can't be removed because it's a function and you can't inspect functions (b) `xmonad` never returns, you exit by exiting the program, so you would have to actually edit your config somehoew |
| 01:46:24 | <geekosaur> | xmonad really isn't designed for this use case |
| 01:46:33 | <beastwick> | I think I am not explaning this well. |
| 01:46:42 | <beastwick> | https://hackage.haskell.org/package/xmonad-contrib-0.13/docs/XMonad-Actions-DynamicWorkspaces.html#g:1 |
| 01:46:54 | <beastwick> | has an example of setting up keys |
| 01:47:25 | <beastwick> | I want to setup a submap, because I don't have enough keys and if I use a differnt modifier key just for those keys like alt - it affects other programs |
| 01:47:27 | <beastwick> | https://xmonad.github.io/xmonad-docs/xmonad-contrib/XMonad-Actions-Submap.html |
| 01:48:20 | <beastwick> | basically under a submap I want my full keyboard of a-z so I can assign hotkeys to workspaces |
| 01:48:30 | <beastwick> | I like using a-z for mnemonics |
| 01:48:55 | <geekosaur> | submap takes the same parameters as keys, you don't need to change the code at all, just pass it to M.fromList |
| 01:49:20 | <geekosaur> | I thought you wanted to create a new submap for each added workspace |
| 01:49:31 | <beastwick> | no, although that sounds interesting |
| 01:49:33 | <beastwick> | haha |
| 01:50:20 | <geekosaur> | I do much the same thing although I'm not adding workspaces, I use submaps for related actions (BSP operations, my window debugging functions, things like that) |
| 01:50:51 | <geekosaur> | also I use additionalKeysP so it's just a prefix rather than a separate manual submap definition |
| 01:52:06 | <beastwick> | hmmm, how to pass to M.fromList, just M.fromList ++ zip (zip (repeat (0)) [xK_1..xK_9]) (map (withWorkspaceIndex W.greedyView) [1..]) ? something like that? |
| 01:52:22 | <geekosaur> | no, you don't need the ++ |
| 01:52:42 | <geekosaur> | M.fromList $ zip … |
| 01:53:20 | <beastwick> | this is where my haskell falls apart :( M.fromList $ zip (zip (repeat (modm)) [xK_1..xK_9]) (map (withWorkspaceIndex W.greedyView) [1..]) zip (zip (repeat (modm .|. controlMask)) [xK_1..xK_9]) (map (setWorkspaceIndex) [1..]) ? |
| 01:53:34 | <beastwick> | well modm becomes 0 |
| 01:54:07 | <geekosaur> | and you want the second ++ to combine the two zips |
| 01:54:15 | <beastwick> | okay, that makes sense |
| 01:54:19 | <beastwick> | cool, gonna try |
| 01:54:22 | <beastwick> | excited! |
| 01:54:35 | <geekosaur> | what you don't want is the first one because you are not concatenating with fromList, you are passing the (combined) list to it |
| 01:55:16 | <geekosaur> | you may need some parens to limit what the $ applies to also, but I think the one you need around the top level keybind is enough |
| 01:58:09 | <beastwick> | well it compiled without error, bbs testing |
| 02:01:58 | <beastwick> | geekosaur you're the best |
| 02:06:05 | <beastwick> | much thanks again |
| 03:31:57 | × | td_ quits (~td@i53870914.versanet.de) (Ping timeout: 252 seconds) |
| 03:33:54 | → | td_ joins (~td@i5387092B.versanet.de) |
| 03:42:18 | × | terrorjack4 quits (~terrorjac@2a01:4f8:c17:dc9f::) (Quit: The Lounge - https://thelounge.chat) |
| 03:45:16 | → | terrorjack4 joins (~terrorjac@2a01:4f8:c17:dc9f::) |
| 04:40:31 | → | piele joins (~piele@tbonesteak.creativeserver.net) |
| 05:31:20 | × | zawaken quits (~zawaken@user/zawaken) (Ping timeout: 244 seconds) |
| 05:35:15 | → | zawaken joins (~zawaken@user/zawaken) |
| 08:15:07 | × | haskellbridge quits (~hackager@syn-024-093-192-219.res.spectrum.com) (Ping timeout: 264 seconds) |
| 08:15:42 | → | haskellbridge joins (~hackager@syn-024-093-192-219.res.spectrum.com) |
| 08:27:45 | → | alp joins (~alp@2001:861:e3d6:8f80:a99a:73f2:3cc3:6a6c) |
| 08:54:43 | → | Guest66 joins (~Guest66@130.225.10.121) |
| 08:55:03 | × | Guest66 quits (~Guest66@130.225.10.121) (Client Quit) |
| 09:03:49 | × | ft quits (~ft@p4fc2a216.dip0.t-ipconnect.de) (Quit: leaving) |
| 11:43:06 | todi_away | is now known as todi |
| 12:57:23 | × | L29Ah quits (~L29Ah@wikipedia/L29Ah) (Read error: Connection reset by peer) |
| 12:57:58 | → | L29Ah joins (~L29Ah@wikipedia/L29Ah) |
| 14:33:27 | × | alp quits (~alp@2001:861:e3d6:8f80:a99a:73f2:3cc3:6a6c) (Ping timeout: 246 seconds) |
| 17:51:12 | → | alp joins (~alp@2001:861:e3d6:8f80:46dd:be45:db8:fbc7) |
| 18:09:49 | → | ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) |
| 19:11:07 | × | ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Quit: ash3en) |
| 19:39:26 | → | ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) |
| 20:07:29 | → | ft joins (~ft@p4fc2a216.dip0.t-ipconnect.de) |
| 20:29:20 | × | ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Quit: ash3en) |
All times are in UTC on 2024-11-12.