diff --git a/cmd/wmii/client.c b/cmd/wmii/client.c index f6017988..06039371 100644 --- a/cmd/wmii/client.c +++ b/cmd/wmii/client.c @@ -433,6 +433,22 @@ kill_client(Client * c) { XKillClient(display, c->w.w); } +void +fullscreen(Client *c, Bool fullscreen) { + Frame *f; + + c->fullscreen = fullscreen; + if((f = c->sel)) { + if(fullscreen) { + if(!f->area->floating) + send_to_area(f->view->area, f); + focus_client(c); + } + if(f->view == screen->sel) + focus_view(screen, f->view); + } +} + void set_urgent(Client *c, Bool urgent, Bool write) { XWMHints *wmh; @@ -615,16 +631,8 @@ configreq_event(Window *w, XConfigureRequestEvent *e) { r = rectaddpt(r, p); r = gravclient(c, r); - if((Dx(r) == Dx(screen->r)) - && (Dy(r) == Dy(screen->r))) { - c->fullscreen = True; - if(f) { - if(!f->area->floating) - send_to_area(f->view->area, f); - focus_client(c); - restack_view(f->view); - } - } + if((Dx(r) == Dx(screen->r)) && (Dy(r) == Dy(screen->r))) + fullscreen(c, True); if(c->sel->area->floating) resize_client(c, &r); diff --git a/cmd/wmii/fns.h b/cmd/wmii/fns.h index f6a4603d..d03ce946 100644 --- a/cmd/wmii/fns.h +++ b/cmd/wmii/fns.h @@ -32,8 +32,9 @@ void map_client(Client*); void unmap_client(Client*, int state); int map_frame(Client*); int unmap_frame(Client*); -void set_urgent(Client *c, Bool urgent, Bool write); -void set_cursor(Client*, Cursor cur); +void fullscreen(Client*, Bool); +void set_urgent(Client *, Bool urgent, Bool write); +void set_cursor(Client*, Cursor); void focus_frame(Frame*, Bool restack); void reparent_client(Client*, Window*, Point); void manage_client(Client*); diff --git a/cmd/wmii/message.c b/cmd/wmii/message.c index a8bec29b..cbdfad07 100644 --- a/cmd/wmii/message.c +++ b/cmd/wmii/message.c @@ -15,6 +15,8 @@ static char /* Edit |sort Edit s/"([^"]+)"/L\1/g Edit |tr 'a-z' 'A-Z' */ enum { + LFULLSCREEN, + LNOTFULLSCREEN, LNOTURGENT, LURGENT, LBORDER, @@ -39,6 +41,8 @@ enum { LTILDE, }; char *symtab[] = { + "Fullscreen", + "NotFullscreen", "NotUrgent", "Urgent", "border", @@ -351,6 +355,12 @@ message_client(Client *c, Message *m) { case LNOTURGENT: set_urgent(c, False, True); break; + case LFULLSCREEN: + fullscreen(c, True); + break; + case LNOTFULLSCREEN: + fullscreen(c, False); + break; default: return Ebadcmd; } diff --git a/man/wmii.1 b/man/wmii.1 index 5f28a4b5..a05f7a09 100644 --- a/man/wmii.1 +++ b/man/wmii.1 @@ -3,12 +3,128 @@ wmii \(em window manager improved\(emimproved .SH SYNOPSIS .B wmii +.RB [ -a +.IR
] +.RB [ -c +.IR ] +.br +.B wmii \-v + .SH DESCRIPTION +.PD 0 .SS Overview .B wmii -is a dynamic window manager for X11. See -.BR wmiiwm (1) -for more info. +is a dynamic window manager for X11. In contrast to static window management +the user rarely has to think about how to organize windows, no matter what he +is doing or how many applications are used at the same time. The window manager +adapts to the current environment and fits to the needs of the user, rather +than forcing him to use a preset, fixed layout and trying to shoehorn all +windows and applications into it. +.P +.B wmii +supports classic and tiled window management with extended keyboard and mouse +control. The classic window management arranges windows in a floating layer +in which windows can be moved and resized freely. The tiled window management +is based on columns which split up the screen horizontally. Each column handles +arbitrary windows and arranges them vertically in a non\-overlapping way. They +can then be moved and resized between and within columns at will. +.P +.B wmii +provides a virtual filesystem which represents the internal state similar to +the procfs of Unix operating systems. Modifying this virtual filesystem results +in changing the state of the window manager. The virtual filesystem service can +be accessed through 9P\-capable client programs, like +.BR wmiir (1) . +This allows simple and powerful remote control of the core window manager. +.P +.B wmii +basically consists of clients, columns, views, and the bar, which are described +in detail in the +.B Terminology +section. + +.SS Terminology +.TP 2 +Display +A running X server instance consisting of input devices and screens. +.TP 2 +Screen +A physical or virtual (Xinerama or +.BR Xnest (1)) +screen of an X display. A screen displays a bar window and a view at a time. +.TP 2 +Window +A (rectangular) drawable X object which is displayed on a screen, usually an +application window. +.TP 2 +Client +An application window surrounded by a frame window containing a border and a +title\-bar. +.TP 2 +Floating layer +A screen layer of +.B wmii +on top of all other layers, where clients are arranged in a classic (floating) +way. They can be resized or moved freely. +.TP 2 +Managed layer +A screen layer of +.B wmii +behind the floating layer, where clients are arranged in a non\-overlapping +(managed) way. Here, the window manager dynamically assigns each client a +size and position. The managed layer consists of columns. +.TP 2 +Tag +Alphanumeric strings which can be assigned to a client. This provides a +mechanism to group clients with similar properties. Clients can have one +tag, e.g. +.IR work , +or several tags, e.g. +.IR work+mail . +Tags are separated with the +.I + +character. +.TP 2 +View +A set of clients containing a specific tag, quite similiar to a workspace in +other window managers. It consists of the floating and managed layers. +.TP 2 +Column +A column is a screen area which arranges clients vertically in a +non\-overlapping way. Columns provide three different modes, which arrange +clients with equal size, stacked, or maximized respectively. Clients can be +moved and resized between and within columns freely. +.TP 2 +Bar +The bar at the bottom of the screen displays a label for each view and +allows the creation of arbitrary user\-defined labels. +.TP 2 +Event +An event is a message which can be read from a special file in the filesystem +of +.BR wmii , +such as a mouse button press, a key press, or a message written by a different +9P\-client. +.SS Basic window management +Running a raw +.B wmii +process without a +.BR wmiirc (1) +script provides basic window management capabilities already. However, to use +it effectively, remote control through its filesystem interface is necessary. +By default it is only usable with the mouse in conjunction with the +.I Mod1 (Alt) +modifier key. Other interactions, such as customizing the style, killing or +retagging clients, and grabbing keys, cannot be achieved without accessing the +filesystem. +.P +The filesystem can be accessed by connecting to the +.I address +of +.B wmii +with any 9P\-capable client, such as +.BR wmiir (1). + .SS Actions An action is a shell script in the default setup, but it can actually be any executable file. It is executed usually by selecting it from the @@ -196,10 +312,9 @@ and thus can be used in actions: .TP WMII_ADDRESS Socket file of -.BR wmiiwm (1). Used by .BR wmiir (1). .SH SEE ALSO -.BR wmiiwm (1), .BR dmenu (1), .BR wmiir (1) + diff --git a/man/wmiiloop.1 b/man/wmiiloop.1 index b427d6dd..8ac1b0dd 100644 --- a/man/wmiiloop.1 +++ b/man/wmiiloop.1 @@ -18,62 +18,46 @@ syntax to simplify writing a wmii event loop. .br .B eventloop -sends any text up to the first line containing -.I # -.IR Events|Actions|Key , -and any text after any other line begining with -.IR # , -directly to its standard output. Any other line is processed based -on its first word, with every indented line after it taken as its -.IR body . -.TP 2 -.BI "Key " sequence -The key sequence -.I sequence -is bound to its -.IR body . -.I sequence -is written to -.I /keys -and -.I body -is executed, with -.I $key -set to -.I sequence -whenever the key is pressed. +associates lines begining with +.IR Event ", " Action ", or " Key +(henceforth known as +.BR $keyword ), +followed by arbitrary text (henceforth known as +.BR $args ), +with functions which call any indented lines which follow. +In the function names, all non-alphanumeric characters in $args +are replaced with underscores (_). The functions are named +$keyword'_'$args. -.TP 2 -.BI "Event " name -Whenever an event with -.I name -is read from -.IR /event , -.I body -is executed, with -.I $event -set to -.IR name , -and -.I $[1\-9] -set to further arguments. +Any variables in the unintented lines are interpolated by the shell. -.TP 2 -.BI "Action " name -A function called -.BI Action_ name -is created with -.I body -as its body, and -.I name -is added to the -.I $ACTIONS -variable. +Additionally, each declaration's +.B $args +are assigned to a variable named +.BR $keyword's' . +In this case, no transliteration occurs. For instance, the following +declaration: + +.B Key +.IB $MODKEY -j +.br + echo Got $@ + +yields (assuming +.I $MODKEY +is set to +.IR Mod1 ): + +Keys=" $Keys Mod1-j" +.br +Mod1_j() { +.br + echo Got $@ +.br +} .SH SEE ALSO .BR wmii (1), .BR wmiir (1), -.BR wmiiwm (1) .B PREFIX/etc/wmiirc -http://www.cs.bell\-labs.com/sys/man/5/INDEX.html diff --git a/man/wmiiwm.1 b/man/wmiiwm.1 index 2054c1bd..dcf97887 100644 --- a/man/wmiiwm.1 +++ b/man/wmiiwm.1 @@ -9,40 +9,6 @@ wmiiwm \(em window manager improved\(emimproved (core) .RB [ \-v ] .SH DESCRIPTION -.PD 0 -.SS Overview -.BR wmiiwm (1) -is the core of window manager improved\(emimproved. -.P -.B wmii -is a dynamic window manager for X11. In contrast to static window management -the user rarely has to think about how to organize windows, no matter what he -is doing or how many applications are used at the same time. The window manager -adapts to the current environment and fits to the needs of the user, rather -than forcing him to use a preset, fixed layout and trying to shoehorn all -windows and applications into it. -.P -.B wmii -supports classic and tiled window management with extended keyboard and mouse -control. The classic window management arranges windows in a floating layer -in which windows can be moved and resized freely. The tiled window management -is based on columns which split up the screen horizontally. Each column handles -arbitrary windows and arranges them vertically in a non\-overlapping way. They -can then be moved and resized between and within columns at will. -.P -.B wmii -provides a virtual filesystem which represents the internal state similar to -the procfs of Unix operating systems. Modifying this virtual filesystem results -in changing the state of the window manager. The virtual filesystem service can -be accessed through 9P\-capable client programs, like -.BR wmiir (1) . -This allows simple and powerful remote control of the core window manager. -.P -.B wmii -basically consists of clients, columns, views, and the bar, which are described -in detail in the -.B Terminology -section. .SS Options .TP .BI \-a " address" @@ -63,86 +29,6 @@ Checks if another window manager is running. If not it exits with termination co .TP .B \-v Prints version information to stdout, then exits. -.SS Terminology -.TP 2 -Display -A running X server instance consisting of input devices and screens. -.TP 2 -Screen -A physical or virtual (Xinerama or -.BR Xnest (1)) -screen of an X display. A screen displays a bar window and a view at a time. -.TP 2 -Window -A (rectangular) drawable X object which is displayed on a screen, usually an -application window. -.TP 2 -Client -An application window surrounded by a frame window containing a border and a -title\-bar. -.TP 2 -Floating layer -A screen layer of -.B wmii -on top of all other layers, where clients are arranged in a classic (floating) -way. They can be resized or moved freely. -.TP 2 -Managed layer -A screen layer of -.B wmii -behind the floating layer, where clients are arranged in a non\-overlapping -(managed) way. Here, the window manager dynamically assigns each client a -size and position. The managed layer consists of columns. -.TP 2 -Tag -Alphanumeric strings which can be assigned to a client. This provides a -mechanism to group clients with similar properties. Clients can have one -tag, e.g. -.IR work , -or several tags, e.g. -.IR work+mail . -Tags are separated with the -.I + -character. -.TP 2 -View -A set of clients containing a specific tag, quite similiar to a workspace in -other window managers. It consists of the floating and managed layers. -.TP 2 -Column -A column is a screen area which arranges clients vertically in a -non\-overlapping way. Columns provide three different modes, which arrange -clients with equal size, stacked, or maximized respectively. Clients can be -moved and resized between and within columns freely. -.TP 2 -Bar -The bar at the bottom of the screen displays a label for each view and -allows the creation of arbitrary user\-defined labels. -.TP 2 -Event -An event is a message which can be read from a special file in the filesystem -of -.BR wmiiwm , -such as a mouse button press, a key press, or a message written by a different -9P\-client. -.SS Basic window management -Running a raw -.B wmiiwm -process without the -.BR wmii (1) -script provides basic window management capabilities already. However to use -it effectively, remote control through its filesystem interface is necessary. -By default it is only usable with the mouse in conjunction with the -.I Mod1 (Alt) -modifier key. Other interactions like customizing the style, killing or -retagging clients, or grabbing keys cannot be achieved without accessing the -filesystem. -.P -The filesystem can be accessed by connecting to the -.I address -of -.B wmiiwm -with any 9P\-capable client, like .BR wmiir (1). .SH SEE ALSO .BR wmii (1), diff --git a/rc/rc.wmii.rc b/rc/rc.wmii.rc index 08d6863c..1e044d95 100755 --- a/rc/rc.wmii.rc +++ b/rc/rc.wmii.rc @@ -101,10 +101,12 @@ menulast = '' fn Event-ClientMouseDown { client = $1; button = $2 if(~ $button 3) { - do=`{9menu -initial $menulast Nop Delete} + do=`{9menu -initial $menulast Nop Delete Fullscreen} switch($do) { case Delete wmiir xwrite /client/$client/ctl kill + case Fullscreen + wmiir xwrite /client/$client/ctl Fullscreen } if(! ~ $#do 0) menulast = $do;