From 45425c91d10ced40957c5b66c96a5fe85550dbd7 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Wed, 17 Jan 2024 11:30:25 -0500 Subject: [PATCH] Decouple screenshot script from Xmd, Xmd session from Mwm --- INSTALL.md | 9 +++++++-- glue/src/{xmd-screenshot => screenshot} | 0 session/src/xmd | 4 +++- session/src/xmd-end-session | 8 ++++++++ 4 files changed, 18 insertions(+), 3 deletions(-) rename glue/src/{xmd-screenshot => screenshot} (100%) create mode 100755 session/src/xmd-end-session diff --git a/INSTALL.md b/INSTALL.md index 35a1521..3bbe957 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -49,6 +49,11 @@ in their respective subdirectories: ## Session -Xmd includes a startup script and assorted "glue code" to facilitate using it as -a desktop environment. It can be installed using `./install.sh` in the `session` +Xmd includes several scripts to facilitate using it as a desktop environment. It +can be installed using `./install.sh` in the `session` directory. + +## Glue + +Xmd includes some utility scripts to provide a standard interface for things +like screenshotting. These can be installed using `./install.sh` in the `glue` directory. diff --git a/glue/src/xmd-screenshot b/glue/src/screenshot similarity index 100% rename from glue/src/xmd-screenshot rename to glue/src/screenshot diff --git a/session/src/xmd b/session/src/xmd index b43f0fd..6989931 100755 --- a/session/src/xmd +++ b/session/src/xmd @@ -1,5 +1,7 @@ #!/bin/sh +export XMD_SESSION_PID="$$" + export XMD_USERDIR="${HOME}/.Xmd" mkdir -p "${XMD_USERDIR}" @@ -26,4 +28,4 @@ else echo "!!! cant find $startupDir" fi -exec mwm +sleep infinity diff --git a/session/src/xmd-end-session b/session/src/xmd-end-session new file mode 100755 index 0000000..cb0c4da --- /dev/null +++ b/session/src/xmd-end-session @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ -z "$XMD_SESSION_PID" ]; then + echo "ERR session is not running (\$XMD_SESSION_PID not set)" + exit 1 +fi + +kill "$XMD_SESSION_PID"