View previous topic :: View next topic |
Author |
Message |
tmske Tux's lil' helper
Joined: 19 May 2005 Posts: 141
|
Posted: Sat Nov 12, 2005 2:23 pm Post subject: |
|
|
I found that the class of gvim is "gvim", "Gvim"
so I changed my config
Code: | Style "Gvim" Maximize |
but it still doesn't work |
|
Back to top |
|
|
ThomasAdam Guru
Joined: 20 Mar 2005 Posts: 448 Location: England
|
Posted: Sat Nov 12, 2005 2:36 pm Post subject: |
|
|
tmske wrote: | I found that the class of gvim is "gvim", "Gvim"
so I changed my config
Code: | Style "Gvim" Maximize |
but it still doesn't work |
That's because 'Maximize' is not a style condition -- it's an operation. So you really should use FvwmEvent, as in:
Code: |
DestroyModuleConfig FE-gvim: *
*FE-gvim: Cmd Function
*FE-gvim: add_window myFunc
DestroyFunc myFunc
AddToFubc myFunc
+ I ThisWindow (Gvim, !Maximized) Maximize
Module FvwmEvent FE-gvim
|
-- Thomas Adam |
|
Back to top |
|
|
tmske Tux's lil' helper
Joined: 19 May 2005 Posts: 141
|
Posted: Sat Nov 12, 2005 2:50 pm Post subject: |
|
|
I got it working with your help, but I don't completly understand how this works,
and would it be better if I did this for every window that I want to have maximized? |
|
Back to top |
|
|
i92guboj Bodhisattva
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Sat Nov 12, 2005 2:57 pm Post subject: |
|
|
As Thomas said, Maximize is not an style option, check "man fvwm" to see the options of the command style.
Code: |
DestroyModuleConfig FE-gvim: *
*FE-gvim: Cmd Function
*FE-gvim: add_window myFunc
DestroyFunc myFunc
AddToFubc myFunc
+ I ThisWindow (Gvim, !Maximized) Maximize
Module FvwmEvent FE-gvim
|
To understan this code you should check the man page for FvwmEvent (man FvwmEvent). FvwmEvent is an external fvwm module that can bind certain events to actions. Here:
Code: |
DestroyModuleConfig FE-gvim: *
*FE-gvim: Cmd Function
*FE-gvim: add_window myFunc
|
You create a new FvwmEvent instance called "FE-gvim" and bind the "add_window" event to a function called "myFunc". That event is thrown each time that a window is created. Of course, you need to define that function (more about functions in fvwm man page), in this case the function is this:
Code: |
DestroyFunc myFunc
AddToFubc myFunc
+ I ThisWindow (Gvim, !Maximized) Maximize
|
That basically, checks all windows, and if they are identifiable as "Gvim" and are "!Maximimized" (not maximized) then the function maximizes it.
The last line:
Code: |
Module FvwmEvent FE-gvim
|
Just launch the module FvwmEvent instance called FE-gvim (and uses the config lines starting in "FE-gvim: ...." to configure it. You could launch the module in any other place, for instance in the startfunction or whatever you like better. |
|
Back to top |
|
|
ThomasAdam Guru
Joined: 20 Mar 2005 Posts: 448 Location: England
|
Posted: Sat Nov 12, 2005 3:01 pm Post subject: |
|
|
tmske wrote: | and would it be better if I did this for every window that I want to have maximized? |
Then in the 'myFunc ' Function, you can specify window classes thus:
Code: |
DestroyFunc myFunc
AddToFubc myFunc
+ I ThisWindow ("Gvim|XEdit|XTerm", !Maximized) Maximize
|
The "|" acts as an "Or" operator in this context.
-- Thomas Adam |
|
Back to top |
|
|
tmske Tux's lil' helper
Joined: 19 May 2005 Posts: 141
|
Posted: Sat Nov 12, 2005 3:13 pm Post subject: |
|
|
Thanks both, I believe I get it.
I have two little other questions, about conky and sylpheed.
First question
I want to use conky but if I start it I don't see anything and I get this error.
Code: | ~ $ conky
Conky: can't load font '-xos4-terminus-medium-r-normal--14-140-72-72-c-80-iso8859-1'
call failed
Conky: drawing to subwindow of root window (4003f7)
Conky: drawing to double buffer
call failed
call failed
call failed
$ |
Edit: I solved the call failed error, but I still don't see anything on screen
Second question
I use sylpheed as mailprogram and also use gmrun. I use mailto:email@qskfd.com. And say to gmrun to open a compose window in sylpheed.
However I have set sylpheed to always start on desktop 3, but now this compose windows also starts on window 3, but I want it just started where I am at the moment
Last edited by tmske on Sat Nov 12, 2005 3:27 pm; edited 1 time in total |
|
Back to top |
|
|
geniux Veteran
Joined: 19 Feb 2004 Posts: 1400 Location: /home
|
Posted: Sat Nov 12, 2005 3:16 pm Post subject: |
|
|
Thanks 6thpink, that helped me out a bit One more thing though:
Where can I get the FvwmClockAndDate script? I don't seem to have it. And where do I put it? Would $[FVWM_USERDIR] do? _________________ AMD Athlon64 X2 4200+ AM2
MSI K9N SLI Platinum, Enermax Liberty 500W
1GB RAM Crucial DDR2 667MHz, MSI nVidia 7600GS 256MB
400GB + 250GB Samsung SATAII HDD
Gentoo - BeyondSources 2.6.19-20 |
|
Back to top |
|
|
tmske Tux's lil' helper
Joined: 19 May 2005 Posts: 141
|
Posted: Sat Nov 12, 2005 3:34 pm Post subject: |
|
|
I found that running conky with -o works, but is this necessary? I would want it to just sit in the background.
And does somebody know a good place where I could find conkyrc files? |
|
Back to top |
|
|
i92guboj Bodhisattva
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Sat Nov 12, 2005 3:39 pm Post subject: |
|
|
ThomasAdam wrote: |
The "|" acts as an "Or" operator in this context.
-- Thomas Adam |
Did not think about that, always used separated lines for each class, good point! Thanks for that info, 3 lines are going to be deleted from my config
tmske wrote: |
Code: | ~ $ conky
Conky: can't load font '-xos4-terminus-medium-r-normal--14-140-72-72-c-80-iso8859-1'
call failed
Conky: drawing to subwindow of root window (4003f7)
Conky: drawing to double buffer
call failed
call failed
call failed
$ |
|
Emerge terminus font if you want to use it, or configure conky to use another font, to take rid of the font error message, anyway, I doubt that is a critical one (conky should run with the default font as "-misc-fixed-whatever" if terminus is not availabe. So the big error is in another place, almost for sure. Try running without double buffer. Does it work when you run it from an xterm instead of trying to swallow it?
Second question
tmske wrote: |
I use sylpheed as mailprogram and also use gmrun. I use mailto:email@qskfd.com. And say to gmrun to open a compose window in sylpheed.
However I have set sylpheed to always start on desktop 3, but now this compose windows also starts on window 3, but I want it just started where I am at the moment |
Easy task. The compose window has the same class "Sylpheed" but has a different resource name "compose". You can use that in a Style command, just make sure you define it after defining the sylpheed style. I think that should work (not tested though).
geniux wrote: | Thanks 6thpink, that helped me out a bit One more thing though:
Where can I get the FvwmClockAndDate script? I don't seem to have it. And where do I put it? Would $[FVWM_USERDIR] do? |
You can use this one as a starting point, there are some variables like $ThemeClockFont and $CS_Font, erase them and put a valis colorset and a valid font instead, you may also want to delete the Set CS_Clock line and adjust the WindowSize and Size values to fit in your panel, just try and test, since the correct value might depend on the size of the cell, the border, the padding and some other values:
Code: |
WindowTitle {FvwmScript-Clock}
WindowSize 122 24 # Size
WindowPosition 0 0 # Position
Colorset 1
Init
Begin
Set $AHour=(GetOutput {date '+%a %d %b %y - %H:%M'} 1 -1)
Set $ThemeClockFont = (GetOutput {echo $ThemeClockFont} 1 -1)
Set $CS_clock = (GetOutput {echo $CS_clock} 1 -1)
ChangeColorset 1 $CS_clock
ChangeFont 1 $ThemeClockFont
ChangeTitle 1 $AHour
End
PeriodicTasks
Begin
If (RemainderOfDiv (GetTime) 60)==0 Then
Begin
Set $AHour=(GetOutput {date '+%a %d %b %y - %H:%M'} 1 -1)
ChangeTitle 1 $AHour
End
End
Widget 1
Property
Size 122 24
Position 0 0
Type ItemDraw
End
|
You can put this in any place, just call it with something like .....Swallow 'FvwmScript-Clock' `Module FvwmScript $[fvwm_scripts]/FvwmScript-Clock`. Where $[fvwm_scripts] can be a variable (for example $[FVWM_USER]) or a path, like ~/.fvwm or /home/foo/.fvwm/scripts/.
Note: You might also want to alter the time and date format, I think that is easy enough to figure, but ask here if you run into problems.
EDIT: Corrected swallow line. |
|
Back to top |
|
|
tmske Tux's lil' helper
Joined: 19 May 2005 Posts: 141
|
Posted: Sat Nov 12, 2005 3:56 pm Post subject: |
|
|
Quote: | Easy task. The compose window has the same class "Sylpheed" but has a different resource name "compose". You can use that in a Style command, just make sure you define it after defining the sylpheed style. I think that should work (not tested though).
|
I try that, but how can I override that the compose window starts at the current page?
Can I use StartsOnPage to say that it must open on the current page? |
|
Back to top |
|
|
geniux Veteran
Joined: 19 Feb 2004 Posts: 1400 Location: /home
|
Posted: Sat Nov 12, 2005 4:02 pm Post subject: |
|
|
Thanks
Ok questions:
How do I change fonts? The color wont set, whatever I do I'll get a white bg with black text. Which takes me to the other question, how do I change the fontcolor? And finally, the size wont cooperate with my appbar settings, it steals a column.
Oh, is it possible to break the clock/date, so I'll get the clock above the date? Preferably with different fontsize _________________ AMD Athlon64 X2 4200+ AM2
MSI K9N SLI Platinum, Enermax Liberty 500W
1GB RAM Crucial DDR2 667MHz, MSI nVidia 7600GS 256MB
400GB + 250GB Samsung SATAII HDD
Gentoo - BeyondSources 2.6.19-20 |
|
Back to top |
|
|
ThomasAdam Guru
Joined: 20 Mar 2005 Posts: 448 Location: England
|
Posted: Sat Nov 12, 2005 4:04 pm Post subject: |
|
|
tmske wrote: | Quote: | Easy task. The compose window has the same class "Sylpheed" but has a different resource name "compose". You can use that in a Style command, just make sure you define it after defining the sylpheed style. I think that should work (not tested though).
|
I try that, but how can I override that the compose window starts at the current page?
Can I use StartsOnPage to say that it must open on the current page? |
Just don't provide a style line for it -- then it will open up whever you are.
-- Thomas Adam |
|
Back to top |
|
|
ThomasAdam Guru
Joined: 20 Mar 2005 Posts: 448 Location: England
|
Posted: Sat Nov 12, 2005 4:08 pm Post subject: |
|
|
geniux wrote: | Thanks
Ok questions:
How do I change fonts? The color wont set, whatever I do I'll get a white bg with black text. Which takes me to the other question, how do I change the fontcolor? |
I assume this is the font for things like titlebars? You can set:
Code: | Style * Font <whatever> |
for that. As for the colour, that's down to your Colorsets:
Code: |
Colorset 1 fg white, bg blue
Colorset 2 fg black, bg lightgrey
|
You might then decide to apply them to windows that have and do not have focus, as in:
Code: |
Style * Colorset 1
Style * HilightColorset 2
|
geniux wrote: |
And finally, the size wont cooperate with my appbar settings, it steals a column. |
You'll have to be more specific.
geniux wrote: |
Oh, is it possible to break the clock/date, so I'll get the clock above the date? Preferably with different fontsize |
It is if you change the approriate items to use different widgets.
-- Thomas Adam |
|
Back to top |
|
|
tmske Tux's lil' helper
Joined: 19 May 2005 Posts: 141
|
Posted: Sat Nov 12, 2005 4:08 pm Post subject: |
|
|
ThomasAdam wrote: | tmske wrote: | Quote: | Easy task. The compose window has the same class "Sylpheed" but has a different resource name "compose". You can use that in a Style command, just make sure you define it after defining the sylpheed style. I think that should work (not tested though).
|
I try that, but how can I override that the compose window starts at the current page?
Can I use StartsOnPage to say that it must open on the current page? |
Just don't provide a style line for it -- then it will open up whever you are.
-- Thomas Adam |
I have to set a line because the compose window has the same class as sylpheed and sylpheed sit's on desktop3. But I don't want the compose window to go there |
|
Back to top |
|
|
ThomasAdam Guru
Joined: 20 Mar 2005 Posts: 448 Location: England
|
Posted: Sat Nov 12, 2005 4:11 pm Post subject: |
|
|
tmske wrote: | I have to set a line because the compose window has the same class as sylpheed and sylpheed sit's on desktop3. But I don't want the compose window to go there |
Oh right. Match it based on window title.
-- Thomas Adam |
|
Back to top |
|
|
i92guboj Bodhisattva
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Sat Nov 12, 2005 4:14 pm Post subject: |
|
|
geniux wrote: | Thanks
Ok questions:
How do I change fonts? The color wont set, whatever I do I'll get a white bg with black text. Which takes me to the other question, how do I change the fontcolor? And finally, the size wont cooperate with my appbar settings, it steals a column.
Oh, is it possible to break the clock/date, so I'll get the clock above the date? Preferably with different fontsize |
The colorset should be changeable in the 4th line, with the Colorset statement. Check the man page for FvwmScript for further info on customizing colorsets in fvwmscripts.
To separate the time and date you might need to define two widgets, and use each time a different string for the time, for example use Set $AHour=(GetOutput {date '+%H:%M'} 1 -1) in one widget and Set $AHour=(GetOutput {date '+%a %d %b %y'} 1 -1) in another. You will need to change both the Initial and Periodic tasks. |
|
Back to top |
|
|
tmske Tux's lil' helper
Joined: 19 May 2005 Posts: 141
|
Posted: Sat Nov 12, 2005 4:25 pm Post subject: |
|
|
ThomasAdam wrote: | tmske wrote: | I have to set a line because the compose window has the same class as sylpheed and sylpheed sit's on desktop3. But I don't want the compose window to go there |
Oh right. Match it based on window title.
-- Thomas Adam |
I know how to match it, but don't know how to say it must open on the current desktop and not on desktop 3 |
|
Back to top |
|
|
ThomasAdam Guru
Joined: 20 Mar 2005 Posts: 448 Location: England
|
Posted: Sat Nov 12, 2005 4:31 pm Post subject: |
|
|
tmske wrote: | I know how to match it, but don't know how to say it must open on the current desktop and not on desktop 3 |
Code: |
Style "what ever" StartsAnyWhere
|
-- Thomas Adam |
|
Back to top |
|
|
tmske Tux's lil' helper
Joined: 19 May 2005 Posts: 141
|
Posted: Sat Nov 12, 2005 4:37 pm Post subject: |
|
|
Thanks most of the things work now,
I love fvwm, why didn't I found this earlier....
Now I would just want to find some nice config file for Eterm and I have the most set up.
Thanks a lot for all the help! |
|
Back to top |
|
|
geniux Veteran
Joined: 19 Feb 2004 Posts: 1400 Location: /home
|
Posted: Sat Nov 12, 2005 4:45 pm Post subject: |
|
|
Hmm, made the changes. Now I have the right bg but no text what so ever.
Here's my edited FvwmScript
Code: |
WindowTitle {FvwmScript-Clock}
WindowSize 124 64 # Size
WindowPosition 0 0 # Position
Colorset 18 fg #fff, bg #485c7b
Init
Begin
Set $AHour=(GetOutput {date '+%H:%M'} 1 -1)
Set $AHour=(GetOutput {date '+%a %b %d %y'} 1 -1)
Set $ThemeClockFont = (GetOutput {echo $ThemeClockFont} 1 -1)
ChangeColorset 18 $CS_clock
ChangeFont 1 $ThemeClockFont
ChangeTitle 1 $AHour
End
PeriodicTasks
Begin
If (RemainderOfDiv (GetTime) 60)==0 Then
Begin
Set $AHour=(GetOutput {date '+%H:%M'} 1 -1)
Set $AHour=(GetOutput {date '+%a %b %d %y'} 1 -1)
ChangeTitle 1 $AHour
End
End
Widget 1
Property
Size 124 64
Position 0 0
Type ItemDraw
End |
I must have missed something _________________ AMD Athlon64 X2 4200+ AM2
MSI K9N SLI Platinum, Enermax Liberty 500W
1GB RAM Crucial DDR2 667MHz, MSI nVidia 7600GS 256MB
400GB + 250GB Samsung SATAII HDD
Gentoo - BeyondSources 2.6.19-20 |
|
Back to top |
|
|
i92guboj Bodhisattva
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Sat Nov 12, 2005 5:07 pm Post subject: |
|
|
This might be a closer attemp of what you want. I advise you to run it without swallowing, for example from a FvwmConsole, while you are writing or midifying it, so, you make sure that the problems are not related to the layout of FvwmButtons.
Code: |
WindowTitle {FvwmScript}
WindowSize 124 128 # Size
WindowPosition 50 50 # Position
Colorset 1
Font "xft:Comic Sans MS"
Init
Begin
Set $AHour=(GetOutput {date '+%H:%M'} 1 -1)
Set $ADate=(GetOutput {date '+%a %b %d %y'} 1 -1)
ChangeTitle 1 $AHour
ChangeTitle 2 $ADate
End
PeriodicTasks
Begin
If (RemainderOfDiv (GetTime) 60)==0 Then
Begin
Set $AHour=(GetOutput {date '+%H:%M'} 1 -1)
Set $ADate=(GetOutput {date '+%a %b %d %y'} 1 -1)
ChangeTitle 1 $AHour
ChangeTitle 2 $ADate
End
End
Widget 1
Property
Size 124 64
Position 0 0
Type ItemDraw
End
Widget 2
Property
Size 124 64
Position 0 64
Type ItemDraw
End
|
Save it with any name, for example FvwmScript-ClockAndDate and run it from FvwmConsole this way:
Code: |
FvwmScript <path>/FvwmScript-TimeAndDate
|
Once you make sure that it works as a standalone application, you can swallow it. The name that you need to swallow it is the one that appears in the script in the WindowTitle line.
EDIT: If you want to learn more, in adicction to the man page you can also check all of these:
Code: |
/usr/share/fvwm/FvwmScript-BaseConfig
/usr/share/fvwm/FvwmScript-BellSetup
/usr/share/fvwm/FvwmScript-Buttons
/usr/share/fvwm/FvwmScript-Colorset
/usr/share/fvwm/FvwmScript-ComExample
/usr/share/fvwm/FvwmScript-Date
/usr/share/fvwm/FvwmScript-FileBrowser
/usr/share/fvwm/FvwmScript-Find
/usr/share/fvwm/FvwmScript-KeyboardSetup
/usr/share/fvwm/FvwmScript-PointerSetup
/usr/share/fvwm/FvwmScript-Quit
/usr/share/fvwm/FvwmScript-ScreenDump
/usr/share/fvwm/FvwmScript-ScreenSetup
/usr/share/fvwm/FvwmScript-Setup95
/usr/share/fvwm/FvwmScript-WidgetDemo
/usr/share/fvwm/fvwm-script-ComExample.pl
/usr/share/fvwm/fvwm-script-setup95.pl
|
|
|
Back to top |
|
|
geniux Veteran
Joined: 19 Feb 2004 Posts: 1400 Location: /home
|
Posted: Sat Nov 12, 2005 6:06 pm Post subject: |
|
|
Now it shows
But the date wont show, might be because I had to change the size. Cause it went over the edges and some apps when it was swallowed, so I had to shrink it a bit. How can I get the date showing again, it works with the original sizes
Thanks again _________________ AMD Athlon64 X2 4200+ AM2
MSI K9N SLI Platinum, Enermax Liberty 500W
1GB RAM Crucial DDR2 667MHz, MSI nVidia 7600GS 256MB
400GB + 250GB Samsung SATAII HDD
Gentoo - BeyondSources 2.6.19-20 |
|
Back to top |
|
|
i92guboj Bodhisattva
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Sat Nov 12, 2005 6:11 pm Post subject: |
|
|
You need to playe with the values of size and position for the widget1 and widget2, and also make sure that both these combine ok with the windowsize value. To make an idea on whats going on I suggest you to try to use (just to test) two different colorsets, one for each widget, and preferably solid, so you can see better. That way you can make sure if the widget2 (which contains date) is missplaces, or does not fit because of a space problem, or if it is not displayed at all. If you are going to pile the one in top of the other make sure that the sum of Y values for the Size parameter does not exceed the Y value for WindowSize. |
|
Back to top |
|
|
tmske Tux's lil' helper
Joined: 19 May 2005 Posts: 141
|
Posted: Sun Nov 13, 2005 12:14 pm Post subject: |
|
|
I would like to know how I can make a function in fvwm to open ncmpc(or any other program) in a terminal.
I believe this is possible but I can't find out how. |
|
Back to top |
|
|
ThomasAdam Guru
Joined: 20 Mar 2005 Posts: 448 Location: England
|
Posted: Sun Nov 13, 2005 12:18 pm Post subject: |
|
|
tmske wrote: | I would like to know how I can make a function in fvwm to open ncmpc(or any other program) in mjr + morrisseya terminal.
I believe this is possible but I can't find out how. |
Code: |
DestroyFunc OpenNcmpc
AddToFunc OpenNcmpc
+ I Exec exec rxvt -e ncmpc
|
You can make it generic if you wanted:
Code: |
DestroyFunc OpenNcmpc
AddToFunc OpenNcmpc
+ I Exec exec rxvt -e "$0"
OpenNcmpc ncmpc
|
If you wanted to specify the terminal emulator as well:
Code: |
DestroyFunc OpenNcmpc
AddToFunc OpenNcmpc
+ I Exec exec "$0" -e "$1"
OpenNcmpc xterm ncmpc
|
-- Thomas Adam |
|
Back to top |
|
|
|