From b6e88b1f9ed2d57e9016853e69029e7903d083d9 Mon Sep 17 00:00:00 2001 From: "K. Eugene Carlson" Date: Fri, 16 Apr 2021 16:36:09 +0000 Subject: desktop/xss-lock: Added (using external locker as X screensaver) Signed-off-by: Dave Woodfall Signed-off-by: Willy Sudiarto Raharjo --- desktop/xss-lock/README | 17 +++ desktop/xss-lock/slack-desc | 19 ++++ desktop/xss-lock/xss-lock.1 | 200 +++++++++++++++++++++++++++++++++++ desktop/xss-lock/xss-lock.SlackBuild | 104 ++++++++++++++++++ desktop/xss-lock/xss-lock.info | 10 ++ 5 files changed, 350 insertions(+) create mode 100644 desktop/xss-lock/README create mode 100644 desktop/xss-lock/slack-desc create mode 100644 desktop/xss-lock/xss-lock.1 create mode 100644 desktop/xss-lock/xss-lock.SlackBuild create mode 100644 desktop/xss-lock/xss-lock.info diff --git a/desktop/xss-lock/README b/desktop/xss-lock/README new file mode 100644 index 0000000000..5a187fb578 --- /dev/null +++ b/desktop/xss-lock/README @@ -0,0 +1,17 @@ +This is xss-lock, a program for using an external locker as the X +screensaver. + +xss-lock can be run at startup with a favorite screensaving or +screenlocking program: + + xss-lock slock + +xset values for screensaver onset are respected. More details can be +found in the man page. + +xss-lock is a good choice for window manager-only graphical setups. +Desktop environments with native screensaver programs can (and probably +will) interfere with xss-lock. + +Optional dependency: docutils (if not installed, the man page will be +copied in rather than built) diff --git a/desktop/xss-lock/slack-desc b/desktop/xss-lock/slack-desc new file mode 100644 index 0000000000..2ce419405c --- /dev/null +++ b/desktop/xss-lock/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +xss-lock: xss-lock (using external locker as X screensaver) +xss-lock: +xss-lock: xss-lock hooks up a favorite screen locker to the MIT screen saver +xss-lock: extension for X and to the login manager. +xss-lock: +xss-lock: Although xss-lock conflicts with no Slackware packages, native DE +xss-lock: screensavers may cause runtime interference. +xss-lock: +xss-lock: Author: Raymond Wagenmaker +xss-lock: +xss-lock: https://github.com/xdbob/xss-lock diff --git a/desktop/xss-lock/xss-lock.1 b/desktop/xss-lock/xss-lock.1 new file mode 100644 index 0000000000..6004824c48 --- /dev/null +++ b/desktop/xss-lock/xss-lock.1 @@ -0,0 +1,200 @@ +.\" Man page generated from reStructuredText. +. +.TH "XSS-LOCK" 1 "November 2013" "" "" +.SH NAME +xss-lock \- use external locker as X screen saver +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\n[an-margin] +level \\n[rst2man-indent-level] +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] +- +\\n[rst2man-indent0] +\\n[rst2man-indent1] +\\n[rst2man-indent2] +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\n[an-margin] +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] +.nr rst2man-indent-level -1 +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u +.. +.SH SYNOPSIS +.nf +xss\-lock [\-n \fInotify_cmd\fP] [\-\-ignore\-sleep] [\-l] [\-v|\-q] [\-\-] \fIlocker\fP [\fIarg\fP] ... +xss\-lock \-\-help|\-\-version +.fi +.sp +.SH DESCRIPTION +.sp +\fBxss\-lock\fP hooks up your favorite locker to the MIT screen saver extension +for X and also to systemd\(aqs login manager. The locker is executed in response +to events from these two sources: +.INDENT 0.0 +.IP \(bu 2 +X signals when screen saver activation is forced or after a period of user +inactivity (as set with \fBxset s TIMEOUT\fP). In the latter case, the notifier +command, if specified, is executed first. +.IP \(bu 2 +The login manager can also request that the session be locked; as a result of +\fBloginctl lock\-sessions\fP, for example. Additionally, \fBxss\-lock\fP uses the +inhibition logic to lock the screen before the system goes to sleep. +.UNINDENT +.sp +\fBxss\-lock\fP waits for the locker to exit \-\- or kills it when screen saver +deactivation or session unlocking is forced \-\- so the command should not fork. +.sp +Also, \fBxss\-lock\fP manages the idle hint on the login session. The idle state +of the session is directly linked to user activity as reported by X (except +when the notifier runs before locking the screen). When all sessions are idle, +the login manager can take action (such as suspending the system) after a +preconfigured delay. +.SH OPTIONS +.INDENT 0.0 +.TP +.BI \-n \ cmd\fR,\fB \ \-\-notifier\fB= cmd +Run \fIcmd\fP when the screen saver activates because of user +inactivity. Shell\-style quoting is supported. The notifier is +killed when X signals user activity or when the locker is +started. The locker is started after the first screen saver +cycle, as set with \fBxset s TIMEOUT CYCLE\fP\&. +.sp +This can be used to run a countdown or (on laptops) dim the +screen before locking. For an example, see the script +\fI/usr/share/doc/xss\-lock/dim\-screen.sh\fP\&. +.TP +.B \-l\fP,\fB \-\-tranfer\-sleep\-lock +Allow the locker process to inherit the file descriptor that +represents the delay lock obtained from the login manager. The +corresponding index will be made available in the environment +variable \fB$XSS_SLEEP_LOCK_FD\fP; this will only be set if the +reason for locking is that the system is preparing to go to +sleep. The locker should close this file descriptor to indicate +it is ready. +.sp +Example scripts that wrap existing lockers are available as +\fI/usr/share/doc/xss\-lock/transfer\-sleep\-lock\-*.sh\fP\&. +.TP +.B \-\-ignore\-sleep +Do not lock on suspend/hibernate. +.TP +.B \-q\fP,\fB \-\-quiet +Output only fatal errors. +.TP +.B \-v\fP,\fB \-\-verbose +Output more messages. +.TP +.B \-h\fP,\fB \-\-help +Print help message and exit. +.TP +.B \-\-version +Print version number and exit. +.UNINDENT +.SH SIGNALS +.INDENT 0.0 +.TP +.B SIGHUP +Upon receiving this signal, \fBxss\-lock\fP resets the screen saver, but only +if the screen is not currently locked (unlike \fBxset s reset\fP). +.sp +This can be used in MPlayer\(aqs configuration as a workaround for MPlayer\(aqs +failure to restart the screen saver timer when playback is paused: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +heartbeat\-cmd="killall \-HUP xss\-lock" +stop\-xscreensaver=false +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +This is ineffective with mplayer2 (and mpv), because its heart +keeps beating while playback is paused. +.UNINDENT +.UNINDENT +.TP +.B SIGINT/SIGTERM +Upon receiving this signal, \fBxss\-lock\fP exits after killing any running +notifier or locker. +.UNINDENT +.SH NOTES +.INDENT 0.0 +.IP \(bu 2 +Some applications rely on the \fBxdg\-screensaver\fP script from xdg\-utils, +which uses \fBxset s off\fP and \fBxset s default\fP to suspend and resume the +screen saver, respectively. The latter resets the timeout and cycle to the +server defaults (\fBxset s on\fP uses a hardcoded default instead), so this +only works if you are happy with (or can control) the server settings. +.sp +To fix the resume action in this script (or a copy in \fI~/bin\fP preceding the +original in \fB$PATH\fP), either replace \fBon\fP by your preferred timeout and +cycle, or avoid hardcoded time values by patching the script to run a suspend +loop as it does for other screen savers, using +\fI/usr/share/doc/xss\-lock/xdg\-screensaver.patch\fP\&. +.UNINDENT +.SH EXAMPLES +.INDENT 0.0 +.IP \(bu 2 +Run \fBxlock\fP after ten minutes of inactivity: +.INDENT 2.0 +.INDENT 3.5 +.sp +.nf +.ft C +xset 600 +xss\-lock xlock +resetsaver +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Without \fB+resetsaver\fP, \fBxlock\fP forces a screen saver reset during +startup, thereby telling \fBxss\-lock\fP to immediately kill \fBxlock\fP again. +.IP \(bu 2 +Dim the screen after three minutes of inactivity, lock the screen two minutes +later using \fBi3lock\fP: +.INDENT 2.0 +.INDENT 3.5 +.sp +.nf +.ft C +xset 180 120 +xss\-lock \-n dim\-screen.sh \-\- i3lock \-n +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 2.0 +.INDENT 3.5 +A script is provided to use \fBi3lock\fP\(aqs forking mode with the +\fB\-\-tranfer\-sleep\-lock\fP option (see above). +.UNINDENT +.UNINDENT +.UNINDENT +.SH SEE ALSO +.sp +\fBxset\fP(1), +\fBsystemd\-logind.service\fP(8) +.SH AUTHOR +Raymond Wagenmaker +.\" Generated by docutils manpage writer. +. diff --git a/desktop/xss-lock/xss-lock.SlackBuild b/desktop/xss-lock/xss-lock.SlackBuild new file mode 100644 index 0000000000..ef05210aff --- /dev/null +++ b/desktop/xss-lock/xss-lock.SlackBuild @@ -0,0 +1,104 @@ +#!/bin/sh + +# Slackware build script for xss-lock + +# Copyright 2021 K. Eugene Carlson Tsukuba, Japan +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=xss-lock +VERSION=${VERSION:-0.3.0} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +# LIBDIRSUFFIX flag not available +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" +else + SLKCFLAGS="-O2" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_STRIP=/usr/bin/strip \ + -DCMAKE_BUILD_TYPE=Release .. + make + make install/strip DESTDIR=$PKG +cd .. + +# man page will be copied over if docutils is not available. +if [ -d $PKG/usr/share/man ]; then + mv $PKG/usr/share/man $PKG/usr + find $PKG/usr/man -type f -exec gzip -9 {} \; + for i in $( find $PKG/usr/man -type l ) ; do + ln -s $( readlink $i ).gz $i.gz + rm $i + done +else + mkdir -p $PKG/usr/man/man1 + gzip -9 -c $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz +fi + +# Moving and renaming the documentation directory +mkdir -p $PKG/usr/doc +mv $PKG/usr/share/doc/$PRGNAM $PKG/usr/doc/$PRGNAM-$VERSION +rm -r $PKG/usr/share/doc +cp -a $CWD/README LICENSE $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/desktop/xss-lock/xss-lock.info b/desktop/xss-lock/xss-lock.info new file mode 100644 index 0000000000..168d7dfaff --- /dev/null +++ b/desktop/xss-lock/xss-lock.info @@ -0,0 +1,10 @@ +PRGNAM="xss-lock" +VERSION="0.3.0" +HOMEPAGE="https://github.com/xdbob/xss-lock" +DOWNLOAD="https://github.com/xdbob/xss-lock/archive/v0.3.0/xss-lock-0.3.0.tar.gz" +MD5SUM="ebfa58416117a272c2e534036a0deeb4" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="K. Eugene Carlson" +EMAIL="kvngncrlsn@gmail.com" -- cgit v1.2.3-65-gdbad