subtle: Styles and cascading

Added by Christoph Kappel almost 5 years ago

Before r2939, there was just the [[Styles#All|:all]] [[Styles|style]], that could be used to initially set values for other [[Styles|styles]], but it was depend on the order of definition.

With the changes in r2939, cascading works completely now and the properties set in [[Styles#All|:all]] are just used, when the properties are unset in the specific [[Styles|styles]]. Additionally to the :all [[Styles|style]] there is now the :views [[Styles|style]] to set properties for all [[Views|view]] related [[Styles|styles]] ([[Styles#Focus|:focus]], [[Styles#Occupied|:occupied]] and [[Styles#Unoccupied|:unoccupied]]).

The previous [[Styles#Views|:views]] [[Styles|style]] has been renamed to [[Styles#Unoccupied|:unoccupied]].

subtle: Updated finder in subtlext

Added by Christoph Kappel almost 5 years ago

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:

1 Subtlext::Client['center$']

r2921 for the help!

The updates finders work a bit different than before:

  1. Finders can return multiple matches as array or a single object
  2. Symbols require exact matches and are case-sensitive

Here is a small comparison to see what the different arguments really do:

Argument Code Result
1 Subtlext::Gravity[13]
1 Subtlext::Gravity['center']
[ #<Subtlext::Gravity:xxx>, <Subtlext::Gravity:xxx>, #<Subtlext::Gravity:xxx> ]
1 Subtlext::Gravity['center$']
1 Subtlext::Gravity[:center]

subtle: Updated gravities

Added by Christoph Kappel about 5 years ago

I really have no idea, when/why I introduced the odd calculation of the x and y value of [[gravity|gravities]]. In fact it is really difficult and most of my custom [[gravity|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 ]
 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]
 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 ]

The consequences of this change are that you need to replace all current [[gravity|gravities]] by the ones in the default config and/or you need to re-do all custom created [[gravity|gravities]].

subtle: Updated tag handling

Added by Christoph Kappel about 5 years ago

[[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 [[tagging|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.

Before r2813:

 1 tag "test1" do
 2   match   :instance => "test" 
 3   exclude :class    => "XTerm" 
 4 end
 6 tag "test2" do
 7   match   :instance => "test" 
 8   exclude :class    => "XTerm" 
 9 end


1 tag "test" do
2   match :instance => "test", :class => "urxvt" 
3 end

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 [[tagging|tagged]] and not match all and exclude some.

The common use case is a [[tagging|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.

1 tag "terms" do
2   match "urxvt" 
3   exclude "irssi|ncmpcpp|ranger" 
4 end


1 tag "terms" do
2   match :instance => "urxvt" 
3 end


subtle: Colors gone, welcome styles!

Added by Christoph Kappel about 5 years ago

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 [[Styles#Borders|borders]], [[Styles#Padding|padding]] and [[Styles#Margin|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
:gap [[Styles#Clients|Client margin]]
:border [[Styles#clients|Client active/inactive]]
:strut [[Styles#Subtle|Subtle padding]]
:outline [[Styles#Border|Border property]]
:padding [[Styles#Padding|Padding property]]

The migration script helps with adapting an existing config to the new format.

Update: In r2800 I removed the forced 3px spacing on the left and right side of each [[Panel#Item-types|panel item]]. You can easily update the [[Styles#Padding|padding]] options if you need it back. This was necessary to provide coherent spacing.

subtle: 0.9.2773 released

Added by Christoph Kappel about 5 years ago

This release includes minor bug fixes, updated handling of grabs in sublets, double buffering and improved stippling for panels and emacs-style keychains.

subtle: Panel patterns

Added by Christoph Kappel over 5 years ago

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

subtle: Grabs in sublets revisited

Added by Christoph Kappel over 5 years ago

Until now, [[sublets]] could use [[grabs]], but needed to fetch the actual key chains from the [[sublets|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 [[sublets|sublet]] author to provide the required information in the spec.

subtle: Adding complexity to grabs

Added by Christoph Kappel over 5 years ago

Speaking about [[grabs]], we have the easy ones and the hacky ones with with the escape [[grabs|grab]]. When we use the escape grab, we use it for all [[grabs]], which might be odd.

r2091 for the rescue: Now, the extended [[grabs|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.

subtle-contrib: Launcher revisited (2 comments)

Added by Christoph Kappel over 5 years ago

Time (r65) to get rid of some annoying aspects of the [[wiki#Launcher|launcher]].

These changes require at least subtle r2470 or higher.


Fonts can now be configured once after load and work in the same way as in subtle:

Numbers: on /off 1 begin
 2   require "#{ENV["HOME"]}/path/to/launcher.rb" 
 4   # Set fonts
 5   Subtle::Contrib::Launcher.fonts = [
 6     "xft:DejaVu Sans Mono:pixelsize=80:antialias=true",
 7     "xft:DejaVu Sans Mono:pixelsize=12:antialias=true" 
 8   ]
 9 rescue LoadError => error
10   puts error
11 end

Window modes

Besides tags and views, the [[wiki#Launcher|launcher]] can set window modes directly. E.g. ^urxvt will open a floating urxvt. Following windows modes are possible and can be intermixed:

Mode Meaning
+ Full screen mode
^ Floating mode
* Sticky mode


On multihead displays, the [[wiki#Launcher|launcher]] will now appear on the current screen.

« Previous 1 2 3 4 5 Next »

Also available in: Atom