1
0

displaym(1) man page

This commit is contained in:
dtb 2022-06-15 16:15:40 -04:00
parent 86f1667699
commit b31e066bd5
2 changed files with 25 additions and 59 deletions

25
man/displaym.1 Normal file
View File

@ -0,0 +1,25 @@
.TH DISPLAYM 1
.SH NAME
displaym \(en a window manager manager
.SH SYNOPSIS
displaym
.RB [ noun ]
.RB [ verb ]
.SH DESCRIPTION
Displaym runs the script verb.sh, where verb is supplied by the user to displaym, in the folder noun, where noun is supplied by the user to displaym.
.SH ENVIRONMENT VARIABLES
$DISPLAYM\_CONFIG refers to the location of the displaym configuration directory; this is the directory that contains noun/verb.sh.
If $DISPLAYM\_CONFIG is already set, it's not overriden.
The default location, if $XDG\_CONFIG\_HOME is set, is $XDG\_CONFIG\_HOME/displaym, otherwise $HOME/.displaym.
.SH DEPENDENCIES
mkdir(1), printf(1), sh(1), test(1)

View File

@ -1,59 +0,0 @@
# displaym
A dirt-simple window manager manager using shellscript.
## Dependencies
### POSIX
- mkdir(1)
- printf(1)
- sh(1)
- test(1)
### Non-POSIX
- bak(1)
## Design
It's encouraged to read the `displaym` source *rather than* this documentation, as the script is quite simple.
Usage: `displaym [WM] [action]`
`[WM]` refers to the folder in which `[action].sh` is stored.
`[action].sh` is sourced within `displaym`, which is a script executed by `sh(1)`.
On systems where Bash acts as the system's POSIX-compatible shell you may be able to use Bashisms within displaym actions but this isn't recommended.
The environment variable `$DISPLAYM_CONFIG` refers to the location of the displaym configuration directory; this is the directory that contains `[WM]/[action].sh`.
If `$DISPLAYM_CONFIG` is already set, it's not overriden.
The default location, if `$XDG_CONFIG_HOME` is set, is `$XDG_CONFIG_HOME/displaym`.
Otherwise, the default location is `$HOME/.displaym`.
If `$HOME` isn't set this will make the default displaym configuration directory location `/.displaym`.
Typically a `[WM]` folder will contain a `start.sh` and `stop.sh`, so (for example) the user may execute `displaym i3 start` to "start" the exemplary window manager i3.
Both the window manager name and action name are arbitrary, and use is not limited to the realm of window manager management, it just happens to be well suited to the application.
`displaym` could be renamed to `remotem` and the user could run `remotem [CITY] [COMPUTER]` to remote into a known computer in a known city.
Here's an example `bspwm/start.sh`:
```sh
#!/bin/sh
# start bspwm
# combine base sxhkd (keyboard daemon) config and bspwm-specifc config, output
# to the proper place
[ -n "$SXHKD_CONFIG ] || SXHKD_CONFIG="$HOME/.config/sxhkd/sxhkdrc"
cat "$DISPLAYM_CONFIG/sxhkdrc" "$DISPLAYM_CONFIG/$WM/sxhkdrc" >"$SXHKD_CONFIG"
# combine base .xinitrc (X initialization run-commands) and bspwm-specific
# .xinitrc, output to the proper place
cat "$DISPLAYM_CONFIG/.xinitrc" "$DISPLAYM_CONFIG/$WM/.xinitrc" >"$HOME/.xinitrc"
# start X
startx
```
Because the `[action].sh` is sourced from `displaym`, a number of useful environment variables are already set:
`$DISPLAYM_CONFIG`, `$WM`, and `$SCRIPT` (which refers to the `[action]`).