Project

General

Profile

unexist.dev

subtle

Assorted tidbits and projects

News

Grabs in sublets revisited

Added by Christoph Kappel about 13 years ago

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

Added by Christoph Kappel about 13 years ago

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:

grab "C-a c", "urxvt" 
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

Added by Christoph Kappel over 13 years ago

Urgent

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:
  1. for views
  2. 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, only this will be used to show that something is urgent.

Icons

There are two new things regarding icons:

  1. Icons can be used standalone in the panel now (r2264):
    {{hide}}icon = Subtlext::Icon.new("arch.xbm")
    screen 1 do
      top    [ icon, :title, :spacer, :views ]
      botton [ icon, :spacer, icon ]
    end
  2. 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:
    {{hide}}view "terms" do
      match     "urxvt" 
      icon      "terms.png" 
      icon_only true
    end

Icons, colors and dynamic

Added by Christoph Kappel over 13 years ago

The current devel version (r2429) brings more changes to the config, sorry.

Icons

The first, harmless thing is an addition to the icons: Before, only X BitMaps were allowed, but it's possible to use X PixMaps now, too. subtle can detect the file type and handle it accordingly. This doesn't sound like a big improvement and generally besides colors there isn't a big difference between bitmaps and pixmaps at all, icons can just be colorful.

Colors

In case you just updated and the current active client (title) is black on black, this is caused by another color change:

{{column(:start)}}

Old color names

#
#
#

color :panel_bg,     "#757575" 
color :panel_bg,     "#202020" 

{{column(:mid)}}

 

*>
*>
*>

=>
=>

{{column(:mid)}}

New color names

color :title_fg,     "#fecf35" 
color :title_bg,     "#202020" 
color :title_border, "#303030" 

color :stipple,      "#757575" 
color :panel,        "#202020" 

{{column(:end)}}

Dynamic

Welcome back, old and controversial feature - views can be dynamic again:

{{hide}}view "dynamic" do
  match   "xterm" 
  icon    "icon.xpm" 
  dynamic true
end

Panel padding and icons

Added by Christoph Kappel over 13 years ago

The latest changes (r2400) just bring a bit more eyecandy to subtle.

Padding

It's now possible to set the padding of the panel, additionally to the font size. This new option is named padding, the former padding option to reserve screenspace for e.g. additional panels was renamed to strut.

The order of padding values is: left, right, top, bottom

Icons

Also view buttons can now contain a pixmap icon, it basically uses the rendering of sublets and has therefore only a tiny overhead for users that don't need it. Views with icons can be defined in a similar way like properties in tags:

{{hide}}view "terms" do
  match "terms" 
  icon  "/usr/share/icons/icon.xbm" 
end

More colors

Added by Christoph Kappel over 13 years ago

The color names in subtle were a bit messy and without further explanation probably difficult to understand. r2260 comes with renamed color names, different border colors for every panel item and a new color for occupied views.

Occupied views are views with at least one visible client.

Here are the changes of the colors of the default color scheme:

{{column(:start)}}

Old color names

color :fg_focus,      "#fecf35" 
color :bg_focus,      "#202020" 
#

color :fg_urgent,     "#FF9800" 
color :bg_urgent,     "#202020" 
#

#
#
#

color :fg_views,      "#757575" 
color :bg_views,      "#202020" 
#

color :fg_sublets,    "#757575" 
color :bg_sublets,    "#202020" 
#

color :fg_panel,      "#757575" 
color :bg_panel,      "#202020" 

color :border_focus,  "#303030" 
color :border_normal, "#202020" 

color :border_panel,  "#303030" 

color :background,    "#3d3d3d" 
color :separator,     "#757575" 

{{column(:mid)}}

 

=>
=>
*>

=>
=>
*>

*>
*>
*>

=>
=>
*>

=>
=>
*>

=>
=>

=>
=>

<=

==
==

{{column(:mid)}}

New color names

color :focus_fg,         "#fecf35" 
color :focus_bg,         "#202020" 
color :focus_border,     "#303030" 

color :urgent_fg,        "#ff9800" 
color :urgent_bg,        "#202020" 
color :urgent_border,    "#303030" 

color :occupied_fg,      "#feb435" 
color :occupied_bg,      "#202020" 
color :occupied_border,  "#303030" 

color :views_fg,         "#757575" 
color :views_bg,         "#202020" 
color :views_border,     "#303030" 

color :sublets_fg,       "#757575" 
color :sublets_bg,       "#202020" 
color :sublets_border,   "#303030" 

color :panel_fg,        "#757575" 
color :panel_bg,        "#202020" 

color :client_active,   "#303030" 
color :client_inactive, "#202020" 

#

color :background,      "#3d3d3d" 
color :separator,       "#75757" 

{{column(:end)}}

Grabs in sublets

Added by Christoph Kappel over 13 years ago

After a rewrite (r2204) of the ruby handling inside of subtle, sublets can now use grabs too. The syntax is almost the same as for grabs inside of the config. Please be aware that there is no checking for duplicates, the last one wins.

Here is a short example:

{{hide}}configure :grabby do |s|
  s.interval = 5
end

grab "A-b" do |s, c|
  puts "sublet name: %s" % [ s.name ]
  puts "pressed on : %s" % [ c.name ]
end

New multihead handling

Added by Christoph Kappel over 13 years ago

Multihead

subtle finally has a proper screen handling, instead of using a hacky screen placement via tag properties, subtle displays a view per screen now. This also requires a more decent way to configure panel, because there are two panel per screen. The new config option comes in the usual DSL style:

{{hide}}screen 1 do
  stipple false
  top     [ :views, :title, :spacer, :tray, :sublets ]
  bottom  [ ]
end

Due the changes in the handling of screens, the :WindowScreen grab and the screen property of tags are now obsolete.

The panel wiki page has been updated accordingly.

Dynamic views

Dynamic views have been removed from subtle, because the use of them is questionable and the overhead in the code just not acceptable.

Exclude match

Tags support exclude matching now, that means it's possible to exclude a certain window from getting this tag.

{{hide}}tag "exclude" do
  match   "urxvt" 
  exclude :instance => "irssi" 
end

The tagging wiki page has been updated accordingly.

SubtletsReload and SubtleReload

The complex panel layout makes it impossible to reload just the sublets, reload the config reloads the sublets anyway and therefore SubletsReload is obsolete.

Escape key

Added by Christoph Kappel over 13 years ago

With r2166 there comes another way of defining grabs: The escape key.

Normally we would just add grabs with chains like grab "A-b", "urxvt" to get something that responds to a press of Alt-b. The drawback of this is that we need many different modifiers like using control, super etc. and we are probably limiting or even disturbing other programs and allows the usage of easier binds.

Now with the escape key we have a way to set a grab that needs to be pressed before any other grab can be used.

grab "C-y", :SubtleEscape
grab "Return", "urxvt" 
grab "n", :ViewNext
grab "b", :ViewPrev

This is optional and per default commented out, the docs of the wiki and the default config have been updated accordingly.

Configuration of sublets

Added by Christoph Kappel over 13 years ago

Until now configuring a sublet was a silly task, you had to open the sublet itself and update the code. This changes with r2148: I've added a new DSL command that allows configuring of a sublet from the main config of subtle.

sublet :clock do
  interval       30
  format_string  "%H:%S" 
end

Currently there are only two sublets that support this new mechanism, but I will update my sublets asap. I will also add some more details in the notes section of the sublet to make it a b it easier to find what can be changed.

(21-30/52)

Also available in: Atom