2024-11-12 02:00:54 +0100 | td_ | (~td@i5387091E.versanet.de) (Ping timeout: 260 seconds) |
2024-11-12 02:02:17 +0100 | td_ | (~td@i53870914.versanet.de) |
2024-11-12 02:37:37 +0100 | beastwick | (~brian@user/beastwick) beastwick |
2024-11-12 02:39:00 +0100 | <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. |
2024-11-12 02:39:25 +0100 | <beastwick> | basically want A-Z under a submap to dynamically assign hotkeys to the workspace. |
2024-11-12 02:41:09 +0100 | <geekosaur> | dynamically assigning keys isn't really a thing in xmonad |
2024-11-12 02:42:05 +0100 | <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 |
2024-11-12 02:43:57 +0100 | <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 $ [ ... |
2024-11-12 02:44:40 +0100 | <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 |
2024-11-12 02:44:51 +0100 | <geekosaur> | that can't be done without restarting xmonad |
2024-11-12 02:45:07 +0100 | <beastwick> | don't mind restarting, trying to add to my config |
2024-11-12 02:45:20 +0100 | <beastwick> | no not when I add a workspace |
2024-11-12 02:45:29 +0100 | <beastwick> | when xmonad loads, from the config |
2024-11-12 02:46:09 +0100 | <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. |
2024-11-12 02:46:13 +0100 | <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 |
2024-11-12 02:46:24 +0100 | <geekosaur> | xmonad really isn't designed for this use case |
2024-11-12 02:46:33 +0100 | <beastwick> | I think I am not explaning this well. |
2024-11-12 02:46:42 +0100 | <beastwick> | https://hackage.haskell.org/package/xmonad-contrib-0.13/docs/XMonad-Actions-DynamicWorkspaces.html… |
2024-11-12 02:46:54 +0100 | <beastwick> | has an example of setting up keys |
2024-11-12 02:47:25 +0100 | <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 |
2024-11-12 02:47:27 +0100 | <beastwick> | https://xmonad.github.io/xmonad-docs/xmonad-contrib/XMonad-Actions-Submap.html |
2024-11-12 02:48:20 +0100 | <beastwick> | basically under a submap I want my full keyboard of a-z so I can assign hotkeys to workspaces |
2024-11-12 02:48:30 +0100 | <beastwick> | I like using a-z for mnemonics |
2024-11-12 02:48:55 +0100 | <geekosaur> | submap takes the same parameters as keys, you don't need to change the code at all, just pass it to M.fromList |
2024-11-12 02:49:20 +0100 | <geekosaur> | I thought you wanted to create a new submap for each added workspace |
2024-11-12 02:49:31 +0100 | <beastwick> | no, although that sounds interesting |
2024-11-12 02:49:33 +0100 | <beastwick> | haha |
2024-11-12 02:50:20 +0100 | <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) |
2024-11-12 02:50:51 +0100 | <geekosaur> | also I use additionalKeysP so it's just a prefix rather than a separate manual submap definition |
2024-11-12 02:52:06 +0100 | <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? |
2024-11-12 02:52:22 +0100 | <geekosaur> | no, you don't need the ++ |
2024-11-12 02:52:42 +0100 | <geekosaur> | M.fromList $ zip … |
2024-11-12 02:53:20 +0100 | <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..]) ? |
2024-11-12 02:53:34 +0100 | <beastwick> | well modm becomes 0 |
2024-11-12 02:54:07 +0100 | <geekosaur> | and you want the second ++ to combine the two zips |
2024-11-12 02:54:15 +0100 | <beastwick> | okay, that makes sense |
2024-11-12 02:54:19 +0100 | <beastwick> | cool, gonna try |
2024-11-12 02:54:22 +0100 | <beastwick> | excited! |
2024-11-12 02:54:35 +0100 | <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 |
2024-11-12 02:55:16 +0100 | <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 |
2024-11-12 02:58:09 +0100 | <beastwick> | well it compiled without error, bbs testing |
2024-11-12 03:01:58 +0100 | <beastwick> | geekosaur you're the best |
2024-11-12 03:06:05 +0100 | <beastwick> | much thanks again |
2024-11-12 04:31:57 +0100 | td_ | (~td@i53870914.versanet.de) (Ping timeout: 252 seconds) |
2024-11-12 04:33:54 +0100 | td_ | (~td@i5387092B.versanet.de) td_ |
2024-11-12 04:42:18 +0100 | terrorjack4 | (~terrorjac@2a01:4f8:c17:dc9f::) (Quit: The Lounge - https://thelounge.chat) |
2024-11-12 04:45:16 +0100 | terrorjack4 | (~terrorjac@2a01:4f8:c17:dc9f::) terrorjack |
2024-11-12 05:40:31 +0100 | piele | (~piele@tbonesteak.creativeserver.net) piele |
2024-11-12 06:31:20 +0100 | zawaken | (~zawaken@user/zawaken) (Ping timeout: 244 seconds) |
2024-11-12 06:35:15 +0100 | zawaken | (~zawaken@user/zawaken) zawaken |
2024-11-12 09:15:07 +0100 | haskellbridge | (~hackager@syn-024-093-192-219.res.spectrum.com) (Ping timeout: 264 seconds) |
2024-11-12 09:15:42 +0100 | haskellbridge | (~hackager@syn-024-093-192-219.res.spectrum.com) hackager |
2024-11-12 09:27:45 +0100 | alp | (~alp@2001:861:e3d6:8f80:a99a:73f2:3cc3:6a6c) |
2024-11-12 09:54:43 +0100 | Guest66 | (~Guest66@130.225.10.121) |
2024-11-12 09:55:03 +0100 | Guest66 | (~Guest66@130.225.10.121) (Client Quit) |
2024-11-12 10:03:49 +0100 | ft | (~ft@p4fc2a216.dip0.t-ipconnect.de) (Quit: leaving) |
2024-11-12 12:43:06 +0100 | todi_away | todi |
2024-11-12 13:57:23 +0100 | L29Ah | (~L29Ah@wikipedia/L29Ah) (Read error: Connection reset by peer) |
2024-11-12 13:57:58 +0100 | L29Ah | (~L29Ah@wikipedia/L29Ah) L29Ah |
2024-11-12 15:33:27 +0100 | alp | (~alp@2001:861:e3d6:8f80:a99a:73f2:3cc3:6a6c) (Ping timeout: 246 seconds) |
2024-11-12 18:51:12 +0100 | alp | (~alp@2001:861:e3d6:8f80:46dd:be45:db8:fbc7) |
2024-11-12 19:09:49 +0100 | ash3en | (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) ash3en |
2024-11-12 20:11:07 +0100 | ash3en | (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Quit: ash3en) |
2024-11-12 20:39:26 +0100 | ash3en | (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) ash3en |
2024-11-12 21:07:29 +0100 | ft | (~ft@p4fc2a216.dip0.t-ipconnect.de) ft |
2024-11-12 21:29:20 +0100 | ash3en | (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Quit: ash3en) |