2024/11/12

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