From b31e066bd5adb2fb060d0f5f4e65458b25db2d66 Mon Sep 17 00:00:00 2001 From: dtb Date: Wed, 15 Jun 2022 16:15:40 -0400 Subject: [PATCH] displaym(1) man page --- man/displaym.1 | 25 +++++++++++++++++++++ man/displaym.md | 59 ------------------------------------------------- 2 files changed, 25 insertions(+), 59 deletions(-) create mode 100644 man/displaym.1 delete mode 100644 man/displaym.md diff --git a/man/displaym.1 b/man/displaym.1 new file mode 100644 index 0000000..10c351c --- /dev/null +++ b/man/displaym.1 @@ -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) diff --git a/man/displaym.md b/man/displaym.md deleted file mode 100644 index d8cbc7f..0000000 --- a/man/displaym.md +++ /dev/null @@ -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]`).