Author: Wu Jiqing version: 1.0 Release: 2009-11-04update: 2009-11-04
Why is tiled window manager used?
What is tiling window manager )? As the name implies, windows are flat on the screen without overlapping windows. Window managers, such as metacity in GNOME, kwin in Kde, and lightweight FVWM and openbox, are all floating Window managers that overlap with each other, the Window Manager uses a stack-like structure to manage these windows. Therefore, such Window managers are also called Stack-style Window managers.
With the increase of the display and people's pursuit of work efficiency, tiled window manager is becoming more and more important, because it does not require users to spend too much energy adjusting the size and position of the window, most importantly, it can save users' brain cells. For example, when you take notes on a computer, you can use a tiled window manager to open an e-book on the left and a text editor on the right. If you want to copy the content in the book, you do not need to switch the window back and forth. This tile requires no effort to adjust, and naturally maximizes the use of desktop space.
I think, I can read it here. If I like tiled window manager, I will continue to read it. If I am not interested, I can do other things.
Let's talk about Musca, the main character.
Why select Musca?
Those who are interested in Tiled window manager must have come into contact with some tiled Window managers, such as larswm, DWM, WMII, ion, xmonad, and recently popular awesome. From Wikipedia, Windows 1.0 is also a tiled Window Management Service, which is always used for floating window management.
Why have we selected Musca for so many Window managers?
To clarify this question, we should first talk about the concept of frames. Generally, the tiled Window Manager divides the screen into several rectangles, each of which is called a frame ), put the window of each application in the frame.
Careful users may find that some window managers provide one or several basic frame la S. When users start a new application, they do not need to manually generate frames, the window manager automatically generates a frame to store this application, and automatically places frames according to the set layout. Generally, each layout has a primary frame, and the newly started application will be placed in the primary frame. This tiled window manager is calledDynamic tiled Window Manager(Dynamic tiling window manager ). Such as larswm, DWM, WMII, and awesome. I have never experienced xmonad. It should also belong to this dynamic tiled window manager. If any error occurs, please correct it.
Another tiled window manager is calledManual tiled Window Manager(Manual tiling window manager ). When you use this tiled window manager, the window manager does not automatically generate frames. You need to manually split existing frames. This manual split is not troublesome, And it frees users from the layout restriction. windows can be split at will and any frame layout can be generated. Therefore, it is more flexible. Such Window managers include ion, ratpoison, and Musca.
At this point, we should understand why I ignored awesome, just because I don't like dynamic tiling, and awesome 3 is difficult to compile and relies heavily on. I like manual tiling's freedom. This is a matter of opinion and wisdom. Dynamic tiling's friends can no longer read it. The purpose of this article is to take notes by myself, in addition, I shared it with my friends who like manual tiling.
I have been using ion2 In the Ubuntu source. I am very satisfied with other aspects, that is, it has poor support for floating temporary windows and dialog windows. I don't know how ion3 has improved. When I was about to install ion3, I found that ion3 had complex dependencies and had a tendency to develop to heavyweight levels, which was daunting. I also heard that many people decided to give up ion because of its new license.
Ratpoison, a mouse drug, is lightweight but does not support floating windows at all. Use gimp to pull it down. Of course, you can use the tmpwm command to temporarily use another window manager, but this dependency on other Window managers is quite unpleasant. So I gave up ratpoison.
It is not until Musca is met that you have encountered one of the most desirable ones. It supports manual split screen and multiple desktops, and the dialog forms are floating. You can also use the shortcut key to switch between tiling mode and Stacking Mode (that is, floating window mode. Very convenient.
What does Musca mean? It seems like a fly. I prefer Moscow. The following is an example of Musca I am using. You can find more beautiful ones on the Internet.
The following table compares various tiled Window managers (refer to archwiki ):
Window Manager |
Development language |
Configuration language |
Tile Mode |
System Tray |
Re-load configuration in use |
Information bar |
Awesome |
C |
Lua |
Dynamic |
Built-in |
Yes |
Built-in and supported |
DWM |
C |
C, need to be re-compiled |
Dynamic |
None |
Optional |
Built-in |
Scrotwm |
C |
Text |
Dynamic |
None |
Yes |
Built-in |
WMII |
C |
Anything? |
Dynamic |
None |
Yes |
Built-in |
Xmonad |
Haskell |
Haskell |
Dynamic |
None |
Yes |
None |
Musca |
C |
C and Musca commands |
Manual |
None |
No, but can be configured using the Musca command |
None |
Ion3 |
C |
Lua |
Manual |
Trayion |
Yes |
Configurable |
Ratpoison |
C |
Text |
Manual |
None |
Yes |
Yes. It is displayed when needed. |
Stumpwm |
LISP |
LISP |
Manual |
None |
Yes |
Yes |
Subtle |
C |
Ruby |
Manual |
Built-in |
Yes |
Built-in (Ruby) |
Install Musca
I have been using Ubuntu 8.04, so there is no Musca in the source. So I downloaded the Musca source code compilation and installation on the Musca homepage. The current stable version is 0.9.24.
Apart from the dependency on dmenu during runtime, Musca has almost no dependencies, so compilation and installation are very simple. After extracting the source code, we can find that there are few source code files. Makefile is ready-made, so you can make it directly. It should be 100% successful. Then put the generated execution file into/usr/local/bin.
In this way, you can use Musca. Add exec Musca to your. xinitrc. Then startx enters Musca.
Musca basic usage
Before using Musca, let's talk about the concept of Musca window organization.
The concept of window ORGANIZATION IN MUSCA
- The split rectangle in the screen is called a frame.
- The program window in a virtual desktop is calledWindow Group.
- The number of windows in a window group can be greater than the number of frames in the virtual desktop.
- By pressing the shortcut key, a window hidden in a window group can be displayed in turn in the selected frame.
Default Key Binding in Musca
The default Musca Key Binding is more comfortable. The default mod key is mod4, that is, the Left window key. (My right window key can also be used ).
In the following table, m represents the MOD key, s represents shift, and c Represents control.
Keys |
Command |
Action |
M + m |
Command |
Run the Musca command through dmenu |
M + H |
Heatmap 1/2 |
Vertically split the selected frame into two vertical frames |
M + V |
Vsplit 1/2 |
Splits the selected frame into two horizontal frames. |
M + R |
Remove |
Remove current frame |
M + O |
Only |
Remove other frames to maximize the current frame |
M + u |
Undo |
Restore to the frame layout just now |
M + d |
Dedicate flip |
(Toggle) the selected frame is dedicated to the current application. |
M + |
Catchall flip |
(Toggle) sets the selected frame to catchall, and all newly opened application windows appear in this frame. |
M + left |
Focus left |
Focus on the left Frame |
M + Right |
Focus right |
Focus on the right frame |
M + up |
Focus up |
Focus on the above Frame |
M + down |
Focus down |
Focus on the following Frames |
M + C + left |
Resize left |
Adjust the horizontal size of the current frame |
M + C + Right |
Resize right |
Adjust the horizontal size of the current frame |
M + C + up |
Resize up |
Adjust the vertical size of the current frame |
M + C + down |
Resize down |
Adjust the vertical size of the current frame |
M + T |
Exec xterm |
Start an xterm. You can link other terminals to xterm. |
M + x |
Shell |
Start the application through dmenu |
M + W |
Switch window |
Use dmenu to switch the window in the current group |
M + k |
Kill |
Close the application politely once, and force close twice |
M + c |
Cycle |
Display the hidden window cyclically in the current frame |
M + S + left |
Swap left |
Swap the window in the current frame with the window in the left Frame |
M + S + Right |
Swap right |
Swap the window in the current frame with the window in the right frame |
M + S + up |
Swap up |
Swap the window in the current frame with the window in the above Frame |
M + S + down |
Swap down |
Swap the window in the current frame with the window in the following Frame |
M + G |
Switch Group |
Change the window group through dmenu (similar to a virtual desktop) |
M + Pageup |
Use (prev) |
Switch to the previous window Group |
M + pagedn |
Use (next) |
Switch to the next window Group |
M + S |
Stack flip |
(Toggle) switches the current group between tiling and stacking modes. |
M + Tab |
Screen (next) |
Switch to the next available Screen |
Java program bug
Some Java graphics programs may run abnormally. In fact, this has nothing to do with Musca, because Sun Java violates the ICCCM compatibility protocol after 1.5, so some programs that use xtoolkit/xawt may run abnormally. The solution to this problem is to set the environment variable awt_toolkit = mtoolkit to use the older motif style.
I added this line to my. bashrc:
AWT_TOOLKIT=MToolkit
I know that many awesome users are also worried about some Java programs. Try this method to solve your problem.
More proficient in Musca
The following content mainly refers to the document on the Musca homepage.
We can not only control Musca through shortcuts, but also control Musca Through Musca commands. One way to pass commands to Musca is MoD + M. You can run the Musca command by entering the Musca command in dmenu.
Another way is to directly input Musca-C 'xxx' in the terminal and let Musca execute XXX, where XXX is the Musca command.
Why do we need to understand the Musca command, because we can let Musca execute some command at Musca startup to customize Musca.
Musca command Overview
Command |
Purpose |
Add <Name> |
Add a window group and switch to it |
Alias <Name> <command> |
Generate a Musca command alias |
Bind <on | off> <modifier> + <key> <command> |
Add (on) or clear (off) Key Binding. Only the command parameter is required for on. Bind off all will clear all key bindings |
Border <on | off> |
Whether the current frame shows edges. |
Catchall |
Whether the current frame is catchall |
Client hints <on | off> |
Whether the current application window follows the X size prompt. |
Command |
Start dmenu and wait for Musca command input |
Cycle <local> <next | Prev> |
Hide the window in the current frame in a loop. All options are optional. |
Dedicate <on | off> |
(Toggle) Whether to assign the current frame to the current application. |
Drop <name | number> |
Delete a window group by name or number |
Dump <File> |
Export the description (current group name and frame layout) to the specified file |
Exec <command> |
Execute a shell command |
Focus <left | right | up | down> |
Focus on the left/right/top/Bottom Frames |
Lfocus | rfocus | ufocus | dfocus |
Focus on the left/right/top/Bottom Frames |
Height <relative | pixel> |
Specifies the height of the current frame, which can be pixel or XX % |
Hook <on | off> <pattern> <command> |
Bind a Musca command to a Musca command in any matching mode |
Heatmap <relative | pixel> |
Horizontal segmentation. |
Kill <number | Name> |
If number or name is given, the corresponding application is disabled; otherwise, the current frame is disabled. |
Load <File> |
Import a description file to the current window Group |
Manage <on | off> <Name> |
Whether the window class with the corresponding name is managed by Musca |
Move <name | number> |
Move the current window to the window group with the specified number or name. |
Name <Name> |
Renaming the current window Group |
Only |
Remove other frames to maximize the current frame |
Pad <left> <right> <top> <bottom> |
Set the screen range used by the current group |
Quit |
Exit Musca |
Raise <number | title> |
Raise and focus on the window with the specified number or title |
Refresh |
Refresh current frame |
Remove |
Remove current frame |
Resize <left | right | up | down> |
Reset the frame size in the specified direction |
Run <File> |
Run a file containing the Musca command, one command per line |
Say <text> |
Use the method set in 'composer y' to display text |
Screen <number> |
Switch to the screen of the specified number. |
Set <setting> <value> |
Set the Musca variable value |
Shell |
Start dmenu and wait for Musca command input |
Show <Settings> |
Display the Musca variable value. It is best to add silent when show is in the background, such as silent show XXX. |
Show <bindings> |
Display Key Binding |
Show <unmanaged> |
Display unmanageable window classes |
Show |
Display command triggers |
Show <Groups> |
Display window Group |
Show <frames> |
Show all frames |
Show <Windows> |
Show all windows |
Show <aliases> |
Display command alias |
Shrink <name | ID> |
Minimize a window and use raise <name | ID> to restore it. |
Slide <left | right | up | down> |
Move the current window to a specified frame |
Lslide | rslide | uslide | dslide |
Move the current window to a specified frame |
Stack <on | off | flip> |
Switches the current group between tiling and stacking modes. |
Swap <left | right | up | down> |
Swap the current window with the window in the specified direction Frame |
Lswap | rswap | uswap | dswap |
Swap the current window with the window in the specified direction Frame |
Switch <window | group> |
Start the dmenu window switch or group switch |
Undo |
Restore to the layout of the previous Frame |
Use <name | Number | (other) | (prev) | (next)> |
Switch the group by name or number. |
Vsplit <relative | pixel> |
Vertically split the current frame. |
Width <relative | pixel> |
Set the width of the current frame. |
Musca startup Customization
At Musca startup, you can read a file that stores the Musca commands and execute these commands. Each command line can contain empty lines. The comment line starts.
When Musca is started, the. musca_start file in the startup directory is read by default. Generally, the startup directory is $ home ~ /. Put the command that I want Musca to execute in musca_start.
The following is the content of my. musca_start file:
# musca startup file.# musca is a light weight tiling window manager.# This file list the commands that you want musca to execute.# make Trayer and Conky not managed by musca.manage off trayermanage off Conky# set backgroundexec feh --bg-scale ~/images/wallpapers/1440x900-injunctions.jpg# startup conkyexec conky# startup trayerexec trayer --edge top --align right --widthtype request --height 20--SetDockType true --transparent true --alpha 255 --tint 0x00ff00border off# set active range, leave 20 pixels in top for conky and trayerpad 0 0 20 0# set active range after a new group is added.hook on ^add pad 0 0 20 0# add a new group named geekadd geek# switch back to group 0 (default)use 0
Musca variable
You can also run the Musca command set MuscaVariable someValue to set the Musca appearance and behavior, so it is also useful to understand the Musca variable.
Variable name |
Default Value |
Description |
Border_focus |
Blue |
Border color when focusing |
Border_unfocus |
Dim gray |
Border color when the focus is lost |
Border_dedicate_focus |
Red |
The color of a dedicated frame. |
Border_dedicate_unfocus |
Dark red |
The color when the private frame loses the focus. |
Border_catchall_focus |
Green |
Color of catchall frame focus |
Border_catchall_unfocus |
Dark green |
Specifies the color of a catchall frame when the focus is lost. |
Border_width |
1 |
Border width, minimum 0 |
Frame_min_wh |
100 |
Minimum width and height of frames and managed windows |
Frame_resize |
20 |
Frame size adjustment |
Startup |
. Musca_start |
File name in the startup directory that is executed at startup |
Dmenu |
Dmenu-I-B |
Command Line when dmenu is started |
Switch_window |
Sed's/^/raise/'| $ Musca-I |
Command executed when the window is selected in dmenu |
Switch_group |
Sed's/^/use/'| $ Musca-I |
Command executed when selecting a window group in dmenu |
Run_musca_command |
$ Musca-I |
Processing Method when a user enters a command through dmenu |
Run_shell_command |
Sed's/^/exec/'| $ Musca-I |
How to handle a shell command input through dmenu |
Notify |
EchoCat |
Display messages to users. The default method is displayed in standard output. |
Stack_mouse_modifier |
Mod4 |
Click the modify key in Stacking Mode to move the window and adjust the window size with the left and right mouse keys. |
Focus_follow_mouse |
0 |
Whether to move the focus with the mouse. If it is set to 1, it is |
Window_open_frame |
Current |
If it is current, the new window is opened in the focused frame. If it is empty, try to find an empty frame to open the new window. |
Window_open_focus |
1 |
The new window gets the focus. If it is set to 0, it is blocked. |
Window_size_hints |
1 |
If it is set to 0, the X size prompt is ignored. |
Command_buffer_size |
4096 |
Command buffer size passed to Musca-C or Musca-I |
Notify_buffer_size |
4096 |
User message buffer size |
Frame_display_hidden |
1 |
0: empty frames remain empty; 1: automatically display available hidden windows; 2: automatically displayed in the displayed windows of this frame |
Frame_split_focus |
Current |
After the frame is split, current: Focus is kept in the original frame; new: focus on the new frame. |
Group_close_empty |
0 |
When an empty group loses focus, 1: The group is automatically closed; 0: The Group remains unchanged. |
Musca expectations
Although Musca can quickly and easily change from the tiling mode to the Stacking Mode, I still hope to continue working in the tiling mode while using pidgin programs, which are preferably floating. Therefore, I hope that Musca can provide functions to set that some programs are always floating. As in larswm and awesome, you can set which programs are always floating in the configuration file. I will write to the Musca development team and hope they will consider this feature.
Initial Experience of tiled Window Manager Musca