Logs: liberachat/#xmonad
| 2022-04-10 04:15:05 | × | Czernobog quits (~Czernobog@user/czernobog) (Quit: ZNC 1.8.2 - https://znc.in) |
| 2022-04-10 04:16:50 | → | Czernobog joins (~Czernobog@user/czernobog) |
| 2022-04-10 04:28:40 | × | Czernobog quits (~Czernobog@user/czernobog) (Read error: Connection reset by peer) |
| 2022-04-10 04:35:41 | → | Czernobog joins (~Czernobog@user/czernobog) |
| 2022-04-10 04:39:24 | × | Czernobog quits (~Czernobog@user/czernobog) (Client Quit) |
| 2022-04-10 04:41:00 | → | Czernobog joins (~Czernobog@user/czernobog) |
| 2022-04-10 04:47:54 | × | Czernobog quits (~Czernobog@user/czernobog) (Read error: Connection reset by peer) |
| 2022-04-10 04:48:24 | → | Czernobog joins (~Czernobog@user/czernobog) |
| 2022-04-10 04:48:40 | × | Czernobog quits (~Czernobog@user/czernobog) (Remote host closed the connection) |
| 2022-04-10 04:50:28 | → | Czernobog joins (~Czernobog@user/czernobog) |
| 2022-04-10 04:59:31 | → | dschrempf joins (~dominik@2a01-036d-0118-ae84-6c6f-79fb-839d-0cde.pool6.digikabel.hu) |
| 2022-04-10 05:14:57 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b))) |
| 2022-04-10 05:14:59 | → | allbery_b joins (~geekosaur@xmonad/geekosaur) |
| 2022-04-10 05:15:02 | allbery_b | is now known as geekosaur |
| 2022-04-10 05:24:29 | × | dschrempf quits (~dominik@2a01-036d-0118-ae84-6c6f-79fb-839d-0cde.pool6.digikabel.hu) (Quit: WeeChat 3.4.1) |
| 2022-04-10 06:50:40 | × | Czernobog quits (~Czernobog@user/czernobog) (Quit: ZNC 1.8.2 - https://znc.in) |
| 2022-04-10 06:51:07 | <amenonsen> | hmm, maybe I can use XMonad.Actions.PerWorkspaceKeys to use XMonad.Util.ExtensibleState to mark/unmark a workspace for skipping. |
| 2022-04-10 06:52:23 | → | Czernobog joins (~Czernobog@user/czernobog) |
| 2022-04-10 06:58:48 | × | Czernobog quits (~Czernobog@user/czernobog) (Quit: ZNC 1.8.2 - https://znc.in) |
| 2022-04-10 07:00:30 | → | Czernobog joins (~Czernobog@user/czernobog) |
| 2022-04-10 09:05:44 | × | noex quits (~null@user/noex) (Remote host closed the connection) |
| 2022-04-10 09:06:13 | → | noex joins (~null@user/noex) |
| 2022-04-10 10:12:25 | <Ether[m]> | Is it possible to do tell xmonad to do a something when theree are 3 windows in particular layout? |
| 2022-04-10 10:12:33 | → | Nahra joins (~user@static.161.95.99.88.clients.your-server.de) |
| 2022-04-10 10:16:48 | <abastro[m]> | I think layouthook is capable of that |
| 2022-04-10 10:17:08 | <abastro[m]> | Forgot how to do tho |
| 2022-04-10 10:27:24 | <Ether[m]> | When something is unbound xmonad uses default bindings.. |
| 2022-04-10 10:27:34 | <Ether[m]> | How do i change this behavior 🤔? |
| 2022-04-10 10:28:43 | <Solid> | you can directly override the `keys` field of the XConfig record |
| 2022-04-10 10:38:45 | <amenonsen> | i think i've thoroughly broken my xmonad by trying to use Util.ExtensibleState to hide my work-space |
| 2022-04-10 10:43:48 | <fizzie> | Ether[m]: If you're using EZConfig for your key bindings, it's got an `removeKeys` and `removeKeysP` for removing bindings from the defaults. |
| 2022-04-10 10:45:38 | <fizzie> | (Assuming you want to keep most of the defaults and just drop some. If you don't want any defaults at all, then yeah, just set `keys` in the config directly.) |
| 2022-04-10 11:07:05 | × | benin quits (~benin@183.82.204.110) (Ping timeout: 248 seconds) |
| 2022-04-10 11:12:31 | <amenonsen> | hmm, the examples of ExtensibleState usage in xmonad-contrib are distinctly non-trivial |
| 2022-04-10 11:18:24 | <abastro[m]> | What is ExtensibleState? |
| 2022-04-10 11:19:23 | <amenonsen> | https://xmonad.github.io/xmonad-docs/xmonad-contrib/XMonad-Util-ExtensibleState.html |
| 2022-04-10 11:19:26 | <amenonsen> | "Module for storing custom mutable state in xmonad." |
| 2022-04-10 11:20:24 | <amenonsen> | i'm trying to store a list of WorkspaceIds to ignore with moveTo Next/Prev workspaces (with .Action.CycleWS) |
| 2022-04-10 11:56:47 | <geekosaur> | Ether[m], re 3 windows, take a look at XMonad.Layout.IfMax |
| 2022-04-10 11:57:07 | <geekosaur> | re bindings, you're seeing what is wrong with the kind of config you used instead of the one we recommend |
| 2022-04-10 12:06:48 | <fizzie> | amenonsen: The ExtensibleState module-level docs have kind of the minimal possible example, for storing an [Integer], which isn't really any different from storing a [WorkspaceId] (aka [String]). But it is inherently quite... Haskell-y, since it involves a type class. |
| 2022-04-10 12:10:00 | <fizzie> | You'd basically need that latter, five-line block, where you'd substitute `ListStorage` by some name descriptive of your thing (say, `IgnoredWorkspaces`) and `[Integer]` by `[WorkspaceId]`, and that would allow you, in a keybinding or elsewhere you have a X action, to say `XS.put (IgnoredWorkspaces ["foo", "bar"])` to update the list, and `(XS.get :: X IgnoredWorkspaces)` to retrieve it back. |
| 2022-04-10 12:23:53 | <amenonsen> | fizzie: that's roughly what i've done, following the integer example that you pointed me to yesterday. |
| 2022-04-10 12:24:24 | <amenonsen> | https://irc.toroid.org/file/2/Dd36AugJga0LqFjU |
| 2022-04-10 12:24:56 | <amenonsen> | sorry, and this is what the definition looks like: |
| 2022-04-10 12:24:59 | <amenonsen> | https://irc.toroid.org/file/2/8G5CWUUzLBKgjBTc |
| 2022-04-10 12:25:26 | <amenonsen> | (you're right, though, IgnoredWorkspaces would have been a better name for it) |
| 2022-04-10 12:29:43 | <fizzie> | That looks mostly right, you'll just need to unwrap it from the WorkspaceList type, and also sequence it to get it out of the X. |
| 2022-04-10 12:31:03 | <fizzie> | Completely untested, but something like ("M-<Left>", (XS.get :: X WorkspaceList) >>= \(WorkspaceList ignored) -> (moveTo Prev $ ignoringWSs ignoring)) has a _chance_ of working. |
| 2022-04-10 12:31:13 | <fizzie> | There's probably a more elegant way of doing that too. |
| 2022-04-10 12:33:05 | <fizzie> | Maybe with do notation, something like ("M-<Left>", do WorkspaceList ignored <- XS.get; moveTo Prev $ ignoringWSs ignored). Or something vaguely like that. I can't really write Haskell without some machine assistance. |
| 2022-04-10 12:34:44 | <amenonsen> | it works! |
| 2022-04-10 12:34:55 | <amenonsen> | (i tried the first form, not the do) |
| 2022-04-10 12:35:47 | <amenonsen> | so now i just need to make another keybinding to add another workspaceid to the list |
| 2022-04-10 12:44:43 | <abastro[m]> | I wonder what would be the usecase of the advanced feature |
| 2022-04-10 12:47:32 | <geekosaur> | which advanced feature? |
| 2022-04-10 12:51:57 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 2022-04-10 13:05:15 | × | de-vri-es quits (~de-vri-es@voyager.de-vri.es) (Quit: Bathrobe!) |
| 2022-04-10 13:05:46 | → | de-vri-es joins (~de-vri-es@voyager.de-vri.es) |
| 2022-04-10 13:06:55 | <abastro[m]> | Mutable states |
| 2022-04-10 13:07:06 | <abastro[m]> | * Mutable extended states |
| 2022-04-10 13:10:43 | <geekosaur> | in this case, they have a "work" workspace and want to hide it when they're not working |
| 2022-04-10 13:11:24 | <geekosaur> | I have a module that uses it to add "icons" to NamedScratchpads (which needs to be extended for dynamic scratchpads at some point) |
| 2022-04-10 13:11:56 | <geekosaur> | various other modules use it to add state to the core without having to patch the core |
| 2022-04-10 13:13:36 | <geekosaur> | since that lets you pass state between hooks |
| 2022-04-10 13:37:56 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection) |
| 2022-04-10 13:38:16 | → | geekosaur joins (~geekosaur@xmonad/geekosaur) |
| 2022-04-10 13:47:38 | <abastro[m]> | Oh, I see |
| 2022-04-10 14:00:48 | <amenonsen> | i have main = do … spawn … xmonad $ … $ stuff |
| 2022-04-10 14:01:14 | <amenonsen> | can i stuff an XS.put(IgnoredWorkspace [scratchpadWorkspaceTag]) in there somehow? |
| 2022-04-10 14:01:40 | <amenonsen> | (as opposed to setting initialValue = [scratchpadWorkspaceTag] when defining the type) |
| 2022-04-10 14:01:54 | <fizzie> | No, because it's in IO, and you need that to be in X. You could stuff one in startupHook, though. |
| 2022-04-10 14:06:37 | <fizzie> | (How exactly you'd do that depends a little on what `… $ stuff` looks like, but it's just a field on the XConfig like manageHook and others. And the type is already a X (), which is exactly what a `XS.put (...)` is too.) |
| 2022-04-10 14:14:03 | <amenonsen> | cool. |
| 2022-04-10 14:14:48 | <amenonsen> | if i `import qualified XMonad.StackSet as W`, will W.workspace be my current WorkspaceId? |
| 2022-04-10 14:21:13 | <geekosaur> | W.currentTag |
| 2022-04-10 14:21:47 | <geekosaur> | W.workspace points to the actual workspace record, which contains a tag, the current layout, and a Maybe Stack |
| 2022-04-10 14:23:33 | <geekosaur> | also it won't be the current one necessarily; you need to go through W.current (which gets you a Screen) and *then* W.workspace |
| 2022-04-10 14:23:55 | <geekosaur> | W.currentTag is shorthand for W.tag . W.workspace . W.current |
| 2022-04-10 14:24:11 | <amenonsen> | currentWs = liftX (withWindowSet $ return . W.currentTag) |
| 2022-04-10 14:24:20 | <amenonsen> | (found in Hooks/ManageHelpers) |
| 2022-04-10 14:24:26 | <geekosaur> | yep |
| 2022-04-10 14:26:07 | <geekosaur> | (the liftX indicates that it's a manageHook) |
| 2022-04-10 14:26:21 | <fizzie> | If you just need an `X WorkspaceId`, I imagine it should be just `withWindowSet W.currentTag`. |
| 2022-04-10 14:31:56 | <amenonsen> | https://irc.toroid.org/file/2/avA9g9ntHRsUB2Cr |
| 2022-04-10 14:31:59 | <geekosaur> | still need the return because it's in X |
| 2022-04-10 14:35:35 | <amenonsen> | , ("M-C-A-h", (XS.get :: X IgnoredWorkspaces) >>= \(IgnoredWorkspaces ignored) -> (XS.put (IgnoredWorkspaces $ ignored ++ [(withWindowSet $ return . W.currentTag)]))) |
| 2022-04-10 14:35:52 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b))) |
| 2022-04-10 14:35:52 | → | allbery_b joins (~geekosaur@xmonad/geekosaur) |
| 2022-04-10 14:35:55 | allbery_b | is now known as geekosaur |
| 2022-04-10 14:35:59 | <amenonsen> | this says Expected type: WorkspaceId, Actual type: X WorkspaceId. that seems like progress. |
| 2022-04-10 14:36:16 | <amenonsen> | but just adding liftX gives me a Query WorkspaceId |
| 2022-04-10 14:38:32 | <geekosaur> | withWindowSet $ return W.currentTag |
| 2022-04-10 14:38:43 | <geekosaur> | or: fmap W.currentTag $ gets windowset |
| 2022-04-10 14:39:32 | <abastro[m]> | Wow complex onr |
| 2022-04-10 14:39:38 | <abastro[m]> | * Wow complex one |
| 2022-04-10 14:56:47 | <fizzie> | See also XS.modify. |
| 2022-04-10 14:58:09 | <geekosaur> | sorry, needed that dot. withWindowSet $ return . W.currentTag |
| 2022-04-10 14:58:46 | <geekosaur> | without the dot it's withWindowSet $ \w -> return (W.currentTag w) |
| 2022-04-10 15:02:50 | <fizzie> | Or, putting it together slightly differently: withWindowSet $ \w -> XS.modify (\(IgnoredWorkspaces ignored) -> IgnoredWorkspaces (ignored ++ [W.currentTag w])) |
All times are in UTC.