Difference between revisions of "Subtle"

From ArchWiki
Jump to: navigation, search
(14 intermediate revisions by 10 users not shown)
Line 1: Line 1:
[[Category:Tiling WMs (English)]]
+
[[Category:Tiling WMs]]
 +
[[de:Subtle]]
 +
[[ko:Subtle]]
 +
From [http://subforge.org/projects/subtle Subtle project page]:
 +
:''Subtle is a manual tiling window manager with a rather uncommon approach of tiling: Instead of relying on predefined layouts, Subtle divides the screen into a grid with customizable slots (called gravities).''
  
== Introduction ==
+
Subtle is configured with [[Ruby]] for [[Xorg]].
  
[http://subforge.org/projects/subtle Subtle] is a manual tiling window manager with a rather uncommon approach of tiling: Per default there is no typical layout enforcement, windows are placed on a position (gravity) in a custom grid. The user can change the gravity of each window either directly per grabs or with rules defined by tags in the config.
+
{{Note|This article only explain the basics of Subtle. In depth information and tutorials exist at the [http://subforge.org/projects/subtle Subtle project page].}}
  
== Installation ==
+
==Installing==
 +
The {{pkg|subtle}} package is available in the [[Official Repositories|official repositories]]. It can be installed with [[pacman]].
  
Currently there are two different packages available:
+
A developer snapshot is available in the [[AUR]] named {{AUR|subtle-hg}}.
  
* [http://www.archlinux.org/packages/community/i686/subtle/ subtle] (current stable)
+
==Starting Subtle==
* [http://aur.archlinux.org/packages.php?ID=13139 subtle-hg] (developer snapshot)
+
To start Subtle add {{ic|exec subtle}} to your {{ic|.xinitrc}} file and launch Xorg. Remember that Subtle does not provide any icons or menus, and the only predefined key binding that opens a terminal is {{ic|Super+Enter}}, which will open [[URxvt]]. So if you do not have URxvt, either install it or change the configuration file before starting. If you need to exit Subtle press {{ic|Super+Ctrl+q}}.
  
The stable version is in community and can be installed with [https://wiki.archlinux.org/index.php/Pacman pacman], the developer snapshot is in [http://aur.archlinux.org AUR] and needs either a special tool like [http://aur.archlinux.org/packages.php?ID=5863 yaourt], [http://aur.archlinux.org/packages.php?ID=34686 clyde] or [http://aur.archlinux.org/packages.php?ID=33378 packer] or can be installed manually.
+
==Basic function==
 +
When windows are opened they are matched against a set of user-defined rules to get proper position and size. The process of applying these rules can be broken down in three main parts:
 +
*View
 +
*Gravity
 +
*Tag
 +
''Views'' are the environment in which the windows will be placed. Much like ordinary desktop surfaces. Defining the actual rules for a window is accomplished with a ''tag''. In tags you also determine the ''gravity'' to be used. Gravities control the size and position of windows.
  
== Configuration ==
+
{{Note|When configuring Subtle you actually need to declare these elements in reverse order. Gravity, tag then view.}}
  
On start subtle will check if a config file is available in the typical XDG paths and use it. A local config is preferred over a system wide. (See {{Codeline|$XDG_CONFIG_HOME}})
+
==Configuration==
 +
Subtle will search for {{ic|subtle.rb}} in your $XDG_CONFIG_HOME path. If it is non-existant it will load a default file from your $XDG_CONFIG_DIRS path. It is preferable to copy this file to your {{ic|$XDG_CONFIG_HOME/subtle}} directory instead of using the default.
  
Then it will have a look for sublets in the XDG paths too and load them accordingly. (See {{Codeline|$XDG_DATA_HOME}})
+
The default file will contain numerous gravities, tags and views. This is an excellent place to start when designing your own environment. Applications without matching tags will be placed on the view containing the default tag, if no view posses it, they are automatically placed on the first view.
  
No system wide [http://subforge.org/projects/subtle/sublets sublets] will be loaded per default.
+
To check your configuration file for potential errors, simply run the following command:
* To create a user config just create ''$XDG_CONFIG_HOME/subtle'' and copy the latest config from the dist folder into it. To do this, type the following command into the console:
+
$ subtle -k
{{Cli|$ cp /etc/xdg/subtle/subtle.rb $XDG_CONFIG_HOME/subtle/subtle.rb}}
+
* To enable sublets create ''$XDG_DATA_HOME/subtle/sublets'' and create symlinks to the sublets. (Load order is '''alphabetically''')
+
 
+
Always compare your existing config with the one of the repository/tarball to get the latest options.
+
 
+
This and more info can be found on the [http://subforge.org/projects/subtle subtle website].
+
 
+
{{Note|The default keybindings use the '''numeric keypad''' for selecting window size-positions ("gravities") which is awkward on a laptop where NumLock will be required, so laptop users will want to rebind these functions - the default config contains an alternate methods for this.}}
+
 
+
=== Checking the Configuration Syntax ===
+
 
+
If an error is in the subtle config, subtle may not start.
+
 
+
To check if your config contains errors, simply type in the command:
+
{{Cli|subtle -k}}.
+
 
+
== Themes ==
+
 
+
The appearance of subtle, that is, the colors of the panels, subtlets and other such elements are configured according to what is set in the *Colors* section (in subtle stable) and in the *Styles* section (in subtle-hg). Note that theme configurations for subtle stable and subtle-hg are different.
+
 
+
In the {{Filename|subtle.rb}} for subtle stable, look for lines that look similar to what is shown below to change the appearance of the panels, etc.:
+
<pre>
+
color :title_fg,          "#fecf35"
+
color :title_bg,          "#202020"
+
color :title_border,      "#303030"
+
 
+
color :focus_bg,          "#202020"
+
color :focus_border,      "#303030"
+
color :focus_fg,          "#fecf35"
+
 
+
color :urgent_fg,        "#FF9800"
+
color :urgent_bg,        "#202020"
+
color :urgent_border,    "#303030"
+
 
+
color :occupied_fg,      "#b8b8b8"
+
color :occupied_border,  "#303030"
+
color :occupied_bg,      "#202020"
+
 
+
color :views_border,      "#303030"
+
color :views_bg,          "#202020"
+
color :views_fg,          "#757575"
+
 
+
color :sublets_bg,        "#202020"
+
color :sublets_border,    "#303030"
+
color :sublets_fg,        "#757575"
+
 
+
color :client_inactive,  "#202020"
+
color :client_active,    "#303030"
+
 
+
color :panel,            "#202020"
+
 
+
color :background,        "#3d3d3d"
+
 
+
color :stipple,          "#757575"
+
 
+
color :separator,        "#757575"
+
</pre>
+
 
+
In the {{Filename|subtle.rb}} of the subtle-hg build, look for the lines below:
+
<pre>
+
style :title do
+
  padding    2, 10, 0, 10
+
  border_bottom "#303030", 2
+
  foreground  "#ffffff"
+
  background  "#1b1b1b"
+
end
+
 
+
style :focus do
+
  padding    2, 8, 0, 8
+
  border_bottom "#606060", 2
+
  foreground  "#fff"
+
  background  "#3b3b3b"
+
end
+
 
+
style :urgent do
+
  padding    2, 8, 0, 8
+
  #border      "#303030", 0
+
  foreground  "#ffffff"
+
  background  "#519f50"
+
end
+
 
+
style :occupied do
+
  padding    2, 8, 0, 8
+
  border_bottom "#424242", 2
+
  foreground  "#606060"
+
  background  "#2E2E2E"
+
end
+
 
+
style :views do
+
  padding    2, 8, 0, 8
+
  foreground  "#3A3A3A"
+
  background  "#222222"
+
end
+
 
+
style :sublets do
+
  padding    2, 10, 0
+
  border_bottom "#303030", 2
+
  foreground  "#b0b0b0"
+
  background  "#222222"
+
end
+
 
+
style :separator do
+
  padding    1, 0, 0
+
  border_bottom "#090909", 2
+
  background  "#222222"
+
  foreground  "#505050"
+
end
+
 
+
style :clients do
+
  active      "#000000", 1
+
  inactive    "#202020", 1
+
  margin    0 
+
end
+
 
+
style :subtle do
+
  padding    0
+
  panel      "#222222"
+
  stipple    "#757575"
+
end
+
</pre>
+
  
 
==Sublets==
 
==Sublets==
Sublets are tiny apps that appear in the subtle panels. They can be used to show the battery state, the volume, control mpd, among other purposes.  
+
Sublets are tiny apps that appear in the Subtle panels. They can be used to control various applications and show system stats.
  
===Installing Sublets===
+
===Installing sublets===
To install a sublet, open a terminal window and type the following command:
+
To install a sublet, type the following command in a terminal:
{{Cli|sur install <name of sublet>}}
+
$ sur install <name of sublet>
 
+
Example:
+
{{Cli|sur install mpd}}
+
This will install the mpd sublet.
+
  
 
For a list of sublets, go to the [http://sur.subforge.org sur website].
 
For a list of sublets, go to the [http://sur.subforge.org sur website].
Line 158: Line 45:
 
{{Note|If you install a sublet as root, you will not be able to invoke the sublet as a regular user. Sublets used by non-root accounts must be installed under the user.}}
 
{{Note|If you install a sublet as root, you will not be able to invoke the sublet as a regular user. Sublets used by non-root accounts must be installed under the user.}}
  
===Sublet Configuration===
+
===Enabling sublets===
After you have installed a sublet, you must invoke it in the ~subtle.rb~ configuration.  
+
After installation you need to enable it in {{ic|subtle.rb}}. Look for a series of lines similar to the ones below:
 
+
{{bc|<nowiki>
Look for a series of lines similar to the one below:
+
<pre>
+
 
screen 1 do
 
screen 1 do
  top [ :title, :spacer, :views ]
+
top [ :title, :spacer, :views ]
  bottom [ :mpd, :wifi, :battery ]
+
bottom [ :mpd, :wifi, :battery ]
 
end
 
end
</pre>
+
</nowiki>}}
 
+
Then just add the sublets name in the same fashion as the other ones, like this:
What is inside the brackets is shown on the respective panel.
+
{{bc|<nowiki>
 
+
bottom [ :mpd, :<name of sublet>, :wifi, :battery ]
===Sublet Appearance===
+
</nowiki>}}
The appearance of a sublet is determined through the {{Filename|subtle.rb}} configuration. Information as to how to format the sublet is usually provided in the terminal output when installing the sublet.
+
It can of course be inserted at a place by your own choice.
 
+
Here is an example, using the clock sublet:
+
<pre>
+
sublet :clock do
+
  interval    30
+
  foreground "#ccc"
+
  background  "#000"
+
  format_string "%I:%M %p"
+
end
+
</pre>
+
 
+
Note that you can change the colors of the sublet and also what information it shows in the panel.
+
 
+
Here is another example, using the ~weather~ sublet:
+
<pre>
+
sublet :wifi do
+
  interval  10
+
  locale    "en"
+
  location  "90210"
+
end
+
</pre>
+
 
+
Each sublet has its own parameters and formatting options you can change to your taste.
+
 
+
== Contact ==
+
  
If you have problems, suggestions or just want to talk about [http://subforge.org/projects/subtle subtle] feel free to join '''#subtle''' on '''irc.freenode.org''' or drop a mail to _unexist_ at _dorfelite_ dot _net_.
+
==See also==
 +
* [http://subforge.org/projects/subtle Subtle project page]
 +
* [http://sur.subforge.org Sublets archive]
 +
* [https://bbs.archlinux.org/viewtopic.php?id=71783 The subtle thread]
 +
* [https://bbs.archlinux.org/viewtopic.php?id=112486 Share your Subtle desktop!]
 +
* [[xinitrc]]
 +
* [[Start X at Login]]
 +
* [[Window Manager]]

Revision as of 10:43, 1 September 2013

From Subtle project page:

Subtle is a manual tiling window manager with a rather uncommon approach of tiling: Instead of relying on predefined layouts, Subtle divides the screen into a grid with customizable slots (called gravities).

Subtle is configured with Ruby for Xorg.

Note: This article only explain the basics of Subtle. In depth information and tutorials exist at the Subtle project page.

Installing

The subtle package is available in the official repositories. It can be installed with pacman.

A developer snapshot is available in the AUR named subtle-hgAUR.

Starting Subtle

To start Subtle add exec subtle to your .xinitrc file and launch Xorg. Remember that Subtle does not provide any icons or menus, and the only predefined key binding that opens a terminal is Super+Enter, which will open URxvt. So if you do not have URxvt, either install it or change the configuration file before starting. If you need to exit Subtle press Super+Ctrl+q.

Basic function

When windows are opened they are matched against a set of user-defined rules to get proper position and size. The process of applying these rules can be broken down in three main parts:

  • View
  • Gravity
  • Tag

Views are the environment in which the windows will be placed. Much like ordinary desktop surfaces. Defining the actual rules for a window is accomplished with a tag. In tags you also determine the gravity to be used. Gravities control the size and position of windows.

Note: When configuring Subtle you actually need to declare these elements in reverse order. Gravity, tag then view.

Configuration

Subtle will search for subtle.rb in your $XDG_CONFIG_HOME path. If it is non-existant it will load a default file from your $XDG_CONFIG_DIRS path. It is preferable to copy this file to your $XDG_CONFIG_HOME/subtle directory instead of using the default.

The default file will contain numerous gravities, tags and views. This is an excellent place to start when designing your own environment. Applications without matching tags will be placed on the view containing the default tag, if no view posses it, they are automatically placed on the first view.

To check your configuration file for potential errors, simply run the following command:

$ subtle -k

Sublets

Sublets are tiny apps that appear in the Subtle panels. They can be used to control various applications and show system stats.

Installing sublets

To install a sublet, type the following command in a terminal:

$ sur install <name of sublet>

For a list of sublets, go to the sur website.

Note: If you install a sublet as root, you will not be able to invoke the sublet as a regular user. Sublets used by non-root accounts must be installed under the user.

Enabling sublets

After installation you need to enable it in subtle.rb. Look for a series of lines similar to the ones below:

screen 1 do
 top [ :title, :spacer, :views ]
 bottom [ :mpd, :wifi, :battery ]
end

Then just add the sublets name in the same fashion as the other ones, like this:

 bottom [ :mpd,  :<name of sublet>, :wifi, :battery ]

It can of course be inserted at a place by your own choice.

See also