Browse Source
system/xssstate: Added (X screensaver state retriever).
system/xssstate: Added (X screensaver state retriever).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>pull/303/head
committed by
Willy Sudiarto Raharjo
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
4 changed files with 231 additions and 0 deletions
-
89system/xssstate/README
-
19system/xssstate/slack-desc
-
113system/xssstate/xssstate.SlackBuild
-
10system/xssstate/xssstate.info
@ -0,0 +1,89 @@ |
|||||
|
xssstate (utility from suckless.org) |
||||
|
------------------------------------ |
||||
|
|
||||
|
This is the xssstate utility from suckless.org. |
||||
|
|
||||
|
This tool is a simple tool that retrieves the X screensaver state. |
||||
|
This can be used in scripts that can start screen lockers, or |
||||
|
other utilities. |
||||
|
|
||||
|
The screensaver states include the idle time, the screensaver state, |
||||
|
and the time how long to wait until the screensaver should be active. |
||||
|
|
||||
|
The values for the screensaver states in X can be changed using |
||||
|
xset(1). |
||||
|
|
||||
|
Turn off the screensaver: |
||||
|
|
||||
|
% xset s 0 |
||||
|
% xset s 0ff |
||||
|
|
||||
|
Turn on the screensaver after 60 seconds inactivity: |
||||
|
|
||||
|
% xset s 60 |
||||
|
|
||||
|
Force the screensaver to be active: |
||||
|
|
||||
|
% xset s blank |
||||
|
|
||||
|
For more options, see xset(1). |
||||
|
|
||||
|
Why |
||||
|
--- |
||||
|
|
||||
|
I created this package, because I needed this one utility to control |
||||
|
my screensaver and lock my screen with a simple tool. |
||||
|
|
||||
|
The same utility is bundled in the suckless-tools package on |
||||
|
slackbuilds.org. If you need the other utilities in that package, |
||||
|
you can use that. B. Watson did a nice job including these |
||||
|
into one package. |
||||
|
|
||||
|
I did not have use for the other utilities in that package, and |
||||
|
have created this package. |
||||
|
|
||||
|
Example usage |
||||
|
------------- |
||||
|
|
||||
|
In the section below, an xss_idle.sh script is given. This script |
||||
|
is an example on how to use this for a background service that |
||||
|
will control your screensaver. This can be used to invoke xlock(1) |
||||
|
using the following command. |
||||
|
|
||||
|
% xss_idle.sh xlock & |
||||
|
|
||||
|
This can be usefull in your $HOME/.xinitrc file. |
||||
|
|
||||
|
You can also use slock, or any other utility that can lock the |
||||
|
screen. |
||||
|
|
||||
|
Example script: xss_idle.sh |
||||
|
--------------------------- |
||||
|
|
||||
|
#!/bin/sh |
||||
|
# |
||||
|
# Use xset s $time to control the timeout when this will run. |
||||
|
# |
||||
|
|
||||
|
if [ $# -lt 1 ]; |
||||
|
then |
||||
|
printf "usage: %s cmd\n" "$(basename $0)" 2>&1 |
||||
|
exit 1 |
||||
|
fi |
||||
|
cmd="$@" |
||||
|
|
||||
|
while true |
||||
|
do |
||||
|
if [ $(xssstate -s) != "disabled" ]; |
||||
|
then |
||||
|
tosleep=$(($(xssstate -t) / 1000)) |
||||
|
if [ $tosleep -le 0 ]; |
||||
|
then |
||||
|
$cmd |
||||
|
else |
||||
|
sleep $tosleep |
||||
|
fi |
||||
|
else |
||||
|
sleep 10 |
||||
|
fi |
||||
|
done |
@ -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------------------------------------------------------| |
||||
|
xssstate: xssstate (utility from suckless.org) |
||||
|
xssstate: |
||||
|
xssstate: This is the tool to retrieve the X screensaver state. |
||||
|
xssstate: This tool is from suckless.org. |
||||
|
xssstate: |
||||
|
xssstate: |
||||
|
xssstate: |
||||
|
xssstate: |
||||
|
xssstate: |
||||
|
xssstate: |
||||
|
xssstate: |
@ -0,0 +1,113 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
# This script has been modified to only include the xssstate tool |
||||
|
# from the suckless site. |
||||
|
# |
||||
|
# The original source belongs to B. Watson. I have made changes to |
||||
|
# build only the xssstate utility. |
||||
|
# |
||||
|
# 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. |
||||
|
|
||||
|
cd $(dirname $0) ; CWD=$(pwd) |
||||
|
|
||||
|
PRGNAM=xssstate |
||||
|
VERSION=${VERSION:-1.1} |
||||
|
BUILD=${BUILD:-1} |
||||
|
TAG=${TAG:-_SBo} |
||||
|
PKGTYPE=${PKGTYPE:-tgz} |
||||
|
|
||||
|
if [ -z "$ARCH" ]; then |
||||
|
case "$( uname -m )" in |
||||
|
i?86) ARCH=i586 ;; |
||||
|
arm*) ARCH=arm ;; |
||||
|
*) ARCH=$( uname -m ) ;; |
||||
|
esac |
||||
|
fi |
||||
|
|
||||
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then |
||||
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" |
||||
|
exit 0 |
||||
|
fi |
||||
|
|
||||
|
TMP=${TMP:-/tmp/SBo} |
||||
|
PKG=$TMP/package-$PRGNAM |
||||
|
OUTPUT=${OUTPUT:-/tmp} |
||||
|
|
||||
|
if [ "$ARCH" = "i586" ]; then |
||||
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686" |
||||
|
LIBDIRSUFFIX="" |
||||
|
elif [ "$ARCH" = "i686" ]; then |
||||
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686" |
||||
|
LIBDIRSUFFIX="" |
||||
|
elif [ "$ARCH" = "x86_64" ]; then |
||||
|
SLKCFLAGS="-O2 -fPIC" |
||||
|
LIBDIRSUFFIX="64" |
||||
|
else |
||||
|
SLKCFLAGS="-O2" |
||||
|
LIBDIRSUFFIX="" |
||||
|
fi |
||||
|
|
||||
|
set -e |
||||
|
|
||||
|
DOCDIR=$PKG/usr/doc/$PRGNAM-$VERSION |
||||
|
|
||||
|
rm -rf $PKG |
||||
|
mkdir -p $TMP $PKG $OUTPUT $DOCDIR |
||||
|
cd $TMP |
||||
|
rm -rf $PRGNAM-$VERSION |
||||
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz |
||||
|
cd $PRGNAM-$VERSION |
||||
|
|
||||
|
# some of the Makefiles expect these to already exist: |
||||
|
mkdir -p $PKG/usr/bin $PKG/usr/man/man1 |
||||
|
|
||||
|
chown -R root:root . |
||||
|
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ |
||||
|
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ |
||||
|
|
||||
|
sed -i -e "s,-O.\>,$SLKCFLAGS," -e "s,\<lib\>,lib$LIBDIRSUFFIX," config.mk |
||||
|
|
||||
|
make PREFIX=/usr MANPREFIX=/usr/man DESTDIR=$PKG install |
||||
|
cp -a README LICENSE $DOCDIR |
||||
|
cd - |
||||
|
|
||||
|
strip $PKG/usr/bin/* |
||||
|
gzip -9 $PKG/usr/man/man?/*.? |
||||
|
|
||||
|
cat $CWD/$PRGNAM.SlackBuild > $DOCDIR/$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 |
||||
|
|
||||
|
# Inform user that there is a xssstate already on the system and that this has |
||||
|
# to be removed before installing this package |
||||
|
#which xssstate > /dev/null 2>&1 |
||||
|
#path_to_utility=$(which xssstate) |
||||
|
path_to_utility="/usr/bin/xssstate" |
||||
|
if [ -f ${path_to_utility} ] |
||||
|
then |
||||
|
echo "******* IMPORTANT *******" |
||||
|
echo "There is already a utility with the name in ${path_to_utility}" |
||||
|
echo "Be sure to remove that utility by uninstalling its package." |
||||
|
echo "*************************" |
||||
|
fi |
@ -0,0 +1,10 @@ |
|||||
|
PRGNAM="xssstate" |
||||
|
VERSION="1.1" |
||||
|
HOMEPAGE="https://tools.suckless.org/x/xssstate/" |
||||
|
DOWNLOAD="https://dl.suckless.org/tools/xssstate-1.1.tar.gz" |
||||
|
MD5SUM="7d4935bc17b6f01afa12e420331fa688" |
||||
|
DOWNLOAD_x86_64="" |
||||
|
MD5SUM_x86_64="" |
||||
|
REQUIRES="" |
||||
|
MAINTAINER="R. Dindir" |
||||
|
EMAIL="rdindir@yahoo.com" |
Write
Preview
Loading…
Cancel
Save
Reference in new issue