mirror of https://github.com/9wm/xss.git
A few README modifications
This commit is contained in:
parent
94d22e5d8a
commit
61cf40a421
28
README
28
README
|
@ -1,13 +1,16 @@
|
||||||
== xss ==
|
== 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.
|
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
|
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
|
Examples
|
||||||
--------
|
--------
|
||||||
|
@ -17,18 +20,13 @@ Tell the X server to launch the screen saver after 90 seconds idle:
|
||||||
xset s 90
|
xset s 90
|
||||||
|
|
||||||
|
|
||||||
Run like xautolock:
|
Run like `xautolock`:
|
||||||
|
|
||||||
xss xlock -mode qix &
|
xss xlock -mode qix &
|
||||||
|
|
||||||
|
|
||||||
Run like xscreensaver (no locking):
|
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:
|
||||||
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:
|
|
||||||
|
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
|
@ -43,9 +41,11 @@ History
|
||||||
-------
|
-------
|
||||||
|
|
||||||
AIX apparently had something also called `xss` which did almost exactly
|
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
|
I lifted some code from `beforelight` from the X11 distribution, and
|
||||||
from `slock` from [suckless.org](http://suckless.org/). Both have a
|
from `slock` from [suckless.org](http://suckless.org/). Both have a
|
||||||
|
|
2
obj.h
2
obj.h
|
@ -10,6 +10,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
/** Exception-type things. Don't nest them.
|
/** Exception-type things. Don't nest them.
|
||||||
*
|
*
|
||||||
|
@ -19,6 +20,7 @@
|
||||||
static char *exception;
|
static char *exception;
|
||||||
#define try for (exception = "Failure"; exception; exception = NULL)
|
#define try for (exception = "Failure"; exception; exception = NULL)
|
||||||
#define fail break
|
#define fail break
|
||||||
|
#define pfail {exception = strerror(errno); break;}
|
||||||
#define succeed continue
|
#define succeed continue
|
||||||
#define raise(x) {exception = x; break;}
|
#define raise(x) {exception = x; break;}
|
||||||
#define except if (exception)
|
#define except if (exception)
|
||||||
|
|
2
xsswin.c
2
xsswin.c
|
@ -27,7 +27,6 @@ int
|
||||||
main(int argc, char * const argv[])
|
main(int argc, char * const argv[])
|
||||||
{
|
{
|
||||||
Display *display;
|
Display *display;
|
||||||
Cursor invisible;
|
|
||||||
Pixmap pmap;
|
Pixmap pmap;
|
||||||
Window w;
|
Window w;
|
||||||
|
|
||||||
|
@ -38,6 +37,7 @@ main(int argc, char * const argv[])
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int screen;
|
int screen;
|
||||||
|
Cursor invisible;
|
||||||
XSetWindowAttributes wa;
|
XSetWindowAttributes wa;
|
||||||
Window root;
|
Window root;
|
||||||
XColor black;
|
XColor black;
|
||||||
|
|
Loading…
Reference in New Issue