Home liberachat/#xmonad: Logs Calendar

Logs on 2022-02-06 (liberachat/#xmonad)

00:11:18 <peterstorm[m]> BadDrawable (invalid PixMap) errors, what do those mean? Just started getting them after the nvidia driver got updates on nixos
00:13:22 <geekosaur> o.O
00:16:58 <geekosaur> it means something's drawing to an offscreen window or "bitmap" which doesn't exist or is misconfigured
00:17:53 <peterstorm[m]> Interesting πŸ˜…
00:17:57 <geekosaur> since X11 hands such drawing off to the video driver, it would make some sense that an nvidia update could cause that. guess you need to roll it back and maybe pin it
00:18:35 <peterstorm[m]> Yeah, cheers, I’ll see to that :)
00:28:43 Γ— seschwar quits (~seschwar@user/seschwar) (Quit: :wq)
01:01:51 Γ— jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 256 seconds)
01:03:57 β†’ jao joins (~jao@68.235.43.173)
01:10:08 <peterstorm[m]> Ah, recompiling xmonad worked, should have thought of that, saw it mentioned in an old thread
01:13:46 Γ— catman quits (~catman@user/catman) (Read error: Connection reset by peer)
01:15:13 <jakeStateless-Fa> <geekosaur> "I think there's something that..." <- OK, so keeping an int in state, to decrement and watch for the sendMessage modifications is probably the best route here.
01:15:57 <jakeStateless-Fa> I've hardly touched the internals of state management, so is there a module that does something like this for me to go and copy?
01:15:58 <geekosaur> do you actually require a refresh to happen with those messages? (I'm still quite confused as to what you're trying to do there.)
01:16:08 <jakeStateless-Fa> /replicate
01:16:13 <geekosaur> if you don't, you could just use sendMessageWithNoRefresh
01:16:53 <geekosaur> https://github.com/xmonad/xmonad-contrib/blob/master/XMonad/Util/ExtensibleState.hs
01:17:47 <jakeStateless-Fa> keybind -> toggles tag "FS"
01:17:47 <jakeStateless-Fa> magnifier modifier -> zooms any focused "FS" window in
01:17:47 <jakeStateless-Fa> logHook -> handles adding/removing struts, spacing, and borders
01:19:48 <geekosaur> ok, you actually need it to refresh there. so you need to store state including (a) the focused window (b) whether you activated your changes or not
01:20:20 <geekosaur> if the focused window changes then you need to undo them (then potentially redo them on the new focused window if it has the FS tag)
01:20:56 <geekosaur> it's still going to flicker, but only once
01:21:47 <geekosaur> hm, actually twice because the smart-spacing stuff will also do a refresh
01:22:42 <geekosaur> so you might do the strut with no refresh and let the spacing one refresh for both
01:23:52 <geekosaur> data FSState = FSS (Window, Bool); instance ExtensibleState FSState where ...
01:24:08 <jakeStateless-Fa> Isn't that what `<+>` will do? Use only one refresh?
01:24:27 <geekosaur> technically it should be a Maybe Window with the initial state Nothing, but you can use window id 0 instead
01:24:41 <geekosaur> no, <+> has nothing to do with how many refreshes happen
01:25:28 <geekosaur> in the logHook <+> is equivalent to >>
01:25:35 <geekosaur> (or *> if you prefer)
01:26:00 <jakeStateless-Fa> huh, good to know
01:26:19 <jakeStateless-Fa> Outside of the logHook though, using `<+>` will speed things up, right?
01:26:26 <geekosaur> sendMessage always does a refresh, you are sending one message directly and the smartspacing stuff sends another message
01:26:32 <geekosaur> no
01:26:58 <geekosaur> manageHooks may make you think that way but that's not really what's going on in them
01:27:26 <geekosaur> *nothing* in a manageHook does a refresh, the manageHook is fed to X.O.windows which does a refresh after processing it
01:28:28 <geekosaur> (after running the manageHook on any new windows that have been created, removing any windows that have been deleted, moving any windows that have been moved/resized, etc.)
01:29:40 <jakeStateless-Fa> Liskin told me a while back (perhaps I merely remember incorrectly) that I should be using `<+>` when calling things from a keybind, as it has some (speed?) advantages over `>>` in that scenario
01:30:17 <geekosaur> <+> is basically "use the linker that makes the most sense for the current context". for a manageHook that is <>, for a monadic context it's >>, it's several other things in other contexts. (in fact they're all monoids so it's all <>)
01:31:04 <jakeStateless-Fa> I see..
01:32:02 <geekosaur> I can't seeit being much faster unless <> is actually *> instead of >> and even then it should be minimal. <+> is more about convenience, I'd say
01:32:21 <geekosaur> (liskin, any comments if you're around?)
01:39:46 <jakeStateless-Fa> I mean, I definitely don't want to (plus, I probably can't) be sending messages from within the layout itself, right?
01:44:59 <geekosaur> right
01:45:10 <geekosaur> you can't send messages but you can relay one you've received
01:45:20 <geekosaur> (to sublayouts)
01:45:53 <geekosaur> and you do *not* want to refresh inside a layout
01:46:40 <geekosaur> actually I'm not sure sending a message is even meaningful inside a layout because you'd just receive it back
01:47:09 <geekosaur> aside from relaying to a sublayout as I mentioned
01:49:20 <geekosaur> hm, well in this case it'd be intercepted by avoidStruts I guess. but you still can't do that because it'd alter the screen rectangle you received. so yes, Bad Idea
02:11:28 <liskin> I don't remember telling anyone to use <+>
02:12:21 Γ— steve__ quits (~steve@ool-182c2b80.dyn.optonline.net) (Ping timeout: 256 seconds)
02:27:28 Γ— jao quits (~jao@68.235.43.173) (Remote host closed the connection)
02:38:11 Γ— noex quits (~null@user/noex) (Ping timeout: 256 seconds)
02:42:41 β†’ noex joins (~null@user/noex)
03:04:15 Γ— banc quits (banc@gateway/vpn/airvpn/banc) (Ping timeout: 256 seconds)
03:22:31 β†’ banc joins (banc@gateway/vpn/airvpn/banc)
03:22:57 Γ— noex quits (~null@user/noex) (Ping timeout: 256 seconds)
03:23:31 β†’ noex joins (~null@user/noex)
03:35:09 Γ— geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
03:35:10 β†’ allbery_b joins (~geekosaur@xmonad/geekosaur)
03:35:13 allbery_b is now known as geekosaur
03:37:34 β†’ jao joins (~jao@68.235.43.173)
03:39:37 Γ— td_ quits (~td@muedsl-82-207-238-241.citykom.de) (Ping timeout: 256 seconds)
03:41:33 β†’ td_ joins (~td@muedsl-82-207-238-099.citykom.de)
04:04:55 <jakeStateless-Fa> How does one obtain a relevant `WindowSpace`?
04:12:38 <jakeStateless-Fa> Well, I opted for `broadcastMessage`, not sure if that's the right way to go about it 🀷
04:13:33 <jakeStateless-Fa> this' my alt:
04:14:21 β†’ galactic_starfis joins (~galactics@2001:470:69fc:105::1:2985)
04:14:21 <galactic_starfis> I got the fullscreen hook working!
04:18:26 <galactic_starfis> Is there a way to modify window decorations via messages? Or some other way after the fact, allowing me to hide tabs when in fullscreen?
04:50:59 <galactic_starfis> ^ I found setTheme
05:13:41 Γ— jao quits (~jao@68.235.43.173) (Ping timeout: 256 seconds)
05:36:29 Γ— thunderrd quits (~thunderrd@183.182.111.73) (Quit: If it wasn't written down it didn't happen...)
06:30:35 β†’ thunderrd joins (~thunderrd@183.182.114.80)
06:49:19 Γ— geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
06:49:43 β†’ geekosaur joins (~geekosaur@xmonad/geekosaur)
08:53:53 <Solid> I always chuckle when thinking about how <> = >> for hooks is due to the trivial monoid instance for ()
08:54:34 <Solid> s/monoid/semigroup/ I suppose
09:14:14 Γ— jludwig quits (~justin@user/jludwig) (Read error: Connection reset by peer)
09:14:32 β†’ jludwig joins (~justin@user/jludwig)
09:17:30 Γ— jludwig quits (~justin@user/jludwig) (Client Quit)
09:31:50 Γ— thunderrd quits (~thunderrd@183.182.114.80) (Remote host closed the connection)
09:32:53 β†’ thunderrd joins (~thunderrd@183.182.114.80)
09:35:36 β†’ mc47 joins (~mc47@xmonad/TheMC47)
09:53:28 β†’ jludwig joins (~justin@user/jludwig)
10:08:01 Γ— thunderrd quits (~thunderrd@183.182.114.80) (Remote host closed the connection)
10:08:58 β†’ thunderrd joins (~thunderrd@183.182.114.80)
10:46:34 Γ— thunderrd quits (~thunderrd@183.182.114.80) (Quit: If it wasn't written down it didn't happen...)
10:50:24 β†’ seschwar joins (~seschwar@user/seschwar)
10:52:15 <galactic_starfis> I've almost completely decked out a fullscreening procedure. All I need is to setup `Messages` (so that ewmh doesn't need an extra argument), figure out a good way to handle refloating windows, and figure out a decent way to pull whatever decoration `Theme` the user is using out of their layout.
10:52:51 <geekosaur> "all"
10:53:32 <geekosaur> you can modify a theme via messages but you can't extract it
10:54:05 <geekosaur> (and messages areone-way so you can't add a message that tells you the Theme)
10:56:19 <geekosaur> and you can't introspect a Layout to find a Theme hidden within
10:58:46 <galactic_starfis> An alternate variant of this could use fullFloat instead of magnifier, if the user wanted to draw atop any floating windows too.
10:58:58 <galactic_starfis> That'd need a bit more fancywork, but it could be done
10:59:24 <geekosaur> it would probably be more reliable
10:59:36 <galactic_starfis> It's sort of that way already, but it's missing the easy navigation piece, which's the whole reason I'm doing this.
11:00:12 <galactic_starfis> Could I make that module store it in extensible state?
11:01:06 <geekosaur> probably yes. the question is what you do if it's not there (i.e. layout isn't Tabbed)
11:01:14 <galactic_starfis> mmh, that's inconvenient
11:01:45 <galactic_starfis> I had to pass in the theme in many places, the only place that I'm not bothering with is the `ewmh` module - that thing's complex
11:02:02 <geekosaur> if I had to do fullscreen via a layout, I'd probably match up the passed rectangle against the screen rectangles (ScreenDetail) and use that instead of trying to hide the struts separately
11:02:09 <galactic_starfis> ugh, if I could just fetch the theme, it'd be so much simpler
11:02:13 <geekosaur> which is more or less what fullfloat does
11:02:38 <geekosaur> that'd also hide tabs
11:02:38 <galactic_starfis> hm, though, perhaps I could have the user store the theme in extensible state upon initialization πŸ€”
11:02:56 <galactic_starfis> so long as they're only using 1 theme, that should work
11:06:39 <galactic_starfis> everything works, the theme is the only annoying thing at the moment
11:07:54 <galactic_starfis> but perhaps that'd work better, unsure of how I'd do that from within this context, as I thought any layout after struts/decos didn't have the ability to grow the rectangle past that
11:09:05 <geekosaur> it has the ability, it's just not recommended.
11:10:00 <geekosaur> your biggest problem becomes making sure the stuff under the rectangle remains under it, but there are ways around that too
11:14:17 <galactic_starfis> Can I do `do x <- XS.get Something`? I'm trying it right now, it's not working... Is `>>=` strictly necessary in this context?
11:15:26 <Solid> XS.get doesn't take an argument
11:15:41 <Solid> it learns about what it needs to get purely by its type
11:16:46 <galactic_starfis> ah
11:17:33 <galactic_starfis> More directly: is there a way to do `do x <- someState`?
11:18:11 Γ— mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection)
11:18:32 <Solid> sure, you just need to tell get which type to get; `do x <- XS.get @MyType` or (if it's not abstract) `do (MyType content) <- XS.get`
11:26:02 β†’ thunderrd joins (~thunderrd@183.182.114.80)
11:31:25 <galactic_starfis> ah, thanks!
11:32:43 <geekosaur> the parentheses are optional there
11:33:32 <galactic_starfis> ^ now that is cool
11:33:45 <geekosaur> % do Just x <- listToMaybe [1]; show x
11:33:53 <galactic_starfis> now the ewmh module works with it too.
11:33:54 <geekosaur> rats, no yahb here
11:34:11 <geekosaur> > do Just x <- listToMaybe [1]; show x
11:34:13 <lambdabot> error:
11:34:13 <lambdabot> β€’ Couldn't match type β€˜[]’ with β€˜Maybe’
11:34:13 <lambdabot> Expected type: Maybe Char
11:34:33 <galactic_starfis> yeah, floating window retention and optional covering support are all that're left to do
11:34:44 <geekosaur> > do Just x <- listToMaybe [1]; Just (show x)
11:34:45 <lambdabot> error:
11:34:45 <lambdabot> β€’ No instance for (Num (Maybe ())) arising from the literal β€˜1’
11:34:45 <lambdabot> β€’ In the expression: 1
11:35:08 <geekosaur> really need an IO instance rather than trying to hack it…
11:35:11 <galactic_starfis> It's not the cleanest implementation, as that rectangle based one you highlighted is probably better... But it works!
11:35:47 <galactic_starfis> Just switched my entire config over to using it. So much better than the fullFloat that ewmh is using
11:36:35 <galactic_starfis> I created really awkward stack modification functions a while ago, just to attempt to overcome this problem... Definitely not the way to go.
11:37:39 <galactic_starfis> (they didn't really work well)
11:37:41 β†’ steve__ joins (~steve@ool-182c2b80.dyn.optonline.net)
11:40:25 <galactic_starfis> Anything glaring that I should be doing differently?: https://gitlab.com/mikenrafter/config/-/tree/master/.xmonad/lib/Custom (see Fullscreen.hs, Magnfier.hs, and EwmhDesktops.hs)
12:44:24 Γ— thunderrd quits (~thunderrd@183.182.114.80) (Quit: If it wasn't written down it didn't happen...)
12:44:55 β†’ thunderrd joins (~thunderrd@183.182.114.80)
12:46:52 Γ— thunderrd quits (~thunderrd@183.182.114.80) (Client Quit)
12:47:16 β†’ thunderrd joins (~thunderrd@183.182.114.80)
14:05:08 Γ— thunderrd quits (~thunderrd@183.182.114.80) (Remote host closed the connection)
14:06:26 β†’ thunderrd joins (~thunderrd@183.182.114.80)
14:10:12 Γ— thunderrd quits (~thunderrd@183.182.114.80) (Remote host closed the connection)
14:14:44 Γ— Buliarous quits (~gypsydang@46.232.210.139) (Ping timeout: 268 seconds)
14:31:26 Γ— geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
14:31:26 β†’ allbery_b joins (~geekosaur@xmonad/geekosaur)
14:31:29 allbery_b is now known as geekosaur
14:43:08 β†’ thunderrd joins (~thunderrd@183.182.114.80)
14:46:17 Γ— mvk quits (~mvk@2607:fea8:5cdc:bf00::80f1) (Ping timeout: 240 seconds)
14:53:56 Γ— thunderrd quits (~thunderrd@183.182.114.80) (Remote host closed the connection)
14:54:52 β†’ thunderrd joins (~thunderrd@183.182.114.80)
15:34:00 β†’ catman joins (~catman@user/catman)
15:46:36 β†’ mvk joins (~mvk@2607:fea8:5cdc:bf00::80f1)
15:53:24 β†’ jao joins (~jao@static-68-235-44-10.cust.tzulo.com)
17:06:53 Γ— thunderrd quits (~thunderrd@183.182.114.80) (Remote host closed the connection)
17:07:55 β†’ thunderrd joins (~thunderrd@183.182.114.80)
17:28:44 Γ— thunderrd quits (~thunderrd@183.182.114.80) (Remote host closed the connection)
17:29:55 β†’ thunderrd joins (~thunderrd@183.182.114.80)
18:12:03 β†’ mc47 joins (~mc47@xmonad/TheMC47)
18:54:43 Γ— mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection)
19:43:19 Γ— geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
19:45:10 β†’ geekosaur joins (~geekosaur@xmonad/geekosaur)
20:41:59 <galactic_starfis> I'm trying to add fullscreen support via managehook as well, this' what I've tried, and it's not worked. Pointers? `isFullscreen -?> (\x -> doF $ addFS x )`
20:42:17 <galactic_starfis> oh, sorry, whereas addFS is of type `Window -> X ()`
20:43:07 <geekosaur> ask >>= doF . addFS
20:44:26 <geekosaur> mm, actually, not sure you need doF if you do that.*pokes*
20:45:16 <geekosaur> whoops, going to take a bit, ghci is rebuilding the world :/
20:46:10 <galactic_starfis> with doF: `Expected type: Window -> s0 -> s0 Actual type: Window -> X ()`
20:46:31 <galactic_starfis> without doF: `Expected type: Query () Actual type: X ()`
20:47:04 <geekosaur> ask >>= liftX . addFS, then
20:48:50 <galactic_starfis> `β€’ Couldn't match expected type β€˜X a0’ with actual type β€˜Window -> X ()’`
20:49:49 <galactic_starfis> oh wait, no that's when using `$` instead of `.`, it gives this when using `.`: `Expected type: Query (Maybe (Endo WindowSet)) Actual type: Query (Maybe ())`
20:51:01 <geekosaur> ask >>= \x -> liftX (?addFS x) >> idHook
20:51:01 <geekosaur> :: (?addFS::Window -> X a, Monoid b) => Query b
20:51:13 <geekosaur> hardfor me to test since I don't have addFS locally
20:51:53 <galactic_starfis> it's present here: https://gitlab.com/mikenrafter/config/-/blob/master/.xmonad/lib/Custom/Fullscreen.hs#L60
20:52:13 <geekosaur> isFullscreen -?> ask >>= \x -> liftX (?addFS x) >> idHook
20:52:13 <geekosaur> :: (?addFS::Window -> X a1, Monoid a2) => Query (Maybe a2)
20:54:30 <geekosaur> def {manageHook = composeOne [isFullscreen -?> ask >>= \x -> liftX (?addFS x) >> idHook]}
20:54:30 <geekosaur> :: (?addFS::Window -> X a) =>
20:54:30 <geekosaur> XConfig (Choose Tall (Choose (Mirror Tall) Full))
20:54:43 <geekosaur> that looks like it ought work
20:56:10 β†’ Hash joins (~Hash@hashsecurity.org)
21:00:28 β†’ Marmota joins (~Marmota@2804:7f6:8086:31dc:d3da:cd9f:2c17:5ca6)
21:00:58 <galactic_starfis> boom, worked, thanks!
21:13:41 Γ— Marmota quits (~Marmota@2804:7f6:8086:31dc:d3da:cd9f:2c17:5ca6) (Quit: Client closed)
21:36:49 β†’ sheb joins (~sheb@31.223.228.71)
22:21:06 Γ— werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Remote host closed the connection)
22:37:15 β†’ werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
22:45:18 β†’ Guest54 joins (~Guest54@47.153.196.157)
22:46:27 <Guest54> Using xmobar I have a com module for playerctl to put title and artist, however when spotify isn't running it says "Could not execute command playerctl, is there anyway to hide this?
22:48:11 <galactic_starfis> Use a custom script (bash would work fine), save the output to a local variable, and grep for "Could not execute command playerctl", then if you find it, echo out "", otherwise echo out the saved output.
22:50:15 <geekosaur> that's assuming the "Could not execute" is from playerctl, which seems odd. more likely that's the plugin reporting on an error return from playerctl, hence a wrapper script `/usr/bin/playerctl ${1+"$@"} 2>/dev/null || echo`
22:51:10 <Guest54> would that be baked in the custom script, or within .xmobarrc
22:51:46 <geekosaur> in the custom script. .xmobarrc almost certainly doesn't give you controlover this
22:51:53 <liskin> note that playerctl also has --follow, which then doesn't need periodical refresh as it prints additional lines whenever something changes
22:51:55 <galactic_starfis> trying to put stuff like that in xmobarrc can be a real pain, probably best to use a custom script
22:52:49 <galactic_starfis> ---
22:52:49 <galactic_starfis> X.L.Magnifier only magnifies the focused window, meaning when you switch to a floating window, it stops magnifying whatever you were last on. Is there a simple remedy for this? I was thinking perhaps I could tag the focused tiled window, and untag it when it loses focus to another tiled window. And magnify that, only, I'm not sure how I'd get that from just a `Stack` object..
22:53:30 <liskin> (and I'm almost certain playerctl --follow doesn't terminate when the last player goes away, as I've had it running in the background for a year and a half)
22:57:37 β†’ Buliarous joins (~gypsydang@46.232.210.139)
23:01:25 <geekosaur> galactic_starfis, I still think you're doing this the hard way
23:14:11 <jao> Guest54, you could just use the Mpris2 module. `Mpris2 "spotify" [] 40`... or even `Mpris2 "playerctld", if you have playerctld installed too.
23:14:49 <Guest54> i really appreciate all the feeback, ill give it a try, right now i just have little script updating on a 20 interval in xmobar
23:28:12 Γ— seschwar quits (~seschwar@user/seschwar) (Quit: :wq)
23:54:49 Γ— geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
23:56:33 β†’ geekosaur joins (~geekosaur@xmonad/geekosaur)

All times are in UTC on 2022-02-06.