2025/10/11

2025-10-11 00:51:06 +0200 <haskellbridge> <iqubic (she/her)> Is there a way I can insert debug statements into my XMonad file (something like the functions for Debug.Trace)? I have a custom log hook that I've made that is giving out the wrong output!
2025-10-11 00:53:08 +0200 <geekosaur> https://hackage.haskell.org/package/xmonad-0.18.0/docs/XMonad-Core.html#v:trace
2025-10-11 00:54:00 +0200 <haskellbridge> <iqubic (she/her)> Is X an instance of MonadIO?
2025-10-11 00:54:09 +0200 <haskellbridge> <iqubic (she/her)> The X Monad I mean.
2025-10-11 00:54:38 +0200 <haskellbridge> <iqubic (she/her)> Ah, good! It is!
2025-10-11 00:54:59 +0200 <geekosaur> yes, and `io` (https://hackage.haskell.org/package/xmonad-0.18.0/docs/XMonad-Core.html#v:io) is an alias for `liftIO`
2025-10-11 00:56:20 +0200 <haskellbridge> <iqubic (she/her)> My custom log hook function is of type "ScreenId -> X String" so I can easily add in some "trace" calls.
2025-10-11 04:10:45 +0200L29Ah(~L29Ah@wikipedia/L29Ah) (Read error: Connection timed out)
2025-10-11 04:13:43 +0200 <haskellbridge> <iqubic (she/her)> If I have a Window, is there a way to get its name as a String?
2025-10-11 04:16:26 +0200 <haskellbridge> <iqubic (she/her)> Specifically, I got this Window data by starting with a XMonad.StackSet.Stack and extracting the focus.
2025-10-11 04:16:49 +0200 <haskellbridge> <iqubic (she/her)> Basically, I want to get the X11 name of the window.
2025-10-11 04:19:35 +0200 <geekosaur> withDisplay (\d -> io $ fetchName d w) -- assuming "w" is the window id
2025-10-11 04:20:12 +0200 <geekosaur> which is the lazy way and only gets you the simplified name; these days people tend to expect the UTF8_STRING name, which takes more work
2025-10-11 04:22:59 +0200 <haskellbridge> <iqubic (she/her)> I see that contrib has XMonad.Util.NamedWindows, which provides "getName :: Window -> X NamedWindow" and "getNameWMClass :: Window -> X NamedWindow"
2025-10-11 04:23:06 +0200 <geekosaur> also you probably need to import Graphics.X11.Xlib.Extras to get fetchName
2025-10-11 04:23:06 +0200 <haskellbridge> <iqubic (she/her)> https://hackage.haskell.org/package/xmonad-contrib-0.18.1/docs/XMonad-Util-NamedWindows.html#t:Nam…
2025-10-11 04:24:16 +0200 <haskellbridge> <iqubic (she/her)> Or I think I can just use that module, because it looks like someone else has already done the work. But I'm unsure of the difference between "getName" and "getNameWMClass"
2025-10-11 04:24:22 +0200 <geekosaur> hm, right, I keep forgetting it actually uses the proper window namew
2025-10-11 04:24:41 +0200 <haskellbridge> <iqubic (she/her)> Keep forgetting what does?
2025-10-11 04:25:48 +0200 <geekosaur> I keep forgetting that NamedWindow isn't an internal-to-xmonad name, it's actually the window title (or class if you use getNameWMClass, which you usually won't want to do since it's not very useful these days)
2025-10-11 04:26:38 +0200 <haskellbridge> <iqubic (she/her)> Oh? How does the normal log hook work? How doos that get the name of the window, to feed to the PP?
2025-10-11 04:28:07 +0200 <haskellbridge> <iqubic (she/her)> The standard PP has a "ppTitle :: String -> String" field, but I'm unsure of how the input string is gotten
2025-10-11 04:28:21 +0200 <geekosaur> that's part of dynamicLog
2025-10-11 04:29:19 +0200 <haskellbridge> <iqubic (she/her)> Looks like that's just using "getName"
2025-10-11 04:29:29 +0200 <geekosaur> sorry, these days it's XMonad.Hooks.StatusBar
2025-10-11 04:29:42 +0200 <haskellbridge> <iqubic (she/her)> https://hackage.haskell.org/package/xmonad-contrib-0.18.1/docs/src/XMonad.Hooks.StatusBar.PP.html#…
2025-10-11 04:31:24 +0200 <geekosaur> right
2025-10-11 04:33:08 +0200 <haskellbridge> <iqubic (she/her)> Unless I'm missing something, XMonad.Hooks.StatusBar uses the "getName" from X.U.NamedWindow
2025-10-11 04:35:41 +0200 <haskellbridge> <iqubic (she/her)> Yeah, checking with xprop tells me that the default logger is just querying "_NET_WM_NAME" which is just what "getName" does.
2025-10-11 04:38:55 +0200td_(~td@i5387093C.versanet.de) (Ping timeout: 240 seconds)
2025-10-11 04:40:54 +0200td_(~td@i53870926.versanet.de) td_
2025-10-11 04:45:48 +0200terrorjack(~terrorjac@2a01:4f8:c17:9d11::) terrorjack
2025-10-11 07:59:06 +0200Solid(~slot@xmonad/slotThe) slot
2025-10-11 09:27:14 +0200Solid`(~slot@2001:9e8:e1b4:6a00:9e90:4010:d016:86ca)
2025-10-11 09:28:51 +0200Solid(~slot@xmonad/slotThe) (Ping timeout: 252 seconds)
2025-10-11 09:56:55 +0200Solid`(~slot@2001:9e8:e1b4:6a00:9e90:4010:d016:86ca) (Ping timeout: 265 seconds)
2025-10-11 10:32:23 +0200Solid(~slot@xmonad/slotThe) slot
2025-10-11 10:38:12 +0200ximon(~ximon@user/ximon) ximon
2025-10-11 10:48:25 +0200ximon(~ximon@user/ximon) (Ping timeout: 250 seconds)
2025-10-11 12:51:01 +0200Solid`(~slot@2001:9e8:e1b4:a300:352d:8fbe:6282:2b2b)
2025-10-11 12:52:51 +0200Solid(~slot@xmonad/slotThe) (Ping timeout: 265 seconds)
2025-10-11 12:53:02 +0200Solid`(~slot@2001:9e8:e1b4:a300:352d:8fbe:6282:2b2b) (Client Quit)
2025-10-11 16:10:07 +0200MrElendig(~Urist@archlinux/op/MrElendig) (Quit: telefrag)
2025-10-11 16:11:31 +0200MrElendig(~Urist@archlinux/op/MrElendig) MrElendig
2025-10-11 18:04:44 +0200ximon(~ximon@user/ximon) ximon
2025-10-11 18:16:03 +0200ximon(~ximon@user/ximon) (Ping timeout: 250 seconds)
2025-10-11 18:20:16 +0200ximon(~ximon@user/ximon) ximon
2025-10-11 18:28:28 +0200ximon(~ximon@user/ximon) (Quit: Client closed)
2025-10-11 20:35:18 +0200L29Ah(~L29Ah@wikipedia/L29Ah) L29Ah
2025-10-11 22:44:41 +0200Enrico63(~Enrico63@2a0b:e541:10d0:0:9efc:e8ff:fe24:3213) Enrico63
2025-10-11 22:53:00 +0200 <Enrico63> Hi there. In my xmonad configuration I have mappings like these
2025-10-11 22:53:01 +0200 <Enrico63> ```
2025-10-11 22:53:01 +0200 <Enrico63> : ("<XF86AudioRaiseVolume>", spawn "amixer -q -D pulse set Master 1%+ unmute")
2025-10-11 22:53:02 +0200 <Enrico63> : ("<XF86AudioLowerVolume>", spawn "amixer -q -D pulse set Master 1%- unmute")
2025-10-11 22:53:02 +0200 <Enrico63> ```
2025-10-11 22:53:03 +0200 <Enrico63> and I kinda remember that in the past I've used some program, possibly xev to work out what `XF86<whatever>` corresponded to a key. I'd start the program, press the key, and in the terminal I'd see some output in which I could recognize the XF86* name corresponding to the key I had pressed. Currently, that's not the case, in the sense that I don't
2025-10-11 22:53:03 +0200 <Enrico63> see the string XF86 in the output.
2025-10-11 22:54:22 +0200 <Enrico63> According to https://wiki.archlinux.org/title/Keyboard_input#Identifying_keycodes_in_Xorg, `xev` seem to be the way. However, I also read that "If you press a key and nothing appears in the terminal, it means that...".
2025-10-11 22:58:26 +0200 <Enrico63> Now, as far as scancodes are concerned, the key I'm pressing (actually a combo, namely Fn + F5) does have a scancode, because I can show it via `showkeys --scancodes`, which prints 0x67 0xe7 if I press that combo. Likewise, I can do `showkeys --keycodes`, which prints `keycode 144 press\nkeycode 144 release` for that combo.
2025-10-11 22:59:11 +0200 <Enrico63> So it must be that "some other process is capturing the keypress"? In that case, I haven't maneged to run `xinit /usr/bin/xterm -- :1` in a VT :/
2025-10-11 22:59:13 +0200 <Enrico63> Any help^
2025-10-11 22:59:15 +0200 <Enrico63> ?
2025-10-11 23:10:07 +0200 <haskellbridge> <geekosaur (@geekosaur:matrix.org)> If xev shows it, it shouldn't be grabbed by anything else
2025-10-11 23:11:15 +0200 <haskellbridge> <geekosaur (@geekosaur:matrix.org)> But it sounds like it may not be being handled properly, if it's sending two events/scancodes
2025-10-11 23:21:37 +0200 <Enrico63> Mmmm what else can I do to troubleshoot?
2025-10-11 23:23:36 +0200 <haskellbridge> <geekosaur (@geekosaur:matrix.org)> First off I would try to figure out what's wrong with the Fn key, since it's being sent separately
2025-10-11 23:24:18 +0200 <haskellbridge> <geekosaur (@geekosaur:matrix.org)> (it's the 0x67 code)
2025-10-11 23:49:44 +0200 <geekosaur> usually something (ACPI in older machines, EFI BIOS in newer ones) intercepts Fn+key and either handles it itself or passes on a synthetic key; the X server would then produce e.g. XF86AudioRaiseVolume. (this is what happens on both my current and old laptops)
2025-10-11 23:51:04 +0200 <geekosaur> very old machines may require a kerbewl module to do this, but I think most of those kernel modules were removed from Linux some years ago
2025-10-11 23:51:08 +0200 <geekosaur> *kernel