Styles and cascading
Before r2939, there was just the :all style, that could be used to initially set values for other styles, but it was depend on the order of definition.
With the changes in r2939, cascading works completely now and the properties set in :all are just used, when the properties are unset in the specific styles. Additionally to the :all style there is now the :views style to set properties for all view related styles (:focus, :occupied and :unoccupied).
Updated finder in subtlext
Let us start from the beginning before I go on about the recent changes in r2921.¶
There are finders inside of subtlext to find subtle objects from the Ruby side. They are available for most of the subtlext objects (excluded are just Color, Geometry and Icon) and can be used either with the #find method or when you are lazy like me with #. They support multiple argument types like fixnum, string and symbols and they can only return one match.
1 Subtlext::Client['urxvt'] 2 => #<Subtlext::Client:xxx>
Q: What happens, when there is more than one client with that name, which one is returned and how can I access both?
A: Nothing happens, the first found client is returned and there is no way to access the other match from the finder.
Q: What happens, when I have multiple urxvts with names like urxvt1, urxvt2?
A: Nothing happens, the first found client is still returned, the input string 'urxvt' can match partially.
Q: How can I match case-sensitive?
A: There is currently no way, sorry.
Q: How can find e.g. the gravity center, when I have center, center33 and center66?
A: Use the end of line symbol:
r2921 for the help!¶
The updates finders work a bit different than before:
- Finders can return multiple matches as array or a single object
- Symbols require exact matches and are case-sensitive
Here is a small comparison to see what the different arguments really do:
|[ #<Subtlext::Gravity:xxx>, <Subtlext::Gravity:xxx>, #<Subtlext::Gravity:xxx> ]|
I really have no idea, when/why I introduced the odd calculation of the x and y value of gravities. In fact it is really difficult and most of my custom gravities are a product of trial'n'error.
Therefore r2829 removes the odd logic and replaces it by something understandable:
- X value is the screen width in percent used for placement in X direction
- Y value is the screen height in percent used for placement in Y direction
- WIDTH value is the screen width in percent
- HEIGHT value is the screen height in percent
Here are some example:
1 # Move a window with half the width and 2 # height of the screen to the screen center 3 gravity :center, [ 25, 25, 50, 50 ] 4 5 # Move a window with half the width and 6 # height of the screen to the top right corner 7 gravity :top_right, [ 50, 0, 50, 50] 8 9 # Show a window with 80% of the width and 10% of the 10 # height centered in the lower third of the screen 11 gravity :foo, [ 10, 80, 80, 10 ]
Updated tag handling
Tagging is a double edged sword, some windows especially terminals are really difficult to tag, because they usually retain their class value like URxvt and all tags that include urxvt match every instance. To make this easier there is the exclude match to sort this cases out.
Exclude was just a mere hack, hence in r2813 this hack is replaced by a more sophiscated way. Matching values can now be combined in a logic AND fashion.
Following example, there are two terminals, one urxvt and one xterm with following data:
0x600009 * 0 0 x 408 + 796 + 388 bottom ---- foo (URxvt) 0x800022 * 0 0 x 16 + 796 + 388 top ---- foo (XTerm)
Matching both windows is easy based on the class, but difficult based on the instance name.
Too make long story short: Match allows to combine different values for a finer grained control.
Update: The removal of the exclude option lead to confusion, in fact in all cases the option was horribly misused. The correct way is to match the clients that should be tagged and not match all and exclude some.
The common use case is a tag for all urxvt's without -name, but knowing that -name basically just changes the instance value (first string) of WM_CLASS this is just wrong.
Colors gone, welcome styles!
Over time more and more config options were added and complex panel settings required often quirks or even setting names were misleading. Starting with r2786 the old color system is completely replaced by CSS-like styles. With the new styles it is possible to set borders, padding and margins individually for each panel item. The styles wikipage shows a list of all properties and styleable items.
Some of the settings were renamed to style properties, following table shows the changes:
|Old setting||New style property|
Update: In r2800 I removed the forced 3px spacing on the left and right side of each panel item. You can easily update the padding options if you need it back. This was necessary to provide coherent spacing.
This release includes minor bug fixes, updated handling of grabs in sublets, double buffering and improved stippling for panels and emacs-style keychains.
Since the early days of subtle it is possible to enable stipple on the panels. If you haven't even used it and always wondered about the odd stipple color and the screen option: This draws a hardcoded pattern on the panels and obviously the stipple color is used for that.
Based on a question in the IRC channel I removed this hardcoded pattern and added an option to provide a custom X BitMap. (r2650) I know the limits of this and it might be completely useless for most of you, but it's always good to make this a bit more customizable.
I won't add any graphic lib to make a decent background mapping possible.
1 screen 1 do 2 stipple "~/stipple.xbm" 3 top [ :views, :title, :spacer, :keychain, :spacer, :tray, :sublets ] 4 bottom  5 end
Grabs in sublets revisited
Until now, sublets could use grabs, but needed to fetch the actual key chains from the sublet config. This is a bit messy and opaque. The recent changes in r2608 ease that: Sublets just provide grabs now and they can be used like all other grabs in the main config. Like the notes and config information sur can also list information about possible grabs of sublets, but it's up to the sublet author to provide the required information in the spec.
Adding complexity to grabs
Speaking about grabs, we have the easy ones and the hacky ones with with the escape grab. When we use the escape grab, we use it for all grabs, which might be odd.
r2091 for the rescue: Now, the extended grab system allows emacs like key chains like this:
1 grab "C-a c", "urxvt" 2 grab "S-a A-b C-c", "xmessage 'Broken fingers'"
Since chains can be pretty complicated, there is the :keychain panel item. It displays the current chained grabs like S-a A-b if any and is otherwise just blank. Chains can be aborted by pressing any non-modifier key, basically by any key that doesn't belong to the current chain.
There is no drawback or additional overhead for users that don't use chains.
Urgent and icons revisited
Currently, the urgent color triplet just overwrites the colors for e.g. the current highlighted view, when a window becomes urgent which is fine. Now (>r2450) we have the title triplet, which allows to use another border style or another background.This would require two different triplets of colors:
- for views
- for title
To avoid that, the urgent colors are now optional and can be applied partially. So e.g. if we set only the urgent_fg color, this will be used to show that something is urgent.
There are two new things regarding icons:
- Icons can be used standalone in the panel now (r2264):
Numbers: on /off
1 icon = Subtlext::Icon.new("arch.xbm") 2 screen 1 do 3 top [ icon, :title, :spacer, :views ] 4 botton [ icon, :spacer, icon ] 5 end
- View buttons can contain an icon (r2400), nothing new so far. Since r2464 they can contain just the icon without the text, which is nice for smaller displays:
Numbers: on /off
1 view "terms" do 2 match "urxvt" 3 icon "terms.png" 4 icon_only true 5 end
Also available in: Atom