Re: [dwm] faster focus to client

2008-04-21 Thread yy
I have found an useful tip related to this idea, if you are using the
patch I submitted yesterday (or any of the previous versions) to see
the previous tags when you try to see the currently selected tags.
I'll explain it with an example: you have clients with tags 1, 2 and
3, and you are viewing these three tags. Now, if you press Mod1+1
twice you will be focusing the first client with tag 1, if you press
Mod2+2 twice you will be focusing the first client with tag 2, etc.
This way, if you define enough tags in your config.h for the clients
that you want to access quickly, you can focus them with just two key
strokes. You can do it now with Mod1+Tab, but it is a bit less
comfortable.
As a side note, I have always wanted to give it a try to dynamic tags
in dwm, and I will probably write a patch once 5.0 is released, just
to see how it feels. OTOH, I think the needed complexity won't be well
worth, but let's see...

hth,

-- 


- yiyus || JGL .



[dwm] I wrote a screen saver/locker and auto-launcher

2008-04-21 Thread Neale Pickett
I was inspired by dwm to write a screen saver / locker, and an
auto-launcher (like xautolock, but mine blocks).  I split it up into
several little programs that each do one thing.  You can use the
programs to build a lot of different kinds of screen savers.

http://woozle.org/~neale/src/xss

I wrote it to run slock after a timeout, using the MIT-SCREEN-SAVER
extension, because xautolock runs a little loop polling timestamps on
the keyboard and mouse files and that bothers me.  Replace xautolock
like so:

$ xss slock 

Here's a shell script that does something similar to slock.  You could
modify it to use md5sum or some other verify I typed in my password
program:

#! /bin/sh
xsswin xkeygrab | (while read l; do 
  [ $l = secret ]  break
  xbell
   done)

I provide a magic screensaver hack that you can use to draw pretty
pictures without sucking CPU cycles.  Or you can use any xscreensaver
hack.  You could also use magic with xscreensaver if you're happy with
xscreensaver but unhappy with qix.

I hope someone else thinks this is useful.

Neale



Re: [dwm] I wrote a screen saver/locker and auto-launcher

2008-04-21 Thread Enno Gottox Boland
I prefer sinac. It's simpler and it leaves every unneeded feature out.
It was posted on dwm mailinglist a few month ago.

using it is very straight forward: sinac -w 10  slock

/*
 *
 * sinac
 *
 * derived from xautolock supplied by
 * Authors: Michel Eyckmans (MCE)  Stefan De Troch (SDT)
 *
 * --
 *
 * Copyright 1990,1992-1999,2001-2002 by Stefan De Troch and Michel Eyckmans.
 * Copyright 2005 by Stefan Siegl [EMAIL PROTECTED]
 * Copyright 2007 by Christian Dietrich [EMAIL PROTECTED]
 *
 * Versions 2.0 and above of xautolock are available under version 2 of the
 * GNU GPL.
 *
 * sinac.c -L/usr/X11R6/lib -lX11 -lXss -lXext -o sinac
 *
 */

#include X11/Xos.h
#include X11/Xlib.h
#include X11/Xutil.h
#include X11/Xatom.h
#include X11/Xresource.h

#include X11/extensions/scrnsaver.h

#include stdio.h

#define VERSION 0.1.2

static XScreenSaverInfo* xss_info = 0;

int
seconds_idle(Display *d)
{
  if (! xss_info )
xss_info = XScreenSaverAllocInfo();
  XScreenSaverQueryInfo(d, DefaultRootWindow(d), xss_info);
  return xss_info-idle / 1000;

}

int
main (int argc, char* argv[])
{
  Display* d;
  Time idleTime;
  int wait = 0, i, idle;

  for (i = 1; i  argc; i++) {
if ((strcmp(argv[i], -w) == 0)  (i+1  argc))
  wait = atoi(argv[++i]), idle;
else if (strcmp(argv[i], -p) == 0)
  wait = 0;
else {
  fprintf(stderr, sinac -  VERSION : %s [-w seconds] [-p]\n,
  argv[0]);
  return 1;
}
  }

  if (!(d = XOpenDisplay (0))) {
fprintf (stderr, Couldn't connect to %s\n, XDisplayName (0));
return 1;
  }
  (void) XSync (d, 0);

  if (wait)
while ((idle = seconds_idle(d))  wait)
  usleep(wait - idle);
  else
fprintf(stdout, %ld\n, seconds_idle(d));

  return 0;
}


2008/4/21, Neale Pickett [EMAIL PROTECTED]:
 I was inspired by dwm to write a screen saver / locker, and an
  auto-launcher (like xautolock, but mine blocks).  I split it up into
  several little programs that each do one thing.  You can use the
  programs to build a lot of different kinds of screen savers.

 http://woozle.org/~neale/src/xss

  I wrote it to run slock after a timeout, using the MIT-SCREEN-SAVER
  extension, because xautolock runs a little loop polling timestamps on
  the keyboard and mouse files and that bothers me.  Replace xautolock
  like so:

 $ xss slock 

  Here's a shell script that does something similar to slock.  You could
  modify it to use md5sum or some other verify I typed in my password
  program:

 #! /bin/sh
 xsswin xkeygrab | (while read l; do
   [ $l = secret ]  break
   xbell
done)

  I provide a magic screensaver hack that you can use to draw pretty
  pictures without sucking CPU cycles.  Or you can use any xscreensaver
  hack.  You could also use magic with xscreensaver if you're happy with
  xscreensaver but unhappy with qix.

  I hope someone else thinks this is useful.


  Neale




-- 
http://www.gnuffy.org - Real Community Distro
http://www.gnuffy.org/index.php/GnuEm - Gnuffy on Ipaq (Codename Peggy)