Skip to content

Commit

Permalink
Add wiki pages for RandR Monitor support and Desktopconfiguration.
Browse files Browse the repository at this point in the history
  • Loading branch information
somiaj authored and ThomasAdam committed Apr 1, 2024
1 parent b135847 commit 9135ae9
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 44 deletions.
54 changes: 54 additions & 0 deletions Wiki/Config/DesktopConfiguration/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
layout: wiki
title: DesktopConfiguration
type: config
weight: 460
description: |
Fvwm3 supports multiple monitor setups using RandR. Using RandR
fvwm can manage which virtual desk and page are on independently.
DesktopConfiguration controls if monitors are treated independently
or as a group.
---

# DesktopConfiguration

* TOC
{:toc}

Starting with fvwm3, using RandR support, fvwm can manage each
monitor connected to it independently. The `DesktopCoonfiguration`
command tells fvwm3 how to manage the virtual desktop. The three supported
modes are:

* `global` (default)
* `per-monitor`
* `shared`

Fvwm splits its virtual desktop into both [Pages and Desks](
{{ "/Config/PagesAndDesks" | prepend: site.wikiurl }}). The
[FvwmPager]({{ "/Modules/FvwmPager" | prepend: site.wikiurl }})
module provides a miniature view of the desks and virtual pages.

## Global

This is the default and traditional way of dealing with multiple monitors.
They all move through the virtual pages and desks as a single group. In
essence think of all monitors as a single big monitor that can view a given
piece of the virtual desktop.

## Per-Monitor

This allows controlling which page/desktop each monitor is on independently.
In this case think of each monitor as having its own virtual desktop
independent of each other, with the advantage you can move windows between
monitors on different desks/pages.

## Shared

This is similar to per-monitor mode, in that each monitor can move around the
pages independently. The difference is the virtual desktops are shared across
the monitors. This means, that only a single monitor can view a desk at a
time. If you move a monitor to a desk that is currently being viewed another
monitor, the two desks these monitors are viewing will be swapped. In other
words all the windows in all pages across the same desk are swapped between
the two monitors.
116 changes: 116 additions & 0 deletions Wiki/Config/Monitors/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
layout: wiki
title: Monitors
type: config
weight: 480
description: |
Fvwm3 supports multiple monitor setups using RandR.
Fvwm identifies monitors by their RandR name, and
many aspects of fvwm can be configuraed on a per-monitor
basis.
---

# Fvwm RandR Support

* TOC
{:toc}

Starting with fvwm3, monitors are managed using the RandR
protocol. RandR monitors can be configured using various
tools, two of which are the command line tool `xrandr` which
can query and configure monitors, and a graphical tool
`arandr` which you can use a GUI to position the monitors.
Fvwm will also respond to any changes to the RandR layout,
including adding, disabling, or removing monitors.

Fvwm understands each RandR monitors name, and can control
what is viewed on each monitor independently. This allows
for lots of commands to contain a `screen RandRname` configuration
open, where `RandRname` is the name of the monitor according
to `RandR`. See `xrandr -q` for monitor names and your current
configuration.

Beyond just being able to use the RandR name to specify
which screen to move windows to, or start them on, many
configuration options can be controlled per monitor.
Some notable examples are each monitor has its own set
of edges, and options such as `EwmhBaseStruts`,
`EdgeCommand`, `EdgeThickness`, and `EdgeScroll`, can
be configured individually for each monitor.

RandR arranges the monitors together into a single
bounding rectangle, which serves the current view
port of the fvwm virtual desktop layout. Each RandR
view port counts as a single Page, and fvwm divides
the virtual desktop into multiple [Pages and Desks](
{{ "/Config/PagesAndDesks" | prepend: site.wikiurl }}).
Monitors can move between the different pages and
desks independently or in a group, and this behavior
is controlled by the [DesktopConfiguration](
{{ "/Config/DesktopConfiguration" | prepend: site.wikiurl }})
command.

An overview of fvwm's virtual desktop, including which desk
and page each window and monitor is view can be seen using
the [FvwmPager]({{ "/Modules/FvwmPager" | prepend: site.wikiurl }})
module.

# Monitor Expansion and Numbering

Fvwm provides string expansion that can be used with monitors
that can be used in fvwm configuration and commands. Some examples
include `$[monitor.primary]` or `$[monitor.current]` which return
the name of the primary monitor or the monitor the pointer is in
respectively. These expansions can be used in place of a
RandR name when sending fvwm monitor based commands.


```fvwm2rc
# Move the primary monitor to the second desk,
# while leaving the other monitors alone.
DesktopConfiguration per-monitor
GotoDesk screen $[monitor.primary] 0 2
```

In addition fvwm numbers the monitors based on their
position inside their combined view port. This numbering
is deterministic, starting with the top, left most
monitor being zero. And numbering each row horzitonally
The ordering then moves in rows

```
# Example 1, three monitors in a row.
+---+---+---+
| 0 | 1 | 2 |
+---+---+---+
# Example 2, one monitor above two in a row.
+---+
| 0 |
+---+
+---+---+
| 1 | 2 |
+---+---+
```

This numbering is independent on which monitors are binging
used and provide a way to make a configuration only depend
on a monitors position, not its name. The name of each monitor
can be expanding using the `$[monitor.n.name]` expansion, for
example change the desk of only monitor 2 use.

```
GotoDesk screen $[monitor.2.name] 0 2
```

See the fvwm3 manual page for all the different monitor expansions
which can be used to both reference and get RandR configuration
information from, including size and position. For instance, to
get fvwm3 to tell you the width of monitor number 1, use:

```
Echo $[monitor.$[monitor.1.name].width]
```

106 changes: 62 additions & 44 deletions Wiki/Config/PagesAndDesks/index.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,43 @@
---
layout: wiki
title: Pages and Desks
title: Virtual Pages and Desks
type: config
weight: 470
description: |
Fvwm supports multiple Virtual Desktops. And more you can also
split each Desktop up into an nxm grid of Pages.
Fvwm supports multiple Virtual Desktops, and each Desktop
is further split into an NxM grid of Pages.
---

# Virtual Desktops

Fvwm supports multiple Desktops. The default desktop is 0 and there
is no set cap on the number of desktops you can use. Desktops are
available on demand and can be moved between using the GotoDesk
command (note MoveToDesk, for windows, as the same syntax).
* TOC
{:toc}

GotoDesk can be configured to go to a specific Desk or just cycle
through them. Here are some examples:
Fvwm splits up its virtual desktops into pages and desks.
Starting with fvwm3, [DesktopConfiguration](
{{ "/Config/DesktopConfiguration" | prepend: site.wikiurl }})
can be used to configure if monitors can move through each
virtual desk or page independently.

{% highlight fvwm %}
# GotoDesk [step] [min] [max]
# One Desk forward, max of 6
GotoDesk 1 0 6
# One desk backwards min of 0
GotoDesk -1 0 6
The module [/Modules/FvwmPager](
{{ "/Modules/FvwmPager" | prepend: site.wikiurl }})
gives a miniature view of your desks, pages, windows,
and monitors location.

# GotoDesk [relative] [absolute]
# GotoDesk 5
GotoDesk 0 5
# GotoDesk 2
GotoDesk 0 2
{% endhighlight %}
## Pages

Additionally Desktops can be given names with:
A single fvwm Desktop is split up into an `NxM` grid of pages.
Each page is a single viewport of all the [Monitors](
{{ "/Config/Monitors" | prepend: site.wikiurl }})
together. The virtual desktop is then extended in such a way
that the current view is of a single page in this much larger
virtual screen. The number of pages is configured with the
`DesktopSize` command.

{% highlight fvwm %}
DesktopName 0 Main
DesktopName 1 Web
...
{% endhighlight %}

# Pages

Each Desktop can be further split into a grid of Pages, where one
Page is the size of your viewport (monitor) and you can move around
the Pages as if you had a bigger screen, but only see one portion of it.

Here is an example to configure Pages:

{% highlight fvwm %}
# 4 Desktops split into a 3x2 Grid
# 4 Desktops split into a 3x2 Grid.
# Pages are identified using two numbers:
# COLUMN ROW
# +---+---+---+
# |0 0|1 0|2 0|
# +---+---+---+
Expand All @@ -61,12 +48,13 @@ DesktopSize 3x2

That will give you a grid of 3x2 Pages where the numbers
are the x and y coordinates of each page. You can move through
the pages using the GotoPage (and MoveToPage for windows) in a similar
fashion to GotoDesk above.
the pages using the `GotoPage` (and `MoveToPage` for windows).

In addition to just moving through the page you can scroll or only move part
way between two pages. You can also set up functions that will automatically
move you between pages when your mouse hits the edge of the screen. For example:
move you between pages when your mouse hits the edge of the screen.
For example (note, in fvwm3 all of these commands can be configured per
monitor by adding the `screen RandRname` option):

{% highlight fvwm %}
# EdgeScroll Xpercent Ypercent
Expand All @@ -84,9 +72,39 @@ Style * EdgeMoveDelay 350, EdgeMoveResistance 350
Additionally you can move around with

{% highlight fvwm %}
GotoDeskAndPage desk Xpage yPage
GotoPage screen RandRname xPage yPage
GotoDeskAndPage screen RandRname desk xPage yPage
{% endhighlight %}

Or use [/Modules/FvwmPager]({{ "/Modules/FvwmPager" | prepend: site.wikiurl }})
to give a miniature view of your Desks, Pages and Windows.
## Desktops

Fvwm supports multiple Desktops. The default desktop is 0 and there
is no set cap on the number of desktops you can use. Desktops are
available on demand and can be moved between using the `GotoDesk`
command (note `MoveToDesk`, for windows, as the same syntax).

`GotoDesk` can be configured to go to a specific Desk or just cycle
through them. Here are some examples:

{% highlight fvwm %}
# GotoDesk [step] [min] [max]
# One Desk forward, max of 6
GotoDesk 1 0 6
# One desk backwards min of 0
GotoDesk -1 0 6

# GotoDesk [relative] [absolute]
# GotoDesk 5
GotoDesk 0 5
# GotoDesk 2
GotoDesk 0 2
{% endhighlight %}

Additionally Desktops can be given names with:

{% highlight fvwm %}
DesktopName 0 Main
DesktopName 1 Web
...
{% endhighlight %}

0 comments on commit 9135ae9

Please sign in to comment.