scrotwmos
SWM-WEB(1) General Commands Manual SWM-WEB(1)

swm-web — scrotwmos tiling terminals in a web browser

swm-web [-h height] [-p port] [-w width]

swm-web is the scrotwmos tiling core with a web browser for its screen. It serves a page over HTTP and WebSocket on the loopback interface, 127.0.0.1 and ::1. It opens a WebSocket only for its own page: the request must name localhost, 127.0.0.1, or [::1] with its port as its Host, and http:// and that Host as its Origin. It asks for no password: any local user who can reach the port gets a shell as the user who runs it. Each window on the page is a terminal: a login shell on a pseudo-terminal that swm-web runs, drawn by xterm.js in the browser. The layouts, workspaces, and key bindings are those of scrotwmos.conf(5).

The page is index.html; config.html changes settings while it runs. One browser at a time holds each of them. swm-web refuses a second. When a browser connects with no window focused, swm-web opens three terminals.

The options are as follows:

height
The screen height in pixels, 1 to 32767, until a browser connects and sends the size of its page. The default is 1080.
port
Listen on TCP port, 1 to 65535. The default is 8080.
width
The screen width in pixels, 1 to 32767, until a browser connects and sends the size of its page. The default is 1920.

The modifier is Mod1 by default. These bindings differ from those of scrotwmos.conf(5):

Mod+Q
close the window
Mod+Shift+Q
close the window
Mod+T
vertical layout
Mod+Y
horizontal layout
Mod+F
float the window, or tile it again

Only the bindings whose action the browser knows reach it.

At start, swm-web reads ~/.scrotwmos.conf as lines of key = value. A line that starts with ‘#’ is a comment. swm-web does not read /etc/scrotwmos.conf.

A key libswm knows sets what scrotwmos.conf(5) says, and so do bind[action] and unbind. These keys are this program's own:

, bar_color, bar_font_color
The bar's colors, as CSS takes them. The defaults are #008080, black, and #a0a0a0.
, color_unfocus
The border colors of the focused and other windows. The defaults are red and #888888.
, Mod4, or Control.
The options of scrotwmos.conf(5) as their bit mask, a number from 0 to 4294967295. swm-web refuses their names.

swm-web skips a refused line. It does not write a change made on config.html to the file.

The directory of .scrotwmos.conf; when unset, the current directory.
The shell each terminal runs, as a login shell. When unset, /bin/sh.

A shell gets TERM set to xterm-256color and no LD_PRELOAD.

~/.scrotwmos.conf
settings
www/
the pages, in the directory of the path that started swm-web, or ./www when that path has no slash

, SIGTERM
Send SIGHUP to every shell and exit.

swm-web exits 0 on SIGINT or SIGTERM, and 1 on a bad option or when it cannot start.

$ build/bin/swm-web/swm-web -p 8081 -w 1280 -h 800

Then open http://localhost:8081/ in a browser.

swm-wl(1), swm-x11(1), scrotwmos.conf(5), scrotwmos(7)

Marco Peereboom <marco@peereboom.us>

November 13, 2026 Void Linux