Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
fvwm dockapp starting possition
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
a16b03
Apprentice
Apprentice


Joined: 21 Mar 2006
Posts: 253
Location: Riga, Latvia

PostPosted: Sat Dec 16, 2006 12:08 am    Post subject: fvwm dockapp starting possition Reply with quote

Is there a way to set dockapp starting position without using FvwmButtons?
I want it to start in right bottom corner.




I tried to register in fvwm forum, but admin seams to be gone for a long coffee break
(month ago the same happened)
Back to top
View user's profile Send private message
entox
n00b
n00b


Joined: 19 Jun 2005
Posts: 36

PostPosted: Sat Dec 16, 2006 6:15 pm    Post subject: Reply with quote

You can try to add a line to your StartFunction:
Code:

AddTo StartFunction
....
+ I Next ($dockapp$) Move 900p 700p
...

And maybe set a style line like
Code:

Style $dockapp$ FixedPosition


Bye Entox
Btw there have been problems with spamming in the fvwm forums, maybe it will take some time until you get registed (http://fvwm.lair.be/viewtopic.php?t=1592)
There is also a ban list http://fvwm.lair.be/viewtopic.php?t=1443
Back to top
View user's profile Send private message
ThomasAdam
Guru
Guru


Joined: 20 Mar 2005
Posts: 448
Location: England

PostPosted: Sun Dec 17, 2006 1:10 pm    Post subject: Re: fvwm dockapp starting possition Reply with quote

a16b03 wrote:
Is there a way to set dockapp starting position without using FvwmButtons?
I want it to start in right bottom corner.


You'll need to be more specific by what you mean here. FvwmButtons has a -g option to it to set the initial geometry.

a16b03 wrote:

I tried to register in fvwm forum, but admin seams to be gone for a long coffee break
(month ago the same happened)


You probably present to me like a spammer, hence I deleted your account. Re-register there (if you haven't done so already) and I'll enable your account. Note that I have mentioned on the forums before now what to do if your account is deleted or not enabled.

-- Thomas Adam
Back to top
View user's profile Send private message
a16b03
Apprentice
Apprentice


Joined: 21 Mar 2006
Posts: 253
Location: Riga, Latvia

PostPosted: Sun Dec 17, 2006 3:41 pm    Post subject: Reply with quote

I'm no spammer.

this is what i got in e-mail



    admin@lair.be
    to me

    show details
    Dec 15 (2 days ago)

    Welcome to FVWM Forums Forums

    Please keep this email for your records. Your account information is as follows:

    ----------------------------
    Username: a16b03
    Password: MY PASSWORD
    ----------------------------

    Your account is currently inactive, the administrator of the board will need to activate it before you can log in. You will receive another email when this has occured.

    Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However, should you forget your password you can request a new one which will be activated in the same way as this account.

    Thank you for registering.

    --
    Thanks, the FVWM forum administrators
Back to top
View user's profile Send private message
ThomasAdam
Guru
Guru


Joined: 20 Mar 2005
Posts: 448
Location: England

PostPosted: Sun Dec 17, 2006 3:53 pm    Post subject: Reply with quote

a16b03 wrote:
I'm no spammer.

this is what i got in e-mail



    admin@lair.be
    to me

    show details
    Dec 15 (2 days ago)

    Welcome to FVWM Forums Forums

    Please keep this email for your records. Your account information is as follows:

    ----------------------------
    Username: a16b03
    Password: MY PASSWORD
    ----------------------------

    Your account is currently inactive, the administrator of the board will need to activate it before you can log in. You will receive another email when this has occured.

    Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However, should you forget your password you can request a new one which will be activated in the same way as this account.

    Thank you for registering.

    --
    Thanks, the FVWM forum administrators


That message is slightly in error, since the confirmation is never sent out. Plus, two days ago I was travelling back home -- not that I am making any excuses -- you just have to learn to be more patient.

I'll look to activating your account within the next half an hour.

-- Thomas Adam
Back to top
View user's profile Send private message
a16b03
Apprentice
Apprentice


Joined: 21 Mar 2006
Posts: 253
Location: Riga, Latvia

PostPosted: Sun Dec 17, 2006 3:56 pm    Post subject: Reply with quote

ThomasAdam wrote:
a16b03 wrote:
I'm no spammer.

this is what i got in e-mail



    admin@lair.be
    to me

    show details
    Dec 15 (2 days ago)

    Welcome to FVWM Forums Forums

    Please keep this email for your records. Your account information is as follows:

    ----------------------------
    Username: a16b03
    Password: MY PASSWORD
    ----------------------------

    Your account is currently inactive, the administrator of the board will need to activate it before you can log in. You will receive another email when this has occured.

    Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However, should you forget your password you can request a new one which will be activated in the same way as this account.

    Thank you for registering.

    --
    Thanks, the FVWM forum administrators


That message is slightly in error, since the confirmation is never sent out. Plus, two days ago I was travelling back home -- not that I am making any excuses -- you just have to learn to be more patient.

I'll look to activating your account within the next half an hour.

-- Thomas Adam



Thank's.
Back to top
View user's profile Send private message
mimosinnet
l33t
l33t


Joined: 10 Aug 2006
Posts: 713
Location: Barcelona, Spain

PostPosted: Mon Jul 16, 2007 8:30 am    Post subject: Reply with quote

entox wrote:
You can try to add a line to your StartFunction:
Code:

AddTo StartFunction
....
+ I Next ($dockapp$) Move 900p 700p
...


I believe I have understood the purpose of Next in the above example. The man page says:
Code:
Next [(conditions)] command.  Performs command (typically Focus) on the next window which satisfies all conditions. If the command is running in a window context, it starts looking for a matching window from there. Otherwise it starts at the focused window.


Correct me if I am wrong: when $dockapp$ window appears sometime in the future it will be moved to 900p 700p. You sill need a command to execute the dockapp like, for example, in InitFuction:
Code:
AddToFunc InitFunction
+ I Exec exec $dockapp$


Cheers!
Back to top
View user's profile Send private message
ThomasAdam
Guru
Guru


Joined: 20 Mar 2005
Posts: 448
Location: England

PostPosted: Mon Jul 16, 2007 8:41 am    Post subject: Reply with quote

mimosinnet wrote:
Correct me if I am wrong: when $dockapp$ window appears sometime in the future it will be moved to 900p 700p. You sill need a command to execute the dockapp like, for example, in InitFuction:


No. Not InitFunction, see:

http://fvwm.lair.be/viewtopic.php?f=40&t=1505

And I don't know whether you're using "$dockapp$" as a meta-syntatic placeholder, or God forbid an actual name, but it's a stupid one.

-- Thomas Adam
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Mon Jul 16, 2007 10:15 am    Post subject: Reply with quote

Some dockapps can take geometry arguments in the X way when starting. Check the documentation for your dockapps and see if they can do that. If not, you will need to move them after they have been created. You might be interested in the PositionPlacement Style clause (check fvwm man page).
Back to top
View user's profile Send private message
ThomasAdam
Guru
Guru


Joined: 20 Mar 2005
Posts: 448
Location: England

PostPosted: Mon Jul 16, 2007 10:28 am    Post subject: Reply with quote

i92guboj wrote:
You might be interested in the PositionPlacement Style clause (check fvwm man page).


That's still a CVS feature, as per:

http://fvwm.lair.be/viewtopic.php?f=4&t=1720

And IME, most so-called dockapps reply on EWMH to set their placement, which means no --geometry setting at all. :(

-- Thomas Adam
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Mon Jul 16, 2007 10:41 am    Post subject: Reply with quote

ThomasAdam wrote:
i92guboj wrote:
You might be interested in the PositionPlacement Style clause (check fvwm man page).


That's still a CVS feature, as per:

http://fvwm.lair.be/viewtopic.php?f=4&t=1720


Ops, sorry, you are completely right.

Quote:

And IME, most so-called dockapps reply on EWMH to set their placement, which means no --geometry setting at all. :(

-- Thomas Adam


Well, it's true that most of them are that way. But I have eventually found some that accepted such settings in one or another way. For example, right now I can remember that wmsmixer can do so with the -position parameter.

The easiest solution would be to just use FvwmButtons. A few megabytes of extra "wasted" memory will not hurt. Of course, moving them will work just as well.
Back to top
View user's profile Send private message
mimosinnet
l33t
l33t


Joined: 10 Aug 2006
Posts: 713
Location: Barcelona, Spain

PostPosted: Mon Jul 16, 2007 10:47 pm    Post subject: Reply with quote

ThomasAdam wrote:
No. Not InitFunction, see:

Thanks for the clarification. I got confused with fvwm man page:
Quote:
StartFunction, which is executed on startups and restarts; InitFunction and RestartFunction, which are executed during initialization and restarts (respectively) just after StartFunction.


ThomasAdam wrote:
And I don't know whether you're using "$dockapp$" as a meta-syntatic placeholder, or God forbid an actual name, but it's a stupid one.

Oops...! Sorry, I was continuing the format of the initial post. :oops:

i92guboj wrote:
If not, you will need to move them after they have been created. You might be interested in the PositionPlacement Style clause (check fvwm man page).

Thanks! I was trying to understand how Next worked as to start my applications on different pages. I have tried:
Code:
AddToFunc StartFunction
+ I Exec exec konqueror --profile filemanagement
+ I Wait konqueror
+ I StartsOnPage 0 0
+ I Exec exec konqueror
+ I Wait konqueror
+ I StartsOnPage 0 1


And:
Code:
AddToFunc    StartFunction
+ I Exec exec kdeinit
+ I Exec exec xmodmap -e "pointer = 3 2 1 4 5"
+ I Exec exec gkrellm2 -g +1+170
+ I Exec exec kontact
+ I Exec exec konsole
+ I Next (konqueror) StartsOnPage 0 0
+ I Exec exec konqueror --profile filemanagement
+ I Next (konqueror) StartsOnPage 0 1
+ I Exec exec konqueror


Without any success.

Cheers!


Last edited by mimosinnet on Mon Jul 16, 2007 11:56 pm; edited 1 time in total
Back to top
View user's profile Send private message
ThomasAdam
Guru
Guru


Joined: 20 Mar 2005
Posts: 448
Location: England

PostPosted: Mon Jul 16, 2007 11:03 pm    Post subject: Reply with quote

mimosinnet wrote:
Thanks! I was trying to understand how Next worked as to start my applications on different pages. I have tried:
Code:
AddToFunc StartFunction
+ I Exec exec konqueror --profile filemanagement
+ I Wait konqueror
+ I StartsOnPage 0 0
+ I Exec exec konqueror
+ I Wait konqueror
+ I StartsOnPage 0 1


Right. Well that's wrong. "Next" works on the *next* window in the window ring which satisfies whichever condition you happen to want of it. Without any conditions at all it will often be the last window mapped to the screen. The problem with the function above as you have it is that you're assuming that "StartsOnPage" is somehow a command -- it's not. It's a Style condition. It doesn't need to be in the function at all, and shouldn't. The proper way to do what you're trying is this:

Code:

Destroyfunc SomeFunction
AddToFunc   SomeFunction
+ I GotoPage 0 0
+ I Exec exec konqueror --profile filemanagement
+ I Wait konqueror
+ I GotoPage 0 1
+ I Exec exec something-else
+ i Wait somthing-else
+ I GotoPage 0 0


This approach used to be a classic in the FVWM 2.2.X days, but it's redundant and presents a few problems. First of all FVWM synchronises its operation -- Wait is blocking in that regard, and FVWM will sit there indefinitely waiting for the window to appear. If it doesn't not a lot else tends to happen.

So the more correct approach is to define Style lines instead which tell FVWM where it is to place these windows:

Code:

Style some-window StartsOnPage 0 0
Style some-other-window StartsOnPage 0 1

DestroyFunc SomeFunc
AddToFunc   SomeFunc
+ I Exec exec some-window
+ I Exec exec some-other-window


Where Wait comes in useful is of course for post-mapping operations on that window. This alludes to what I told you about some applications not adhering to --geometry (such as Mozilla). In that instance you could have something like this in your StartFunction

Code:

AddToFunc StartFunction
+ I None (Firefox-bin) Exec exec firefox
+ I Wait Firefox-bin
+ I Next (Firefox-bin) Move 0 12


And here's the real answer to your question: because we've waited for the window to appear, Next will work on that window, since it's the *next* window in the window stack, having just been created. Had you just done this:

Code:

Exec exec xterm

DestroyFunc SomeFunc
AddToFunc   SomeFunc
+ I Exec exec xterm
+ I Next (xterm) Focus


There is no guarantee that the window launched from within the function is the window that the Next command would work with -- it might not even have mapped itself yet, and hence Next might find the next window in the stack to be the xterm window we spawned outside of the function.

Hope That Helps.

-- Thomas Adam
Back to top
View user's profile Send private message
ThomasAdam
Guru
Guru


Joined: 20 Mar 2005
Posts: 448
Location: England

PostPosted: Mon Jul 16, 2007 11:32 pm    Post subject: Reply with quote

entox wrote:
You can try to add a line to your StartFunction:
Code:

AddTo StartFunction
....
+ I Next ($dockapp$) Move 900p 700p
...

And maybe set a style line like
Code:

Style $dockapp$ FixedPosition


No -- you'd have to get the order of that correct. The style line would override the moving of the window anyway, so _again_ as per my previous post:

Code:

DestroyFunc SomeFunction
AddToFunc SomeFunction
+ I Exec exec some-app
+ I Wait some-app
+ I Next (some-app) Move x y
+ I Next (some-app) WindowStyle FixedPosition


The reason why the Style line takes precedence is because FVWM does this:

1. Finds the appropriate config file.
2. reads it in line-by-line.
3. Executes those lines (that aren't complex functions).
4. Executes {Start,Init}Function

Hence, you would *have* to set the style of FixedPosition of this window after mapping -- hence in the function somewhere.

entox wrote:

Btw there have been problems with spamming in the fvwm forums, maybe it will take some time until you get registed (http://fvwm.lair.be/viewtopic.php?t=1592)
There is also a ban list http://fvwm.lair.be/viewtopic.php?t=1443


This no longer applies either -- registration is now no longer dependant on myself or theBlackDragon wading through spammers trying to register. It's automated, thanks to the new CAPTCHA system PHPBB3 seems to have. So until the spammers overcome that...

-- Thomas Adam
Back to top
View user's profile Send private message
mimosinnet
l33t
l33t


Joined: 10 Aug 2006
Posts: 713
Location: Barcelona, Spain

PostPosted: Sat Jul 21, 2007 11:15 am    Post subject: Reply with quote

ThomasAdam wrote:
The reason why the Style line takes precedence is because FVWM does this:
1. Finds the appropriate config file.
2. reads it in line-by-line.
3. Executes those lines (that aren't complex functions).
4. Executes {Start,Init}Function


Thanks! The previous two posts have very much clarified how FVWM works. I am contributing these tips in the Gentoo Wiki FVWM_Advanced to aid other people like me that start with FVWM, and I would like to get it right.

1.- The (style and action) commands FVWM finds in the config file, are they executed consecutively?
2.- Is there any order execution between functions and modules?
3.- Appart from the StartFunction, is there any other prevalence between functions?

For example, as you said:
Code:
Destroyfunc SomeFunction
AddToFunc   SomeFunction
+ I GotoPage 0 0
+ I Exec exec konqueror --profile filemanagement
+ I Wait konqueror
+ I GotoPage 0 1

Makes fvwm to stop and wait for konqueror window to appear (very annoying!). While
Code:
Style some-window StartsOnPage 0 0
Style some-other-window StartsOnPage 0 1
DestroyFunc SomeFunc
AddToFunc   SomeFunc
+ I Exec exec some-window
+ I Exec exec some-other-window

Defines in which page applications will always appear.

Therefore, if I want the first appearance of a window to be on page 0 1 and do not want to use wait, what would be the way to go?

Cheers!
Back to top
View user's profile Send private message
ThomasAdam
Guru
Guru


Joined: 20 Mar 2005
Posts: 448
Location: England

PostPosted: Sat Jul 21, 2007 11:50 am    Post subject: Reply with quote

mimosinnet wrote:

1.- The (style and action) commands FVWM finds in the config file, are they executed consecutively?


Yes -- in the order they're found, anyway.

mimosinnet wrote:

2.- Is there any order execution between functions and modules?


Only if the receiver isn't stated explicitly. So for example, let's say you had this in your config somewhere on a line by itself:

Code:

CheckNextWindow


FVWM will try and do the following (in order):

Code:

1.  Match it to one of its internal commands.
2.  Match it to a function name.
3.  Match it to a module.


Of course, you can always tell FVWM explicitly what you mean with, say one of:

Code:

Function CheckNextWindow
Module  CheckNextWindow


Where the name of the function and/or module isn't already ambiguous to FVWM you don't need the Function or Module prefix as an example:

Code:

DestroyFunc CheckNextWindow
AddToFunc CheckNextWindow
+ I Beep

# Make the computer beep.   Note that FVWM here will execute the function above because it's not an internal command, nor is it a module.
CheckNextWindow

DestroyModuleConfig CheckNextWindow:*
*CheckNextWindow: Columns 1
*CheckNextWindow: Rows 1
*CheckNextWindow: (1x1)

FvwmButtons CheckNextWindow


The reason why that works, is the module alias of CheckNextWindow has to be explicitly told to load via FvwmButtons. Confer with the following:

Code:

DestroyFunc FvwmButtons
AddToFunc FvwmButtons
+ I Beep

# Make the computer beep
FvwmButtons

DestroyModuleConfig FvwmButtons:*
*FvwmButtons: Columns 1
*FvwmButtons: Rows 1
*FvwmButtons: (1x1)

# Again, the computer beeps because the function has overriden the lookup of the module name.
FvwmButtons


In order to get your FvwmButtons module to load, and keep the function about, we should explicitly state that we're wanting to load a module, hence:

Code:
Module FvwmButtons


Will do that, in the above.

mimosinnet wrote:

3.- Appart from the StartFunction, is there any other prevalence between functions?


InitFunction and RestartFunction.

mimosinnet wrote:

For example, as you said:
Code:
Destroyfunc SomeFunction
AddToFunc   SomeFunction
+ I GotoPage 0 0
+ I Exec exec konqueror --profile filemanagement
+ I Wait konqueror
+ I GotoPage 0 1

Makes fvwm to stop and wait for konqueror window to appear (very annoying!).


It might be annoying, but at least you're guaranteed nothing else is going to happen unless this window loads. :)

mimosinnet wrote:

While
Code:
Style some-window StartsOnPage 0 0
Style some-other-window StartsOnPage 0 1
DestroyFunc SomeFunc
AddToFunc   SomeFunc
+ I Exec exec some-window
+ I Exec exec some-other-window

Defines in which page applications will always appear.

Therefore, if I want the first appearance of a window to be on page 0 1 and do not want to use wait, the way to go could be:
To add the next(window-application) MoveToPage combination in the StartFunction?. I am going to try it now.


But you're going to have to use wait anyway to ensure that the operand window really is the window that was started up (see my previous post), hence:

Code:

Style some-window StartsOnPage 0 1

DestroyFunc SomeFunc
AddToFunc   SomeFunc
+ I None ("some-window") Exec exec some-window
+ I TestRc (Match) Break
+ I Exec exec some-window
+ I Wait some-window
+ I Next (some-window, CircuateHit) MoveToPage $*


This function checks to see if "some-window" exists. If it doesn't then we execute it and break out of the function -- the style line defined just above the function takes care of placing that window. Otherwise we keep going through the function, load the window and move it to the correct place. Hence to use the function you would call:

Code:

SomeFunc 0 7


Which would place the window on page 0 7 if it wasn't already running, else it gets put on 0 1. This is what the "$*" expands to -- all arguments passed to the function.

You said you were adding this to the gentoo wiki -- might I suggest you add some if it to the Fvwm Forums, as well, please?

-- Thomas Adam
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum