From info at mito-space.com Wed Dec 15 19:48:14 2021 From: info at mito-space.com (nyam) Date: Wed, 15 Dec 2021 20:48:14 +0100 Subject: [xmonad] Different xmonad configs? Message-ID: <43248451-40df-3215-d55a-98a920d2a332@mito-space.com> Hi all! Is there an option to compile and (re)start etc. individual 'xmonad.hs', such as one has different DE/WMs and wants to use e. g. together with their own adapted xmonad? – Like: $ xmonad --file=/path/to/xmonad-de1.hs --recompile $ exec xmonad --file=/path/to/xmonad-de1.hs or $ xmonad --file=/path/to/xmonad-de2.hs --recompile $ xmonad --restart --file=/path/to/xmonad-de2.hs or $ xmonad --recompile --file=/path/to/xmonad-pure.hs $ exec xmonad --file=/path/to/xmonad-pure.hs Would be a cool feature, though so far the manpage or any web resources don't mention it. Cheers! From allbery.b at gmail.com Wed Dec 15 19:57:33 2021 From: allbery.b at gmail.com (Brandon Allbery) Date: Wed, 15 Dec 2021 14:57:33 -0500 Subject: [xmonad] Different xmonad configs? In-Reply-To: <43248451-40df-3215-d55a-98a920d2a332@mito-space.com> References: <43248451-40df-3215-d55a-98a920d2a332@mito-space.com> Message-ID: I used to simulate it with a wrapper, but that was a decade ago when I was jumping between xmonad+KDE and bare xmonad according to need. There's no built-in mechanism for it, and one might be difficult to add these days because of how the cabal and stack-based setups work. On Wed, Dec 15, 2021 at 2:51 PM nyam wrote: > > Hi all! > > > Is there an option to compile and (re)start etc. individual 'xmonad.hs', > such as one has different DE/WMs and wants to use e. g. together with > their own adapted xmonad? – Like: > > > $ xmonad --file=/path/to/xmonad-de1.hs --recompile > > $ exec xmonad --file=/path/to/xmonad-de1.hs > > or > > $ xmonad --file=/path/to/xmonad-de2.hs --recompile > > $ xmonad --restart --file=/path/to/xmonad-de2.hs > > or > > $ xmonad --recompile --file=/path/to/xmonad-pure.hs > > $ exec xmonad --file=/path/to/xmonad-pure.hs > > > Would be a cool feature, though so far the manpage or any web resources > don't mention it. > > > Cheers! > > > _______________________________________________ > xmonad mailing list > xmonad at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad -- brandon s allbery kf8nh allbery.b at gmail.com From soliditsallgood at mailbox.org Wed Dec 15 20:11:43 2021 From: soliditsallgood at mailbox.org (Solid) Date: Wed, 15 Dec 2021 21:11:43 +0100 Subject: [xmonad] Different xmonad configs? In-Reply-To: References: <43248451-40df-3215-d55a-98a920d2a332@mito-space.com> Message-ID: <87sfutsk5c.fsf@hyperspace> On Wed, Dec 15 2021 14:57, Brandon Allbery wrote: > There's no built-in mechanism for it, and one might be difficult to > add these days because of how the cabal and stack-based setups work. Indeed, I think the main problem lies here; especially since we're now providing more or less frictionless (i.e., no build script necessary) stack support out of the box. A `--file` option that only makes sense in case of a specific setup would feel a bit unsatisfying (at least to me). Though, I would imagine something like this shouldn't be too difficult to hack together via a shell-script wrapper. From platon7pronko at gmail.com Wed Dec 15 21:34:27 2021 From: platon7pronko at gmail.com (Platon Pronko) Date: Thu, 16 Dec 2021 00:34:27 +0300 Subject: [xmonad] Different xmonad configs? In-Reply-To: <43248451-40df-3215-d55a-98a920d2a332@mito-space.com> References: <43248451-40df-3215-d55a-98a920d2a332@mito-space.com> Message-ID: <72c7ede5-e5c2-41dd-3bc2-d80b5d4c517f@gmail.com> Hi! I suspect the easiest way around this might be to detect the current DE/WM at runtime somehow and change Xmonad behavior accordingly, this way a lot of code will be reused between configs for different WMs. That said, reading through source code in Core.hs there are references to XMONAD_DATA_DIR, XMONAD_CONFIG_DIR, XMONAD_CACHE_DIR environment vars that can be used to control where xmonad gets the files from: https://hackage.haskell.org/package/xmonad-0.17.0/docs/src/XMonad.Core.html#getDirectories So probably you can place different xmonad.hs files into different directories and then use XMONAD_CONFIG_DIR to control what files are compiled. Best regards, Platon Pronko On 2021-12-15 22:48, nyam wrote: > Hi all! > > > Is there an option to compile and (re)start etc. individual 'xmonad.hs', > such as one has different DE/WMs and wants to use e. g. together with > their own adapted xmonad? – Like: > > > $ xmonad --file=/path/to/xmonad-de1.hs --recompile > > $ exec xmonad --file=/path/to/xmonad-de1.hs > > or > > $ xmonad --file=/path/to/xmonad-de2.hs --recompile > > $ xmonad --restart --file=/path/to/xmonad-de2.hs > > or > > $ xmonad --recompile --file=/path/to/xmonad-pure.hs > > $ exec xmonad --file=/path/to/xmonad-pure.hs > > > Would be a cool feature, though so far the manpage or any web resources > don't mention it. > > > Cheers! > > > _______________________________________________ > xmonad mailing list > xmonad at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad From rdiaz02 at gmail.com Sun Dec 26 23:50:37 2021 From: rdiaz02 at gmail.com (Ramon Diaz-Uriarte) Date: Mon, 27 Dec 2021 00:50:37 +0100 Subject: [xmonad] withWorkspace (Actions.DynamicWorkspaces): use fuzzyMatch? Message-ID: <87bl12apgu.fsf@gmail.com> Dear All, Summary: ======== I think withWorkspace, from Actions.DynamicWorkspaces, does not honor fuzzyMatch (Prompt.FuzzyMatch). In contrast, selectWorkspace and renameWorkspace (also from DynamicWorkspaces) do work with fuzzyMatch. workspacePrompt (Prompt.Workspace) and switchProjectPrompt (Actions.DynamicProjects) also work with fuzzyMatch. Details ======== With this in my xmonad.hs mySPcentered = def { searchPredicate = fuzzyMatch , sorter = fuzzySort } the following , ("M-m", withWorkspace mySPcentered (windows . W.shift)) does not use fuzzy matching but , ("M-m", workspacePrompt mySPcentered (windows . W.shift)) does use fuzzy matching. Note that , ("M-a", selectWorkspace mySPcentered) , ("M-s", renameWorkspace mySPcentered) both use fuzzy matching (and both selectWorkspace and renameWorkspace are from DynamicWorkspaces). And note that , ("M-w", switchProjectPrompt myProjectConfig) with switchProjectPrompt from Actions.DynamicProjects, also works with fuzzyMatch. Workaround? =========== Complete Haskell ignorant here, but from looking at the source of withWorkspace (Actions.DynamicWorkspaces) and workspacePrompt (Prompt.Workspace), I wonder if withWorkspace should be written as withWorkspace c job = do ws <- gets (workspaces . windowset) sort <- getSortByIndex let ts = map W.tag $ sort ws job' t | t `elem` ts = job t | otherwise = addHiddenWorkspace t >> job t mkXPrompt (Wor "") c (mkComplFunFromList' c ts) job' I have changed the last line from mkXPrompt (Wor "") c (mkCompl ts) job' to mkXPrompt (Wor "") c (mkComplFunFromList' c ts) job' Using this in my xmonad.hs seems to work fine with windows' shift, copy and shiftThenView (last one from Ivan Malison's https://github.com/ivanmalison/dotfiles/blob/0a84ad772e21155cfc00458b66ccb79899699689/dotfiles/config/xmonad/xmonad.hs#L788) Best, -- Ramon Diaz-Uriarte Department of Biochemistry, Lab B-31 Facultad de Medicina Universidad Autónoma de Madrid Arzobispo Morcillo, 4 28029 Madrid Spain Phone: +34-91-497-2412 Email: rdiaz02 at gmail.com r.diaz at uam.es https://ligarto.org/rdiaz From soliditsallgood at mailbox.org Mon Dec 27 07:00:26 2021 From: soliditsallgood at mailbox.org (Solid) Date: Mon, 27 Dec 2021 08:00:26 +0100 Subject: [xmonad] withWorkspace (Actions.DynamicWorkspaces): use fuzzyMatch? In-Reply-To: <87bl12apgu.fsf@gmail.com> References: <87bl12apgu.fsf@gmail.com> Message-ID: <87y246jzw5.fsf@hyperspace> Hi, On Mon, Dec 27 2021 00:50, Ramon Diaz-Uriarte wrote: > I have changed the last line from > mkXPrompt (Wor "") c (mkCompl ts) job' > to > mkXPrompt (Wor "") c (mkComplFunFromList' c ts) job' > > Using this in my xmonad.hs seems to work fine with windows' shift, > copy and shiftThenView (last one from Ivan Malison's > https://github.com/ivanmalison/dotfiles/blob/0a84ad772e21155cfc00458b66ccb79899699689/dotfiles/config/xmonad/xmonad.hs#L788) Indeed, I think this would be the right change. The current `mkCompl` is basically just what `mkComplFunFromList'` with the default `searchPredicate` (which is `isPrefixOf`) does; it's definitely better to let users choose their own predicate. If you want, you can submit a pull-request for this[1]! Tony [1]: https://github.com/xmonad/xmonad-contrib/compare From rdiaz02 at gmail.com Tue Dec 28 03:37:43 2021 From: rdiaz02 at gmail.com (Ramon Diaz-Uriarte) Date: Tue, 28 Dec 2021 04:37:43 +0100 Subject: [xmonad] withWorkspace (Actions.DynamicWorkspaces): use fuzzyMatch? In-Reply-To: <87y246jzw5.fsf@hyperspace> References: <87bl12apgu.fsf@gmail.com> <87y246jzw5.fsf@hyperspace> Message-ID: <877dbp9z3i.fsf@gmail.com> On Mon, 27-December-2021, at 08:00:26, Solid wrote: > Hi, > > On Mon, Dec 27 2021 00:50, Ramon Diaz-Uriarte wrote: >> I have changed the last line from >> mkXPrompt (Wor "") c (mkCompl ts) job' >> to >> mkXPrompt (Wor "") c (mkComplFunFromList' c ts) job' >> >> Using this in my xmonad.hs seems to work fine with windows' shift, >> copy and shiftThenView (last one from Ivan Malison's >> https://github.com/ivanmalison/dotfiles/blob/0a84ad772e21155cfc00458b66ccb79899699689/dotfiles/config/xmonad/xmonad.hs#L788) > > Indeed, I think this would be the right change. The current `mkCompl` > is basically just what `mkComplFunFromList'` with the default > `searchPredicate` (which is `isPrefixOf`) does; it's definitely better > to let users choose their own predicate. Thanks for the confirmation! > If you want, you can submit a pull-request for this[1]! I just did. (Which makes me feel rather uneasy, given my haskell-ignorance ;-) ) Best, R. > > Tony > > [1]: https://github.com/xmonad/xmonad-contrib/compare -- Ramon Diaz-Uriarte Department of Biochemistry, Lab B-31 Facultad de Medicina Universidad Autónoma de Madrid Arzobispo Morcillo, 4 28029 Madrid Spain Phone: +34-91-497-2412 Email: rdiaz02 at gmail.com r.diaz at uam.es https://ligarto.org/rdiaz