subtle isn't dead yet! (1 comment)

Added by Christoph Kappel over 3 years ago


if anyone noticed, I couldn't make it to this year's FrOSCon, I rather spent the time sick in bed, so I hope you enjoyed it even without a subtle booth.

I took quite a long break from development, toying around with some Android ideas and dealing with some nasty project deadlines. Nevertheless, the project isn't dead yet, I actively use it daily and I am still very pleased and still want to go on.

There are some features that currently aren't pushed like virtual screen splitting, but I am eager to make them available once I finished the styling thing I have in my mind.

So be patient with me.

Spawn now belongs to Subtlext::Client

Added by Christoph Kappel about 4 years ago

TL;DR: I moved the .spawn method to the clients module so update subtle AND subtle-contrib

Previously the .spawn method belonged to Subtlext::Subtle, which was fine until I changed it to return a valid client object that is backed with some light event caching to make it useful for e.g. the launcher. Since it returns a real object I think it should belong to Subtlext::Client, end of story.

Edit: This change also breaks the scratchpad snippet, so make sure to change Subtlext::Subtle.spawn to Subtlext::Client.spawn in your config.

Tags with logic

Added by Christoph Kappel over 4 years ago

Sometimes it can be pretty nasty to add tags, when you just need something stupid to move a certain window to a view. That can be done with a loop, but that also adds lots of tags and there cannot be more than 32 of them.

An easy way to bypass this is to add logic to tags and act differently for certain clients. The latest version of subtle extends the properties with on_match. This can be used to add a Ruby proc to a tag that is called whenever the tag is applied.

The tagging page already contains a simple example, here is a more complex one that I use in my config to tag GIMP windows:

Old way:

 1 tag "gimp_image" do
 2   match    role: "gimp-image-window" 
 3   gravity  :gimp_image
 4 end
 6 tag "gimp_toolbox" do
 7   match    role: "gimp-toolbox$" 
 8   gravity  :gimp_toolbox
 9 end
11 tag "gimp_dock" do
12   match    role: "gimp-dock" 
13   gravity  :gimp_dock
14 end
16 tag "gimp_scum" do
17   match role: "gimp-.*|screenshot" 
18 end

New way:

1 tag "gimp" do
2   match role: "gimp-.*" 
4   on_match do |c|
5     c.gravity = ("gimp_" + c.role.split("-")[1]).to_sym
6   end
7 end

Both basically just sets the gravity of the matching client.

Visit us at the OpenRheinRuhr

Added by Christoph Kappel about 5 years ago

When you are located in Germany, live close to Oberhausen and have some spare time this weekend (12/13.11) visit us at our booth at the OpenRheinRuhr.

Finder in subtlext (1 comment)

Added by Christoph Kappel about 5 years ago

Finder in subtlext are used to select different kind of objects like one client or more clients based on different matching options. With the changes in r3104, #find and #[] always return an array regardless whether an object was found or not. If you need just one result use #first instead.

The changes require an update of subtle-contrib and the scratchpad snippet

Separator and styles revamped (3 comments)

Added by Christoph Kappel about 5 years ago

According to my plan, to combine styling options ultimately in the styles it is now time to move the separator. A nice side effect, is that this allows different separators for views, sublets and the panel in case you ever wanted to do that.

Another change is the removal of the unoccupied style, it made no sense at all, TBH. Unoccupied views are just views and this is probably not worth a special state. Just make sure to think twice what values are inherited now and which one you need to overwrite. (Joy of inheritance)

TL;DR: You need to update your config, again. Move the separator config option to the separator style like this:

1 # Separator between sublets
2 set :separator, "|" 
4 # Style for separator
5 style :separator do
6   foreground  "#757575" 
7 end

1 # Style for separator
2 style :separator do
3   foreground  "#757575" 
4   separator   "|" 
5 end

Move the properties from the unoccupied style to the views style:

 1 # Style for the views
 2 style :views do
 4   # Style for the active views
 5   style :focus do
 6     foreground  "#fecf35" 
 7   end
 9   # Style for urgent window titles and views
10   style :urgent do
11     foreground  "#ff9800" 
12   end
14   # Style for occupied views (views with clients)
15   style :occupied do
16     foreground  "#b8b8b8" 
17   end
19   # Style for unoccupied views (views without clients)
20   style :unoccupied do
21     foreground  "#757575" 
22   end
23 end

 1 # Style for the views
 2 style :views do
 3   foreground  "#757575" 
 5   # Style for the active views
 6   style :focus do
 7     foreground  "#fecf35" 
 8   end
10   # Style for urgent window titles and views
11   style :urgent do
12     foreground  "#ff9800" 
13   end
15   # Style for occupied views (views with clients)
16   style :occupied do
17     foreground  "#b8b8b8" 
18   end
19 end

The separator option and the unoccupied style have been removed check for deprecation warnings

Visible views

Added by Christoph Kappel over 5 years ago

During my time at the FrOSCon I had problems with multihead and views, because I couldn't see both screens at the same time.

Therefore, r3023 adds a new optional style to highlight visible views. This style defines additional values, that are assigned on top of the current style values like :occupied. I also changed the :urgent style to behave similar.

I removed the deprecated style syntax so check your config!

Visit us at the FrOSCon

Added by Christoph Kappel over 5 years ago

This year we are going to have a subtle booth at the FrOSCon. I am not actually sure what I want to present there or what I want to talk about, but we have a booth.

So if you are around - visit us.

Updated stacking and gravity tiling

Added by Christoph Kappel over 5 years ago

In case you haven't noticed yet, I rewrote the stacking code of subtle in r2986. It now keeps the windows on their stacking level and raise/lower just modifies the position on that layer.

Read more about stacking here.

And the second probably unoticed change is the addition of a more flexbile way to enable gravity tiling. Instead of just enabling it globally this can be a) done per gravity now and b) either horizontally or vertically.

Read more about gravity tiling here.

Styles revisited

Added by Christoph Kappel over 5 years ago

I did it again, Styles have changed slightly. This time without any breakage of existing configs, just expect some deprecation warnings and adopt your configs over the next weeks.

Why more changes?

The styles are a bit odd, there are some real classes and some other are mere states of a existing class. Yes, I am talking about the view styles. We have :focus, :occupied, :unoccupied and :urgent: Each inherits from :views and :views from :all and makes no sense as standalone style. So what we really need is a way to define nested styles.

Also the foreground, background, text_fg and icon_fg config option mess requires a sane solution with styles.

What has changed?

Styles can contain substyles and have a new property now, the icon property to set the color of icons in panel items using this specific style.

When there is a matching style with the name of the Sublets it uses the style and allows to style each sublet individually.

Subtle::Sublet, Subtlext::View and Subtlext::Sublet have a #style= method to set these styles.

Long story short

Overall the extended use of styles may look more complex but allows the usage of all properties.

What Before Since 2979
Nested styles
 1 style :focus do
 2   foreground "#fecf35" 
 3   background "#202020" 
 4 end
 6 style :urgent do
 7   foreground "#ff9800" 
 8   background "#202020" 
 9 end
 1 style :views do
 2   background "#202020" 
 4   style :focus do
 5     foreground "#fecf35" 
 6   end
 8   style :urgent do
 9     foreground "#ff9800" 
10   end
11 end
Styles for sublets
1 sublet :clock do
2   interval   30
3   foreground "#ff9800" 
4   icon_fg    "#777777" 
5 end
 1 style :sublets do
 2   style :clock do
 3     foreground "#ff9800" 
 4     icon       "#777777" 
 5   end
 6 end
 8 sublet :clock do
 9   interval   30
10 end
Update sublet colors
1 Subtlext::Sublet[0].foreground = "#ff0000"
 1 # Config
 2 style :sublets do
 3   style :test1 do
 4     foreground "#ff0000" 
 5   end
 7   style :test2 do
 8     foreground "#ff0000" 
 9   end
10 end
12 # Code
13 Subtlext::Sublet[0].style = :test1

1 2 3 ... 5 Next »

Also available in: Atom