Changing default View/Gravity

Added by S H over 6 years ago

Hello,

First of all I'd like to say what an awesome WM you have created here it's looks really interesting.
Unfortunately for me I have no ruby skills so for me not all the configs are that clear.
I have managed with most I wanted but one presumably simple thing I can't seem to get.

I'd like all programs in the first view (terms) to open in a floating style and not fullscreen, preferably top left.
Is that possible?

Thank you very much.


Replies (9)

RE: Changing default View/Gravity - Added by Christoph Kappel over 6 years ago

Hello,

thank you, always nice to start with something like this. :)

The config of subtle is generally designed to require almost no ruby knowledge and includes a great amount of docs. Over the time you will learn what you can do if you dig a bit deeper with e.g. subtlext.

Per default, subtle sets the center gravity to untagged clients, this default can be changed. When you know what kind of windows you want to set float or top left gravity you can just do that like following examples:

Numbers: on /off 1 # Set float
 2 tag "float" do
 3   match "windowname" 
 4   float true
 5 end
 6 
 7 # Set topleft gravity
 8 tag "topleft" do
 9   match "windowname" 
10   gravity :top_left
11 end

When you do that, you need to add this tags to the tags of your view like.

If you have further questions about tagging please read the tagging wiki page and if this doesn't cover either ask here again or visit us in #subtle on irc.freenode.org (IRC).

RE: Changing default View/Gravity - Added by S H over 6 years ago

Now that was a fast reply thank you!
I did read the tagging wiki but that part still wasn't clear to me.
Together with your example though I think I might got it.
I let you know the results.....

RE: Changing default View/Gravity - Added by Christoph Kappel over 6 years ago

Hm, it's always difficult for a devel to write docs for non-devels. Can you tell me, what exactly is unclear after reading the wiki?

RE: Changing default View/Gravity - Added by S H over 6 years ago

OK I tried but with just a little success.

tag "terms" do
match "urxvt"
gravity :center33
end

Got me my terminal where I wanted it.
What I'd like now is my filemanger to open "top_left".
And if possible all other programs within the "terms" window to open top_right by default.
If the default is not possible I would have no problem with creating a tag for my most used programs.

What I tried so far is
tag "terms" do
match "pcmanfm"
gravity :top_left
end

That did not work. You mentioned I would have to

When you do that, you need to add this tags to the tags of your view like.

I'm not quite sure what that means....

Thank you!

RE: Changing default View/Gravity - Added by Christoph Kappel over 6 years ago

With tags you can set stuff like gravities per matching view. A view must have the same [[tagging]tag]] like the window:

Numbers: on /off1 tag "test" do
2   match "windowname" 
3   gravity :top
4 end
5 
6 view "view", "test" 

The second part of the view definition is a regexp.

The all other windows on view is a bit problematic, because you can add tags that apply to all windows on a certain view but need to add all windows that should be on a view to a tag like:

Numbers: on /off1 tag "test" do
2   match "windowname1|windowname2|windowname3" 
3   gravity :top
4 end

Actually I am just thinking, if it has any benefit to be able to set e.g. a default gravity view-wise instead of system-wide.

RE: Changing default View/Gravity - Added by S H over 6 years ago

Thanks again for replying.
Do I get this right

Do I add the tag name to the view I want? For example.

view "view", "terms|default"|"test"

And can then use this tag as described in your example?

or do I have to create a entire new view? Because I don't want to add another to the panel.

To set the default gravity view-wise instead of system wide I think wouldn't be bad.
The browser view fullscreen of course but the the terms/default view not, in my humble opinion.

Anyway I appreciate your help.
Will work on this with some trial and error route...

RE: Changing default View/Gravity - Added by Christoph Kappel over 6 years ago

Just add the test tag like you would add another value to regexp:

1 view "view" "terms|default|test"

RE: Changing default View/Gravity - Added by S H over 6 years ago

YES!
Many thanks!
Added "topleft" to view "view" "terms|default" and then used the tag and got what I wanted exactly!
I think I got the picture now!
I appreciate it!

RE: Changing default View/Gravity - Added by Christoph Kappel over 6 years ago

You are welcome, once you understand it it's really straight forward.

(1-9/9)