Differences between revisions 16 and 18 (spanning 2 versions)
Revision 16 as of 2009-09-23 16:20:04
Size: 11214
Editor: ?syounger
Comment:
Revision 18 as of 2010-02-16 13:25:15
Size: 11488
Comment: fixed writing style - [sorry I have no real experience with Wmii, so I hope I didn't add any technical errors]
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
||<tablestyle="width: 100%;" style="border: 0px hidden">~-[[DebianWiki/EditorGuide#translation|Translation(s)]]: English - [[fr/Wmii|Français]]-~||<style="text-align: right;border: 0px hidden"> (!) [[/Discussion|Discussion]]|| ||<tablestyle="width: 100%;" style="border: 0px hidden">~-[[DebianWiki/EditorGuide#translation|Translation(s)]]: English - [[fr/Wmii|Français]] -~||<style="text-align: right;border: 0px hidden"> (!) [[/Discussion|Discussion]]||
Line 8: Line 8:
|| What is it about:|| '''What is Wmii?'''
Line 11: Line 11:
Wmii (Window Manager Improved) is a « tiling WM » : a window manager which automagically places windows without overlapping.
This is done with a view to them covering as large a surface as possible.
Further, to allow you to efficiently organise your desktop screen, you can navigate it using the keyboard only.
Wmii (Window Manager Improved) is a « tiling WM »: a window manager which automagically places windows without overlapping.
This is done in the effort of having them cover as large a surface as possible.
Further, to allow you to efficiently organize your desktop screen, you can navigate it using the keyboard only.
Line 19: Line 19:
If you don't have xorg installed, you should install it before : If you don't have xorg installed, you should first install it:
Line 23: Line 23:
For wmii, you need the package : For wmii, you need the following package:
Line 30: Line 30:
== Begin ==

When we don't know tiling, it's not realy easy to begin with it. We have to learn hotkeys to launch programs and move or resize windows. By default, the "Mod" touch is Alt. See the "Configuration" part of this page to change it, if you need. The hotkeys to learn at beginning are :
== First Steps ==

When you don't know tiling, it's not really easy to start working with it. You have to learn hotkeys to launch programs and move or resize windows. By default, the "Mod" key is Alt. See the "Configuration" section in this page to change it, if you need. The hotkeys to learn at the beginning are:
Line 34: Line 34:
 * Mod+p -> menu : a menu appears, just tape the beginning of the name of the application to open it
 * Mod+d -> default layout : windows are divised on screen
 * Mod+s -> stacked layout : the selected window take all the screen, we just see the title bar of the others
 * Mod+p -> menu : a menu appears, just type the start of the name of an application to open it
 * Mod+d -> default layout : screen space is divided among the windows
 * Mod+s -> stacked layout : the selected window takes all the screen, you see only the title bar of the others
Line 48: Line 48:
 * Mod+h : selected column at left
 * Mod+l : select the column at right
Columns are created automatically when you move a window to the left or right of the existing column(s). You can make them bigger or smaller by clicking and dragging between two columns.
 * Mod+h : select the left column
 * Mod+l : select the right column
Columns are created automatically when you move a window to the left or right of the existing column(s). You can make them bigger or smaller by clicking and dragging the border between two columns.
Line 54: Line 54:
You begin in "default" layout : all windows take the same space. You can make them taller or shorter by clicking in the little square in the title bar of a window.
 * "stacked" layout (Mod+s) : the selected window take all the column, you see just the title bar of the others
 * "maximum" layout (Mod+m) : the selected window take all the column, you don't see other windows.
 * "fullscreen" layout (Mod+f) : the selected window take all the screen.
You start with the "default" layout: all windows take up the same space. You can make them taller or shorter by clicking in the little square in their title bar.
 * "stacked" layout (Mod+s) : the selected window takes up all the column, you see only the title bar of the others
 * "maximum" layout (Mod+m) : the selected window takes up all the column, you don't see other windows.
 * "fullscreen" layout (Mod+f) : the selected window takes up all the screen.
Line 61: Line 61:
You can place your windows like a classic window manager. It's called floating layout. It's useful for some applications, like the Gimp.
 * Mod+Shift+Space : Move selected window in floating layout.
 * Mod+Space : swich between floating layout and normal layout.
In floating layout, we select window with Mod+j and Mod+k. We can change dimensions of the window, by clicking on the corner, like in a classic window manager. But we can use hotkeys for that :
You can place your windows like you would in a classic window manager. It's called floating layout. It's useful for some applications, like the Gimp.
 * Mod+Shift+Space : Move selected window in the floating layout.
 * Mod+Space : switch between floating layout and normal layout.
In the floating layout, you select windows with Mod+j and Mod+k. You can change the dimension of the window by clicking on the corner, like in a classic window manager. But you can also use hotkeys for that:
Line 66: Line 66:
 * Mod+Right click : change dimensions of the window (you can use it in other layouts too)  * Mod+Right click : change dimension of the window (you can use it in other layouts too)
Line 69: Line 69:
The views is the principle of desktops in others window managers. They are automatically created when you move a window in. Hotkeys follow the same principle : Views are based on the same principle of desktops in others window managers. They are automatically created when you move a window in them. Hotkeys also follow the same principle:
Line 72: Line 72:
It's the same thing for all numbers, from 0 to 9. But we can use name too :
 * Mod+t : views menu : you can select a view with right and left keys, or type the name of the view (or just a part of the name, if it was created)
 * Mod+Shift+t : Same thing, but we move with the selected window.
It's the same thing for all numbers, from 0 to 9. But you can use names too:
 * Mod+t : views menu : you can select a view with the right and left keys, or type the name of the view (or just a part of the name, if it already exists)
 * Mod+Shift+t : Same thing, but moves to the selected window
Line 78: Line 78:
== Per-user configuration ==

The configuration file is /etc/X11/wmii-3.5/wmiirc. If you want a personnal configuration, just copy it in the .wmii-3.5 in your personnal folder :
== Per-user Configuration ==

The configuration file is /etc/X11/wmii-3.5/wmiirc. If you want a personal configuration, just copy it under .wmii-3.5 in your personal folder:
Line 85: Line 85:
== Basic configuration ==

You just need to edit the wmiirc file
== Basic Configuration ==

You just need to edit the wmiirc file.
Line 98: Line 98:
Change Mod1 to Mod4 if you want to use the Windows key and not Alt. You can also change h, j, k, l if you want. To use the arrow keys, for example, use Up,Down,Left,Right.

=== Windows colors ===
Change Mod1 to Mod4 if you want to use the Windows key instead of Alt. You can also change h, j, k, l if you want. To use the arrow keys, for example, use Up, Down, Left, Right.

=== Window Colors ===
Line 109: Line 109:
Colors of unselected window are in NORMCOLORS variable. Colors of selected window are in FOCUSCOLOR variable. You can see the hexadecimal code of a color with the Gimp (just click in the black and white squares in the tools window), for example. You can change the background color (if you use transparent terminal) with the WMII_BACKGROUND variable. Colors of unselected windows are set in the NORMCOLORS variable. Colors of the selected window are set in the FOCUSCOLOR variable. You can see the hexadecimal code of a color with the Gimp (just click in the black and white squares in the tools window), for example. You can change the background color (if you use a transparent terminal) with the WMII_BACKGROUND variable.
Line 118: Line 118:
See {{{man dmenu}}} if you want to change the menu. The WMII_TERM variable set the command of the terminal opened with Mod+Enter

== The Plan9 system ==

Wmii use a pseudo file-system (like /proc), for its configuration. We can read and write into with {{{wmiir}}} : we use "ls" to see files and folders :
See {{{man dmenu}}} if you want to change the menu. The WMII_TERM variable sets the command used to open a terminal with the Mod+Enter shortcut.

== The Plan9 System ==

Wmii uses a pseudo file-system (like /proc), for its configuration. You can read and write into with {{{wmiir}}}: you use "ls" to see files and folders:
Line 136: Line 136:
We can read files with "read" : You can read files with "read" :
Line 142: Line 142:
We can create an file with "write" and write into an existing file with "xwrite". For example : You can create a file with "write" and write into an existing file with "xwrite". For example:
Line 146: Line 146:
will write "view 5" in ctl, this place the desktop in the view "5".

We will see others example in the wmiirc :
will write "view 5" in ctl, this toggles the view "5" on the desktop.

You can see others example in the wmiirc file.
Line 152: Line 152:
=== Columns size ===

In the {{{#Column Rules}}} section, you can replace "58+42" by the size of the columns (in percent of the size of the screen) that you want. The first number is the percent of the screen for the first (leftmost) column, the second number is for the second column. You can add more numbers to set the widths of more than two columns.

=== Windows disposition ===

The {{{#Tagging Rules}}} section allow to put rules to windows, in function of their title bar. We select windows from a regular expression (http://en.wikipedia.org/wiki/Regex) and we put a tag (the name or number of a view) or a tilde (~) for the floating layer. For example :
=== Column size ===

In the {{{#Column Rules}}} section, you can replace "58+42" with the size of the columns (as a percentage of the total size of the screen) you prefer. The first number is the percentage of the screen for the first (leftmost) column, the second number is for the second column. You can add more numbers to set the width of more than two columns.

=== Windows Placement ===

The {{{#Tagging Rules}}} section allows you to set rules for windows, in function of their title bar. Windows are selected with a regular expression (http://en.wikipedia.org/wiki/Regex) and a tag, with the name or number of a view, or a tilde (~), for the floating layer, is set for them. For example:
Line 172: Line 172:
All windows whose have the title bar beginning by XMMS, MPlayer or VLC will be automaticly in the floating layer. Gajim will be launched in the floating layer of the view named "jabber" and the iceweasel downloading window will be launched simultaneously in the selected view and the view "download". The two last lines put any other windows in the selected view, and begin the environment in the view "1".

We can use wmii in floating layer exclusively :
All windows with the title bar beginning with XMMS, MPlayer, or VLC will be automatically placed in the floating layer. Gajim will be launched in the floating layer of the view named "jabber" and the iceweasel downloading window will be launched simultaneously in the selected view and in the "download" view. The last two lines place any other window in the selected view, and start the environment in the "1" view.

It's possible to use wmii exclusively with the floating layer:
Line 183: Line 183:
=== Status bar ===

In the {{{#Status Bar Info}}} section, you can replace the "status" function by any command, the result of the command will appear in the status bar (at right). For example, to see the battery state and the date in a smaller format, you can do :
=== Status Bar ===

In the {{{#Status Bar Info}}} section, you can replace the "status" function with any command. The result of the command will appear in the status bar (on the right). For example, to see the battery status and the date in a smaller format, you can do :
Line 197: Line 197:
=== Keyboard shortcuts === === Keyboard Shortcuts ===
Line 208: Line 208:
Here we can reduce and increase the sound with Mod+b and Mod+v. Mod+n will launch iceweasel. Don't forgot the "&" at the end of the command, to let the hand to the script. In this example Mod+b and Mod+v are used to reduce and increase the sound volume. Mod+n will launch iceweasel. Don't forget the "&" at the end of the command, to return to the script.
Line 212: Line 212:
=== Programs at launch ===

To launch programs at the beginning of the session, you can add them in the wmiirc. But you have to place it before the last section :
=== Launch Programs at Startup ===

To launch programs at the beginning of the session, you can add them in the wmiirc. But you have to place them before the last section:
Line 226: Line 226:
which launch "wmiir read event" in a loop. So all lines after will not be read.

If you want that the program doesn't launch a second time, when you relaunch wmiirc, you can do :
which launches "wmiir read event" in a loop. So all lines after these will not be read.

If you don't want a new instance of the program to be started when you relaunch wmiirc, you can use:
Line 233: Line 233:
=== Apply the modifications ===

Just launch the wmiirc from the Actions menu (Mod+a). If you want to use programs you've just installed, use "rehash" from the Actions menu.
=== Apply the Changes ===

Just launch wmiirc from the Actions menu (Mod+a). If you want to use programs you've just installed, use "rehash" from the Actions menu.
Line 239: Line 239:
If you look in the Plan9 system with wmiir ls and wmiir read, and if you look at the keyboard shortcurts, you can easily find which command you need to use to modify the behaviour of wmii, and so make some scripts. For example : If you look in the Plan9 system with wmiir ls and wmiir read, and if you look at the keyboard shortcurts, you can easily find which command you need to use to modify the behaviour of wmii, and thus make some scripts. For example:
Line 255: Line 255:
With this you can tag one or several windows. For example {{{tag Iceweasel 2+web}}} will place the iceweasel's window(s) in the view "2" and in the view "web".
You can do all kind of scripts, as you want. But you should prefer to modify the wmiirc, which is a bash script. For example, we can add the keyboard shortcurt :
With this you can tag one or more windows. For example, {{{tag Iceweasel 2+web}}} will place all iceweasel's window(s) in the view called "2" and in the "web" view.
You can do all kind of scripts, as you want. But it would be better to modify the wmiirc file, which is a bash script. For example, you can add this keyboard shortcurt:
Line 261: Line 261:
and change the view of the selected window and follow it to the view with Mod+r.

If you want to learn shell scripting, you can find a detailled guide at [[http://tldp.org/LDP/abs/html/]].

There are some others Plan9 clients, like libixp and plan9port. They can be better for scripting in other languages. For example, ruby coders should like ruby-wmii : [[http://eigenclass.org/hiki.rb?wmii%20ruby]]

There are a lot of tips for wmii in the web.

= Ressources =

Official site : [[http://www.suckless.org/wmii/]]
and then use Mod+r to change the view of the selected window and to follow it to the new view.

If you want to learn shell scripting, you can find a detailed guide at [[http://tldp.org/LDP/abs/html/]].

There are some other Plan9 clients, like libixp and plan9port. They can be better for scripting in other languages. For example, ruby coders should like ruby-wmii: [[http://eigenclass.org/hiki.rb?wmii%20ruby]]

There is a lot of tips for wmii in the web.

= Resources =

 * [[http://www.suckless.org/wmii/]]: Official website.

Translation(s): English - Français

(!) ?Discussion


CategoryDesktopEnvironment

What is Wmii?

Wmii (Window Manager Improved) is a « tiling WM »: a window manager which automagically places windows without overlapping. This is done in the effort of having them cover as large a surface as possible. Further, to allow you to efficiently organize your desktop screen, you can navigate it using the keyboard only.

Installation

If you don't have xorg installed, you should first install it:

aptitude install xserver-xorg xterm xinit

For wmii, you need the following package:

aptitude install wmii

Use

First Steps

When you don't know tiling, it's not really easy to start working with it. You have to learn hotkeys to launch programs and move or resize windows. By default, the "Mod" key is Alt. See the "Configuration" section in this page to change it, if you need. The hotkeys to learn at the beginning are:

  • Mod+Enter -> Terminal

  • Mod+p -> menu : a menu appears, just type the start of the name of an application to open it

  • Mod+d -> default layout : screen space is divided among the windows

  • Mod+s -> stacked layout : the selected window takes all the screen, you see only the title bar of the others

  • Mod+j -> select the window below

  • Mod+k -> select the window above

  • Shift+Mod+j -> move the window down

  • Shift+Mod+k -> move the window up

  • Mod+a -> Actions menu : choose "quit" to quit

Columns

By default, only one column is used by the desktop. It's possible to use several columns with h and l :

  • Mod+Shift+h : move the selected window left
  • Mod+Shift+l : move the selected window right
  • Mod+h : select the left column
  • Mod+l : select the right column

Columns are created automatically when you move a window to the left or right of the existing column(s). You can make them bigger or smaller by clicking and dragging the border between two columns.

Layouts

You start with the "default" layout: all windows take up the same space. You can make them taller or shorter by clicking in the little square in their title bar.

  • "stacked" layout (Mod+s) : the selected window takes up all the column, you see only the title bar of the others
  • "maximum" layout (Mod+m) : the selected window takes up all the column, you don't see other windows.
  • "fullscreen" layout (Mod+f) : the selected window takes up all the screen.

Floating layout

You can place your windows like you would in a classic window manager. It's called floating layout. It's useful for some applications, like the Gimp.

  • Mod+Shift+Space : Move selected window in the floating layout.
  • Mod+Space : switch between floating layout and normal layout.

In the floating layout, you select windows with Mod+j and Mod+k. You can change the dimension of the window by clicking on the corner, like in a classic window manager. But you can also use hotkeys for that:

  • Mod+Left click : move window
  • Mod+Right click : change dimension of the window (you can use it in other layouts too)

Views

Views are based on the same principle of desktops in others window managers. They are automatically created when you move a window in them. Hotkeys also follow the same principle:

  • Mod+Shift+2 : move selected window to the view "2"
  • Mod+2 : go to view "2"

It's the same thing for all numbers, from 0 to 9. But you can use names too:

  • Mod+t : views menu : you can select a view with the right and left keys, or type the name of the view (or just a part of the name, if it already exists)
  • Mod+Shift+t : Same thing, but moves to the selected window

Configuration

Per-user Configuration

The configuration file is /etc/X11/wmii-3.5/wmiirc. If you want a personal configuration, just copy it under .wmii-3.5 in your personal folder:

cp /etc/X11/wmii-3.5/wmiirc /home/<login>/.wmii-3.5/

Basic Configuration

You just need to edit the wmiirc file.

Keys

# Configuration Variables
MODKEY=Mod1
UP=k
DOWN=j
LEFT=h
RIGHT=l

Change Mod1 to Mod4 if you want to use the Windows key instead of Alt. You can also change h, j, k, l if you want. To use the arrow keys, for example, use Up, Down, Left, Right.

Window Colors

# Colors tuples: "<text> <background> <border>"
WMII_NORMCOLORS='#ffffff #000000 #ffffff'
WMII_FOCUSCOLORS='#ffffff #5c0000 #ffffff'

WMII_BACKGROUND='#333333'
WMII_FONT='fixed'

Colors of unselected windows are set in the NORMCOLORS variable. Colors of the selected window are set in the FOCUSCOLOR variable. You can see the hexadecimal code of a color with the Gimp (just click in the black and white squares in the tools window), for example. You can change the background color (if you use a transparent terminal) with the WMII_BACKGROUND variable.

Terminal

set -- $(echo $WMII_NORMCOLORS $WMII_FOCUSCOLORS)
WMII_MENU="dmenu -b -fn '$WMII_FONT' -nf '$1' -nb '$2' -sf '$4' -sb '$5'"
WMII_9MENU="wmii9menu -font '$WMII_FONT' -nf '$1' -nb '$2' -sf '$4' -sb '$5' -br '$6'"
WMII_TERM="x-terminal-emulator'"

See man dmenu if you want to change the menu. The WMII_TERM variable sets the command used to open a terminal with the Mod+Enter shortcut.

The Plan9 System

Wmii uses a pseudo file-system (like /proc), for its configuration. You can read and write into with wmiir: you use "ls" to see files and folders:

$ wmiir ls /
client/
colrules
ctl
event
keys
lbar/
rbar/
tag/
tagrules

You can read files with "read" :

$ wmiir read /colrules
/.*/ -> 58+42

You can create a file with "write" and write into an existing file with "xwrite". For example:

wmiir xwrite /ctl view 5

will write "view 5" in ctl, this toggles the view "5" on the desktop.

You can see others example in the wmiirc file.

Behaviour

Column size

In the #Column Rules section, you can replace "58+42" with the size of the columns (as a percentage of the total size of the screen) you prefer. The first number is the percentage of the screen for the first (leftmost) column, the second number is for the second column. You can add more numbers to set the width of more than two columns.

Windows Placement

The #Tagging Rules section allows you to set rules for windows, in function of their title bar. Windows are selected with a regular expression (http://en.wikipedia.org/wiki/Regex) and a tag, with the name or number of a view, or a tilde (~), for the floating layer, is set for them. For example:

# Tagging Rules
wmiir write /tagrules <<!
/XMMS.*/ -> ~
/MPlayer.*/ -> ~
/VLC.*/ -> ~
/Gajim.*/ -> ~+jabber
/Téléchargements.*/ -> sel+download
/.*/ -> sel
/.*/ -> 1
!

All windows with the title bar beginning with XMMS, MPlayer, or VLC will be automatically placed in the floating layer. Gajim will be launched in the floating layer of the view named "jabber" and the iceweasel downloading window will be launched simultaneously in the selected view and in the "download" view. The last two lines place any other window in the selected view, and start the environment in the "1" view.

It's possible to use wmii exclusively with the floating layer:

# Tagging Rules
wmiir write /tagrules <<!
/.*/ -> ~+sel
/.*/ -> 1
!

Status Bar

In the #Status Bar Info section, you can replace the "status" function with any command. The result of the command will appear in the status bar (on the right). For example, to see the battery status and the date in a smaller format, you can do : # Status Bar Info

status() {
        echo -n $(acpi -b) '|' $(date +"%d/%m/%y - %H:%M:%S")
}

Actions

If you put a script in ~/.wmii-3.5 with the execution rights, you can launch it with the Actions menu (Mod+a).

Keyboard Shortcuts

You can add keyboard shortcurts in the #Key Bindings section, with the same syntax. For example :

        Key $MODKEY-b
                amixer set Master 2dB+ 
        Key $MODKEY-v
                amixer set Master 2dB-
        Key $MODKEY-n
                iceweasel &

In this example Mod+b and Mod+v are used to reduce and increase the sound volume. Mod+n will launch iceweasel. Don't forget the "&" at the end of the command, to return to the script. For multimedia keyboards, you can see Keyboard/MultimediaKeys. Attention : you have to use tabulations, not spaces.

Launch Programs at Startup

To launch programs at the beginning of the session, you can add them in the wmiirc. But you have to place them before the last section:

# Stop any running instances of wmiirc
echo Start wmiirc | wmiir write /event || exit 1

wmiir read /event |
while read event; do
        set -- $event
        event=$1; shift
        Event_$event $@
done 2>/dev/null

which launches "wmiir read event" in a loop. So all lines after these will not be read.

If you don't want a new instance of the program to be started when you relaunch wmiirc, you can use:

[ "`ps aux | grep <name_of_the_program> | grep -v grep`" =  "" ] && <name_of_the_program> &

Apply the Changes

Just launch wmiirc from the Actions menu (Mod+a). If you want to use programs you've just installed, use "rehash" from the Actions menu.

Scripting wmii

If you look in the Plan9 system with wmiir ls and wmiir read, and if you look at the keyboard shortcurts, you can easily find which command you need to use to modify the behaviour of wmii, and thus make some scripts. For example:

# /usr/local/bin/tag 

if [ $# -ne 2 ]; then
    echo "Usage: tag WINDOWTITLE TAG"
    exit 1
fi

for i in `wmiir ls /client | sed '/sel/d'` ; do
    if [ "`wmiir read /client/$i/label | grep $1`" = "$1" ]; then
        wmiir xwrite /client/$i/tags $2
    fi
done

With this you can tag one or more windows. For example, tag Iceweasel 2+web will place all iceweasel's window(s) in the view called "2" and in the "web" view. You can do all kind of scripts, as you want. But it would be better to modify the wmiirc file, which is a bash script. For example, you can add this keyboard shortcurt:

 Key $MODKEY-Shift-r
                export TAG=$(tagsmenu) ; wmiir xwrite "/client/$(wmiir read /client/sel/ctl)/tags" "$TAG" ; wmiir xwrite /ctl "view $TAG"

and then use Mod+r to change the view of the selected window and to follow it to the new view.

If you want to learn shell scripting, you can find a detailed guide at http://tldp.org/LDP/abs/html/.

There are some other Plan9 clients, like libixp and plan9port. They can be better for scripting in other languages. For example, ruby coders should like ruby-wmii: http://eigenclass.org/hiki.rb?wmii%20ruby

There is a lot of tips for wmii in the web.

Resources

ToDo

Probably a lot of mistakes, because of my bad english. Sorry.


CategoryProposedDeletion : duplicate the package description.