Logs: liberachat/#xmonad
| 2022-07-05 06:30:26 | → | wusticality joins (~wusticali@c-67-161-204-49.hsd1.co.comcast.net) |
| 2022-07-05 06:31:36 | <wusticality> | Hey folks, I'm using XMonad.Layout.IfMax which is working well, but I'm running into an issue where my border rules are not preserved, could someone possibly point me in the right direction? |
| 2022-07-05 06:35:20 | → | alternateved joins (~alternate@82.180.151.250) |
| 2022-07-05 06:44:52 | <Lears> | wusticality: I'm not sure what exactly you mean by border rules, but if it's a layout modifier then you probably want it applied to IfMax rather than its arguments. |
| 2022-07-05 06:45:22 | <Lears> | If that's not it, show us your config. |
| 2022-07-05 06:46:38 | <wusticality> | https://www.reddit.com/r/xmonad/comments/vrrnj9/issues_with_ifmax_and_noborders/ |
| 2022-07-05 06:46:45 | <wusticality> | I posted the specifics on reddit |
| 2022-07-05 06:47:48 | <wusticality> | Lears I have the fullscreen layout set to use noBorders which always works perfectly, until I utilized the IfMax rule |
| 2022-07-05 06:48:10 | <wusticality> | Using that causes fullscreen layouts to _sometimes_ have borders and sometimes not, perhaps it's a bug? |
| 2022-07-05 06:54:07 | <Lears> | It looks to me like it ought to work as you intend; I'm not sure what's happening. |
| 2022-07-05 06:54:20 | <wusticality> | Yeah, that was my thinking too, I'm afraid it may be a bug |
| 2022-07-05 06:54:37 | <wusticality> | I was looking through the source a bit but I'm not a regular Haskell programmer |
| 2022-07-05 06:56:25 | × | wusticality quits (~wusticali@c-67-161-204-49.hsd1.co.comcast.net) (Quit: Client closed) |
| 2022-07-05 06:56:35 | → | wusticality joins (~wusticali@c-67-161-204-49.hsd1.co.comcast.net) |
| 2022-07-05 06:58:17 | <Lears> | wusticality: The best guess I have is that regular fullscreen might be floating a window, thus exempting it from the layout. |
| 2022-07-05 06:58:31 | <Lears> | I don't use regular fullscreen so I'm not flush on the details, though. |
| 2022-07-05 07:00:11 | <wusticality> | Curiously, it works perfectly using my regular layout rules without IfMax |
| 2022-07-05 07:01:42 | <wusticality> | That is to say, having the `myFull` layout (which is just "noBorders Full") as well as tall and tall mirrored and cycling through them - no borders ever show up with that myFull layout - until, that is, I add the IfMax rule |
| 2022-07-05 07:02:19 | → | mc47 joins (~mc47@xmonad/TheMC47) |
| 2022-07-05 07:07:43 | → | dschrempf joins (~dominik@mobiledyn-62-240-134-178.mrsn.at) |
| 2022-07-05 07:17:04 | <Lears> | wusticality: Okay, I took a look at the X.L.NoBorders source, and I found the implementation is more stateful than I thought. The issue is most likely due to two copies of the modifier have out-of-sync state. |
| 2022-07-05 07:17:29 | <Lears> | In that case, your best bet should be to use smartBorders outside of IfMax. |
| 2022-07-05 07:25:50 | × | sogens quits (~sogens@gateway/vpn/pia/sogens) (Ping timeout: 240 seconds) |
| 2022-07-05 07:38:21 | <mc47> | So this a weird one: https://github.com/xmonad/xmonad-contrib/issues/8 |
| 2022-07-05 07:42:48 | <wusticality> | Lears Apologies, could you say more about what you mean? |
| 2022-07-05 07:43:15 | <wusticality> | And / or should I log a bug on github |
| 2022-07-05 07:46:29 | <Lears> | wusticality: You use noBorders Full in more than one part of your layout hook. But each one keeps its own private state about what borders are set, assuming it's the only one changing borders. This assumption isn't really a bad one; it can be argued whether this is a bug or not. I would say it's a documentation bug: the docs ought to tell you not to duplicate the modifier. |
| 2022-07-05 07:47:20 | <wusticality> | oh interesting, I see |
| 2022-07-05 07:47:24 | <Lears> | To prevent this, use Full instead, then apply smartBorders to the whole layout hook. |
| 2022-07-05 07:48:09 | <wusticality> | Sec, I'll try it quick now |
| 2022-07-05 07:50:14 | <wusticality> | That did the trick! (and makes sense) |
| 2022-07-05 07:50:29 | <wusticality> | I actually didn't notice smartBorders - not sure if I should log a bug or not |
| 2022-07-05 07:50:45 | <wusticality> | Does seem like it could cause other problems though |
| 2022-07-05 07:57:13 | <wusticality> | I've updated the reddit post, comments welcome RE filing a bug: https://www.reddit.com/r/xmonad/comments/vrrnj9/issues_with_ifmax_and_noborders/ |
| 2022-07-05 08:01:11 | × | wusticality quits (~wusticali@c-67-161-204-49.hsd1.co.comcast.net) (Quit: Client closed) |
| 2022-07-05 08:02:32 | → | cfricke joins (~cfricke@user/cfricke) |
| 2022-07-05 08:02:49 | → | chomwitt joins (~chomwitt@2a02:587:dc17:ef00:57f2:e4b7:eab5:9cc) |
| 2022-07-05 08:04:51 | × | thunderrd quits (~thunderrd@183.182.111.73) (Remote host closed the connection) |
| 2022-07-05 08:10:50 | × | dschrempf quits (~dominik@mobiledyn-62-240-134-178.mrsn.at) (Ping timeout: 244 seconds) |
| 2022-07-05 08:15:30 | × | dartleader quits (~dartleade@S0106a84e3f794823.wp.shawcable.net) (Ping timeout: 240 seconds) |
| 2022-07-05 08:17:49 | → | dartleader joins (~dartleade@S0106a84e3f794823.wp.shawcable.net) |
| 2022-07-05 09:00:09 | × | Etxeberrialex[m] quits (~etxeberri@2001:470:69fc:105::1:5ae6) (Quit: You have been kicked for being idle) |
| 2022-07-05 09:42:40 | → | dschrempf joins (~dominik@mobiledyn-62-240-134-178.mrsn.at) |
| 2022-07-05 10:12:06 | × | dschrempf quits (~dominik@mobiledyn-62-240-134-178.mrsn.at) (Quit: WeeChat 3.5) |
| 2022-07-05 11:07:01 | → | Guest9 joins (~Guest9@48.red-83-55-226.dynamicip.rima-tde.net) |
| 2022-07-05 11:10:44 | <Guest9> | Hi! I was wondering if anyone could help me solve an xmonad question I havent been able to find any answer to. Is there any way to get the number of windows in the current workspace? (preferably this would be done in a pure context by passing the WorkspaceId) I have tried many routes at attempting to solve this and I cant get it to work for the |
| 2022-07-05 11:10:44 | <Guest9> | life of me. Does anyone know this how I would be able to do this? |
| 2022-07-05 11:21:58 | <fizzie> | Pretty sure that's just fundamentally not possible outside the X monad, with just the WorkspaceId, because where would the data be coming from? In X, a very DIY way should be something like `withWindowSet (return . length . W.integrate' . W.stack . W.workspace . W.current)` but I'm almost certain there's a shorter way with some convenience functions too. |
| 2022-07-05 11:22:53 | <fizzie> | (Where W is XMonad.StackSet, as is common.) |
| 2022-07-05 11:25:01 | × | Guest9 quits (~Guest9@48.red-83-55-226.dynamicip.rima-tde.net) (Quit: Client closed) |
| 2022-07-05 11:25:40 | × | mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection) |
| 2022-07-05 11:27:02 | <Solid> | `withWindowSet (pure . length . W.index)` should probably work |
| 2022-07-05 11:27:14 | <Solid> | but yes for this to be pure you'd need at least a Workspace and not just a WorkspaceId |
| 2022-07-05 11:28:12 | <fizzie> | Right, `W.index` would've been the convenience function I was looking for, I just can never find them. |
| 2022-07-05 11:28:37 | <Solid> | we have too few of those, tbh |
| 2022-07-05 11:28:55 | <Solid> | but maybe we should look more towards adding lenses to the core anyways |
| 2022-07-05 11:31:10 | <fizzie> | Looks like the questant is gone, anyway. |
| 2022-07-05 11:32:16 | <Solid> | oh, right |
| 2022-07-05 11:32:51 | → | Guest9 joins (~Guest9@48.red-83-55-226.dynamicip.rima-tde.net) |
| 2022-07-05 11:33:15 | <Guest9> | sorry my firefox crashed |
| 2022-07-05 11:33:42 | <fizzie> | Guest9: In case you missed it (probably), I proposed `withWindowSet (return . length . W.integrate' . W.stack . W.workspace . W.current)` while Solid came up with a lot more neater `withWindowSet (pure . length . W.index)`. |
| 2022-07-05 11:34:04 | <fizzie> | (Both of these would have the type `X Int`.) |
| 2022-07-05 11:34:29 | <Guest9> | sorry, Im not very literate with haskell, I belive I wouldnt be able to use that in a pure context right? |
| 2022-07-05 11:35:07 | <Guest9> | myStatusBar = statusBarProp "xmobar" (pure xmobarPP { |
| 2022-07-05 11:35:07 | <Guest9> | ppCurrent = (\s -> |
| 2022-07-05 11:35:08 | <Guest9> | if getNumberOfWindowsInWorkpace s > 0 |
| 2022-07-05 11:35:08 | <Guest9> | then ((xmobarBorder "Top" "#bbbbbb" 4 . xmobarColor "#bbbbbb" "#005577") (" " ++ s ++ " ")) |
| 2022-07-05 11:35:09 | <Guest9> | else (xmobarColor "#bbbbbb" "#005577" (" " ++ s ++ " ")) |
| 2022-07-05 11:35:09 | <Guest9> | ) |
| 2022-07-05 11:35:10 | <Guest9> | , ppTitle = shorten 77 |
| 2022-07-05 11:35:10 | <Guest9> | , ppSep = " | " |
| 2022-07-05 11:35:11 | <Guest9> | , ppLayout = (\_ -> "") |
| 2022-07-05 11:35:11 | <Guest9> | , ppHidden = (\s -> xmobarBorder "Top" "#bbbbbb" 2 (" " ++ s ++ " ")) --probs better way to do this |
| 2022-07-05 11:35:12 | <Guest9> | , ppHiddenNoWindows = wrap " " " " |
| 2022-07-05 11:35:12 | <Guest9> | }) |
| 2022-07-05 11:35:15 | <MrElendig> | use a pastebin |
| 2022-07-05 11:35:29 | <Guest9> | sorry |
| 2022-07-05 11:35:30 | <Guest9> | https://pastebin.com/8QsHkQw8 |
| 2022-07-05 11:36:05 | <Guest9> | the thing i would like to achieve would be to create a getNumberOfWindowsInWorkpace function which could allow me to perform different logic when setting the text for the ppCurrent workspace depending on if its empty or not |
| 2022-07-05 11:36:14 | <Guest9> | i dont know if this would be the correct approach |
| 2022-07-05 11:39:40 | <fizzie> | I don't think it's fundamentally possible to have a pure function with the type `WorkspaceId -> Int` that gives you the window count, because how could it be? The number of windows isn't "in" the WorkspaceId. You'd need the WindowSet (or at least the part you're interested in) from somewhere. |
| 2022-07-05 11:40:01 | <fizzie> | But it should still be possible to do what you're actually wanting to do, just differently. |
| 2022-07-05 11:40:46 | <fizzie> | The `(pure xmobarPP { ... })` in your example is an X PP, after all. |
| 2022-07-05 11:41:08 | <Solid> | This is probably most easily be done by customising `ppPrinters` |
| 2022-07-05 11:41:46 | <Solid> | E.g., fallbackPrinters ( https://hackage.haskell.org/package/xmonad-contrib-0.17.0/docs/src/XMonad.Hooks.StatusBar.PP.html#fallbackPrinters ) shows you the default setup |
| 2022-07-05 11:42:33 | <Solid> | you just have to append something in the case of the current workspace there, which is nice because WS ( https://hackage.haskell.org/package/xmonad-contrib-0.17.0/docs/src/XMonad.Hooks.StatusBar.PP.html#WS ) contains e.g. the entire windowset |
| 2022-07-05 11:43:05 | Solid | doesn't have a whole lot of time right now, so can't offer step-by-step assistance, sadly |
| 2022-07-05 11:43:13 | <Guest9> | Thank you so much for the tips fizzie Solid, using the function you guys gave me I was able to implement the functionality I wanted (even if its not pure). I attach the updated code in case its useful for someone in the future (https://pastebin.com/PLqHuTDg). Thank you again, ill be sure to learn a bit more about haskell and monads:) |
| 2022-07-05 11:44:36 | <fizzie> | As a person not all that fluent in Haskell, that (changing the "returned" PP) is probably what I would have landed on if I had to muddle through it myself, even if it's not as neat as the ppPrinters approach. |
| 2022-07-05 12:14:51 | × | Guest9 quits (~Guest9@48.red-83-55-226.dynamicip.rima-tde.net) (Quit: Client closed) |
| 2022-07-05 12:17:22 | de-vri-es1 | is now known as de-vri-es |
| 2022-07-05 12:34:29 | → | dschrempf joins (~dominik@mobiledyn-62-240-134-178.mrsn.at) |
| 2022-07-05 12:50:35 | → | Melkor333[m] joins (~melkor333@2001:470:69fc:105::2:3ef7) |
| 2022-07-05 12:55:00 | × | banc quits (banc@gateway/vpn/airvpn/banc) (Ping timeout: 276 seconds) |
| 2022-07-05 13:00:58 | → | banc joins (banc@gateway/vpn/airvpn/banc) |
| 2022-07-05 13:03:23 | × | alternateved quits (~alternate@82.180.151.250) (Remote host closed the connection) |
| 2022-07-05 13:07:55 | → | alternateved joins (~alternate@82.180.151.250) |
| 2022-07-05 13:16:11 | × | banc quits (banc@gateway/vpn/airvpn/banc) (Ping timeout: 244 seconds) |
| 2022-07-05 13:18:00 | → | banc joins (banc@gateway/vpn/airvpn/banc) |
| 2022-07-05 13:25:55 | × | dschrempf quits (~dominik@mobiledyn-62-240-134-178.mrsn.at) (Quit: WeeChat 3.5) |
All times are in UTC.