DynamicWorkspaceGroups persistent after reboot?

Hi Everybody, Is there a way make the WSGroup persistent after reboot with XMonad.Actions.DynamicWorkspaceGroups? Can we define statically the WSGroup? With addWSGroup? Best regards, -- Alexis de BRUYN

On Sat, Mar 29, 2014 at 02:36:31PM +0100, Alexis de BRUYN wrote:
Hi Everybody,
Is there a way make the WSGroup persistent after reboot with XMonad.Actions.DynamicWorkspaceGroups?
Can we define statically the WSGroup? With addWSGroup?
Hi Alexis, Apologies for the delay in responding. Yes, to statically define some WSGroups it should suffice to put some calls to addWSGroup in your startupHook. Let me know if you have any trouble. -Brent

On 07.04.2014 19:00, Brent Yorgey wrote:
On Sat, Mar 29, 2014 at 02:36:31PM +0100, Alexis de BRUYN wrote:
Hi Everybody,
Is there a way make the WSGroup persistent after reboot with XMonad.Actions.DynamicWorkspaceGroups?
Can we define statically the WSGroup? With addWSGroup?
Hi Alexis, Hi Brent,
Apologies for the delay in responding. Yes, to statically define some No problem.
WSGroups it should suffice to put some calls to addWSGroup in your startupHook. Let me know if you have any trouble. Actually I can set my Groups with addWSGroup in my startupHook, but only a group is created if the workspaces are displayed on screens.
eg : myWorkspaces = ["1", "2", "3", "4", "5", "6"] myStartupHook = do addWSGroup "g1" ["1", "2", "3"] addWSGroup "g2" ["4", "5", "6"] After restarting xmonad, only g1 is created (and "1", "2" & "3" are displayed as usual). How can I do to have all my WSGroup created? Regards,
-Brent
-- Alexis de BRUYN

On Tue, Apr 08, 2014 at 04:48:12PM +0200, Alexis de BRUYN wrote:
On 07.04.2014 19:00, Brent Yorgey wrote:
On Sat, Mar 29, 2014 at 02:36:31PM +0100, Alexis de BRUYN wrote:
Hi Everybody,
Is there a way make the WSGroup persistent after reboot with XMonad.Actions.DynamicWorkspaceGroups?
Can we define statically the WSGroup? With addWSGroup?
Hi Alexis, Hi Brent,
Apologies for the delay in responding. Yes, to statically define some No problem.
WSGroups it should suffice to put some calls to addWSGroup in your startupHook. Let me know if you have any trouble. Actually I can set my Groups with addWSGroup in my startupHook, but only a group is created if the workspaces are displayed on screens.
eg : myWorkspaces = ["1", "2", "3", "4", "5", "6"]
myStartupHook = do addWSGroup "g1" ["1", "2", "3"] addWSGroup "g2" ["4", "5", "6"]
After restarting xmonad, only g1 is created (and "1", "2" & "3" are displayed as usual).
Oh, sorry, I see what is wrong. DynamicWorkspaceGroups remembers not just the names of the workspaces but which screens they were on (so that the same workspaces will always be displayed on the same screens when you switch to a workspace group). So addWSGroup only looks among the currently displayed workspaces, because otherwise it does not know which screen id to use for each workspace. The following function should achieve what you want: import qualified Data.Map as M import qualified XMonad.Util.ExtensibleState as XS addWSGroup' :: WSGroupId -> [(ScreenId, WorkspaceId)] -> X () addWSGroup' name = XS.modify . withWSG . M.insert name Now you have to explicitly give it screen ID's, of course, like myStartupHook = do addWSGroup' "g1" [(S 0, "1"), (S 1, "2"), (S 2, "3")] ... etc. Unfortunately I do not remember whether there is any guarantee about the numbering of screens being consecutive or even being the same between different runs of xmonad. You will have to experiment a bit. -Brent

On Wed, Apr 9, 2014 at 3:09 PM, Brent Yorgey
Unfortunately I do not remember whether there is any guarantee about the numbering of screens being consecutive or even being the same between different runs of xmonad. You will have to experiment a bit.
It will be consistent if the X server is. Sadly, sometimes it is not (variant bus probing ordering, buggy xorg video drivers, etc.). Sometimes you can compensate for this with the xrandr command or XMonad.Actions.PhysicalScreens. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

On 09.04.2014 21:09, Brent Yorgey wrote:
On Tue, Apr 08, 2014 at 04:48:12PM +0200, Alexis de BRUYN wrote:
On 07.04.2014 19:00, Brent Yorgey wrote:
On Sat, Mar 29, 2014 at 02:36:31PM +0100, Alexis de BRUYN wrote:
Hi Everybody,
Is there a way make the WSGroup persistent after reboot with XMonad.Actions.DynamicWorkspaceGroups?
Can we define statically the WSGroup? With addWSGroup?
Hi Alexis, Hi Brent,
Apologies for the delay in responding. Yes, to statically define some No problem.
WSGroups it should suffice to put some calls to addWSGroup in your startupHook. Let me know if you have any trouble. Actually I can set my Groups with addWSGroup in my startupHook, but only a group is created if the workspaces are displayed on screens.
eg : myWorkspaces = ["1", "2", "3", "4", "5", "6"]
myStartupHook = do addWSGroup "g1" ["1", "2", "3"] addWSGroup "g2" ["4", "5", "6"]
After restarting xmonad, only g1 is created (and "1", "2" & "3" are displayed as usual).
Oh, sorry, I see what is wrong. DynamicWorkspaceGroups remembers not just the names of the workspaces but which screens they were on (so that the same workspaces will always be displayed on the same screens when you switch to a workspace group). So addWSGroup only looks among the currently displayed workspaces, because otherwise it does not know which screen id to use for each workspace.
The following function should achieve what you want:
import qualified Data.Map as M import qualified XMonad.Util.ExtensibleState as XS
addWSGroup' :: WSGroupId -> [(ScreenId, WorkspaceId)] -> X () addWSGroup' name = XS.modify . withWSG . M.insert name I have got the following error: xmonad.hs:27:32: Not in scope: `withWSG'
Thanks for your help.
Now you have to explicitly give it screen ID's, of course, like
myStartupHook = do addWSGroup' "g1" [(S 0, "1"), (S 1, "2"), (S 2, "3")] ... etc.
Unfortunately I do not remember whether there is any guarantee about the numbering of screens being consecutive or even being the same between different runs of xmonad. You will have to experiment a bit.
-Brent
-- Alexis de BRUYN

On Thu, Apr 10, 2014 at 07:35:41PM +0200, Alexis de BRUYN wrote:
On 09.04.2014 21:09, Brent Yorgey wrote:
The following function should achieve what you want:
import qualified Data.Map as M import qualified XMonad.Util.ExtensibleState as XS
addWSGroup' :: WSGroupId -> [(ScreenId, WorkspaceId)] -> X () addWSGroup' name = XS.modify . withWSG . M.insert name
I have got the following error: xmonad.hs:27:32: Not in scope: `withWSG'
Sorry for that, withWSG was not exported. I have just pushed a patch adding a new function addRawWSGroup which is defined in the same way as the addWSGroup' I suggested above. I have tested it and it seems to work. So now you can call it from your startup hook like so: myStartupHook = do addRawWSGroup "g1" [(S 0, "1"), (S 1, "2"), (S 2, "3")] ... etc. To use it you will have to obtain the latest darcs version of xmonad-contrib, like so: darcs get http://code.haskell.org/XMonadContrib cd XMonadContrib cabal install The darcs version is quite stable so you should have no problems upgrading to it. -Brent

On Mon, Apr 28, 2014 at 10:38 AM, Brent Yorgey
darcs get http://code.haskell.org/XMonadContrib cd XMonadContrib cabal install
The darcs version is quite stable so you should have no problems upgrading to it.
Another option is: cabal install http://code.haskell.org/XMonadContrib/XMonadContrib.tar.gz \ http://code.haskell.org/xmonad/xmonad.tar.gz Those tar.gz snapshots are updated whenever somebody adds a patch to the repo. Regards, Adam

Thanks a lot Brent, all is working fine for me! Regards, On 28.04.2014 16:38, Brent Yorgey wrote:
On Thu, Apr 10, 2014 at 07:35:41PM +0200, Alexis de BRUYN wrote:
On 09.04.2014 21:09, Brent Yorgey wrote:
The following function should achieve what you want:
import qualified Data.Map as M import qualified XMonad.Util.ExtensibleState as XS
addWSGroup' :: WSGroupId -> [(ScreenId, WorkspaceId)] -> X () addWSGroup' name = XS.modify . withWSG . M.insert name
I have got the following error: xmonad.hs:27:32: Not in scope: `withWSG'
Sorry for that, withWSG was not exported. I have just pushed a patch adding a new function
addRawWSGroup
which is defined in the same way as the addWSGroup' I suggested above. I have tested it and it seems to work. So now you can call it from your startup hook like so:
myStartupHook = do addRawWSGroup "g1" [(S 0, "1"), (S 1, "2"), (S 2, "3")] ... etc.
To use it you will have to obtain the latest darcs version of xmonad-contrib, like so:
darcs get http://code.haskell.org/XMonadContrib cd XMonadContrib cabal install
The darcs version is quite stable so you should have no problems upgrading to it.
-Brent
-- Alexis de BRUYN
participants (4)
-
adam vogt
-
Alexis de BRUYN
-
Brandon Allbery
-
Brent Yorgey