A few README modifications

This commit is contained in:
Neale Pickett 2008-04-14 16:15:03 -06:00
parent 94d22e5d8a
commit 61cf40a421
3 changed files with 17 additions and 15 deletions

28
README
View File

@ -1,13 +1,16 @@
== xss ==
xss uses the nearly 20-year-old MIT-SCREEN-SAVER extension to launch a
`xss` uses the nearly 20-year-old MIT-SCREEN-SAVER extension to launch a
program when the X server turns on the built-in screen saver.
xsswin makes a full-screen black window and runs some other program,
`xsswin` makes a full-screen black window and runs some other program,
passing along the window ID in the environment ($XSS_WINDOW) and
possibly as an argument (XSS_WINDOW gets replaced with the id).
possibly as an argument (XSS_WINDOW gets replaced with the id). It does
not grab keyboard or mouse focus: you'll have to run something else
(like `xtrlock`) to do this or other windows will continue to get
keyboard and mouse events.
xcursorpos prints out the x and y coordinates of the cursor.
`xcursorpos` prints out the x and y coordinates of the cursor.
Examples
--------
@ -17,18 +20,13 @@ Tell the X server to launch the screen saver after 90 seconds idle:
xset s 90
Run like xautolock:
Run like `xautolock`:
xss xlock -mode qix &
Run like xscreensaver (no locking):
xss xsswin /usr/lib/xscreensaver/flurry -window-id XSS_WINDOW
Shell script to run an xscreensaver hack and xtrlock at the same time,
but prevent locking if the cursor is in the upper-left corner:
Shell script to run an `xscreensaver` hack and `xtrlock` at the same
time, but prevent locking if the cursor is in the upper-left corner:
#! /bin/sh
@ -43,9 +41,11 @@ History
-------
AIX apparently had something also called `xss` which did almost exactly
what my xss does, but had some command-line options.
what mine does, but with command-line options.
I'm not aware of anything else like `xsswin`.
I'm not aware of anything else like `xsswin` or `xcursorpos`. If there
is already something out there to do these jobs please let me know so I
can quit using my versions.
I lifted some code from `beforelight` from the X11 distribution, and
from `slock` from [suckless.org](http://suckless.org/). Both have a

2
obj.h
View File

@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
/** Exception-type things. Don't nest them.
*
@ -19,6 +20,7 @@
static char *exception;
#define try for (exception = "Failure"; exception; exception = NULL)
#define fail break
#define pfail {exception = strerror(errno); break;}
#define succeed continue
#define raise(x) {exception = x; break;}
#define except if (exception)

View File

@ -27,7 +27,6 @@ int
main(int argc, char * const argv[])
{
Display *display;
Cursor invisible;
Pixmap pmap;
Window w;
@ -38,6 +37,7 @@ main(int argc, char * const argv[])
try {
int screen;
Cursor invisible;
XSetWindowAttributes wa;
Window root;
XColor black;