From 020215b765a200af44fe98e8086430fa8d3f8b37 Mon Sep 17 00:00:00 2001 From: Morgan Aldridge Date: Wed, 16 Aug 2023 22:50:04 -0400 Subject: [PATCH] Added new mlvwm-screenshot wrapper script for maim, plus added 'ShortCut' configuration in .mlvwmrc so that ctrl-shift-3 & ctrl-shift-4 now take screenshots of the root window or a selected area, respectively. Issue #3 --- .mlvwm/.mlvwmrc | 2 ++ README.md | 3 ++- bin/mlvwm-screenshot | 13 +++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 bin/mlvwm-screenshot diff --git a/.mlvwm/.mlvwmrc b/.mlvwm/.mlvwmrc index 788b475..0f9a556 100644 --- a/.mlvwm/.mlvwmrc +++ b/.mlvwm/.mlvwmrc @@ -53,6 +53,8 @@ Left M PreviousSameDeskWindow Right M NextSameDeskWindow Escape M Restart mlvwm Escape SM Exit +3 SC Exec "mlvwm-screenshot" exec .bin/mlvwm-screenshot +4 SC Exec "mlvwm-screenshot" exec .bin/mlvwm-screenshot -s END # Load Theme from themes/ ('System7', 'MacOS8', or 'MacOS9') diff --git a/README.md b/README.md index f92911e..4743359 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,9 @@ MLVWM includes a very rudimentary set of rc ([run command](https://en.wikipedia. * `make` * `unzip` * `curl` -* `xdotool` * ImageMagick +* `xdotool` (for `mlvwm-restart`) +* [`maim`](https://github.com/naelstrof/maim) & [`slop`](https://github.com/naelstrof/slop) (for `mlvwm-screenshot`) ## USAGE diff --git a/bin/mlvwm-screenshot b/bin/mlvwm-screenshot new file mode 100755 index 0000000..2f9d6ce --- /dev/null +++ b/bin/mlvwm-screenshot @@ -0,0 +1,13 @@ +#!/bin/sh + +# mlvwm-screenshot - Take a screenshot using maim and save it as a date-stamped PNG +# +# Assumes that your ~/.mlvwmrc contains the following: +# +# ShortCut +# 3 SC Exec "mlvwm-screenshot" exec ./bin/mlvwm-screenshot +# 4 SC Exec "mlvwm-screenshot" exec ./bin/mlvwm-screenshot -s + +SCREENSHOT_DIR=${SCREENSHOT_DIR:-$HOME/Pictures} + +maim "$@""${SCREENSHOT_DIR}/screenshot-$(date +%Y%m%d-%H%M%S).png"