From 4b01b571b333562408b145256e7b3948441d8ddb Mon Sep 17 00:00:00 2001 From: LEVAI Daniel Date: Mon, 2 Dec 2013 22:34:10 +0700 Subject: desktop/spectrwm: Updated for version 2.4.0. Signed-off-by: Willy Sudiarto Raharjo --- desktop/spectrwm/examples/README | 5 ++-- desktop/spectrwm/examples/spectrwm.conf | 1 + desktop/spectrwm/examples/spectrwm_screenshot.sh | 32 +++++++++++++----------- 3 files changed, 21 insertions(+), 17 deletions(-) (limited to 'desktop/spectrwm/examples') diff --git a/desktop/spectrwm/examples/README b/desktop/spectrwm/examples/README index 378ecae0af247..f908cfb187bbc 100644 --- a/desktop/spectrwm/examples/README +++ b/desktop/spectrwm/examples/README @@ -19,8 +19,9 @@ o wifi_link_quality.sh - optional spectrwm_screenshot.sh: -This makes a screenshot of the actual X11 screen or optionally just a window. -It needs the graphics/scrot package from the SBo repository. +This makes a screenshot of the whole X11 screen or optionally just a window. +It needs the ImageMagick (included in Slackware) or GraphicsMagick (available +from the SBo repository) package's `import` utility. You can configure it in your spectrwm.conf like this: program[capture] = spectrwm_screenshot.sh full bind[capture] = MOD+c diff --git a/desktop/spectrwm/examples/spectrwm.conf b/desktop/spectrwm/examples/spectrwm.conf index d4c47344801b7..a88cd19992aa5 100644 --- a/desktop/spectrwm/examples/spectrwm.conf +++ b/desktop/spectrwm/examples/spectrwm.conf @@ -17,6 +17,7 @@ title_name_enabled = 1 # current window's title title_class_enabled = 1 # current window's class name window_name_enabled = 1 # current window's name urgent_enabled = 1 # information about the workspace's urgency hints +iconic_enabled = 1 # show the number of iconified windows on the workspace verbose_layout = 0 # workspace's master and stack values focus_mode = default # default, follow, manual diff --git a/desktop/spectrwm/examples/spectrwm_screenshot.sh b/desktop/spectrwm/examples/spectrwm_screenshot.sh index 6a01fd67a69d5..c169a1dec62ae 100644 --- a/desktop/spectrwm/examples/spectrwm_screenshot.sh +++ b/desktop/spectrwm/examples/spectrwm_screenshot.sh @@ -1,21 +1,23 @@ #!/bin/sh -SCROT=$(which scrot) -[ -x "${SCROT}" ] || exit 1 +CAPTURE_TOOL=/usr/bin/import +if [ ! -x "${CAPTURE_TOOL}" ];then + echo "$0: couldn't run ${CAPTURE_TOOL}" >&2 + exit 1 +fi -screenshot() { - case $1 in - full) - "${SCROT}" --multidisp - ;; - window) +CAPTURE_PATH="${HOME}/spectrwm_capture_$(date +%FT%T).png" + +case "$1" in + 'full') + "${CAPTURE_TOOL}" -window root png:"${CAPTURE_PATH}" + ;; + 'window') sleep 0.5 - "${SCROT}" --select - ;; + "${CAPTURE_TOOL}" png:"${CAPTURE_PATH}" + ;; *) - ;; - esac; -} - -screenshot $1 + echo "$0: $0 <-full | -window>" >&2 + ;; +esac -- cgit v1.2.3