I normally use a set of applications in different desks depending on the activity I am doing (working, writing, leisure,…). For example, when working, I normally open vifm, mutt, firefox, urxvt and xboard in different desks. I want to create a function that opens the desired applications associated to a menu.
This is what I have done so far:
1.- Create a menu listing the different activities (working,…) associated with particular functions.
- “&1 UAB” F-StartUAB
- “&2 Music” F-StartMusic
2.- Associate the menu to a key:
Key w A 4 Menu ContextTreball
3.- The definition of the function.
My issue has been that the applications should be opened in a particular desk. I have looked at the style “StartsOnDesk”, but I needed that the style should only be applied when opening the set of applications but not afterwards. I have been reading FvwmEvent: conditional window checking by example, and I have associated the change of style with the FvwmEvent. This is what I have:
[code]DestroyModuleConfig FE-BackToNormalStyle: *
*FE-BackToNormalStyle: Cmd Function
*FE-BackToNormalStyle: add_window F-BackToNormalStyle
Module FvwmEvent FE-BacktoNormalStyle
- I ThisWindow (“vifm”) Style vifm StartsAnyWhere,ShowMapping
- I ThisWindow (“mutt”) Style mutt StartsAnyWhere,ShowMapping
- I ThisWindow (“Navigator”) Style Navigator StartsAnyWhere,ShowMapping
- I ThisWindow (“terminal”) Style terminal StartsAnyWhere,ShowMapping
- I ThisWindow (“xboard”) Style xboard StartsAnyWhere,ShowMapping
- I ThisWindow (“vifm|mutt|navigator|terminal”,!Maximized) Maximize
- I Style vifm StartsOnDesk 0,SkipMapping
- I Style mutt StartsOnDesk 1,SkipMapping
- I Style Navigator StartsOnDesk 3,SkipMapping
- I Style terminal StartsOnDesk 4,SkipMapping
- I Style xboard StartsOnDesk 5,SkipMapping
- I Exec exec urxvtc -name vifm -e vifm ~/ ~/
- I Exec exec urxvtc -j -ss -name mutt -e Correu.sh correu
- I Exec exec firefox
- I Exec exec urxvtc -name terminal
- I Exec exec /usr/local/bin/Xboard_Crafty.sh [/code]
This is now working. I am posting it here to see if it can be improved or there is another approach to the same issue.
Thanks for your consideration!