[dwm] xicon - dzen-like tool for icons

From: pancake <pancake_AT_youterm.com>
Date: Sun, 1 Jul 2007 06:29:18 +0200

I have been taking some parts of dzen to write a first mockup of the
'xicon' tool. It aims to draw icons on the Xwindows on a borderless
windows like dzen2 does.

This is just a one-night-hack (R), code is ugly and there'r some
minor bugs and missfeatures but it's enought stable and functional
to release a 0.1 :)



  Obligatory screenshot:


Images are composed by '.' and 'X' or '0' and '1' in ascii one row per line file:

$ cat x
.... .... .... ....
.... .... .... ....
..XX .... .... XX..
...X X... ...X X...
.... XX.. ..XX ....
.... .XX. .XX. ....
.... ..XX XX.. ....
.... ..XX XX.. ....
.... .XX. .XX. ....
.... XX.. ..XX ....
...X X... ...X X...
..XX .... .... XX..
.... .... .... ....

This image should be converted into a oneline format. This is one bit per pixel
in hexadecimal. So 8 bytes per line:

$ ./icon < x
0000 0000 300c 1818 0c30 0660 03c0 03c0 0660 0c30 1818 300c 0000

We can view this icon using xicon:

$ cat x | ./icon | ./xicon -z 8 -b black -f red

Help message says:

$ ./xicon -h
Usage: xicon [-x pos] [-y pos] [-z zoom] [-s seconds]
          [-b bgcolor] [-f fgcolor] [position] < data

- Colors can be 'blue' 'red' or '#334499' , ...
- Seconds is the time to sleep between read each new line from stdin
- Zoom is the multiplier for pixel size
- X and Y are absolute positions on the screen to put the window

Actually it doesn't handles multiple mouse buttons.

In pb/ directory there's a little aniimation demo of a progressbar.
Will be very easy to implement a shellscript to handle the mouse
wheel and increment or decrement the progressbar and use it to change
the master audio volume (for example) when clicking.

You can use fifos like to allow 'rpc' between programs, and change the
icon from another program echoing to the fifo file. This way it can be
easy to implement a progressbar to show the battery level or the network

In a future I would like to define color paletes and better mouse support.

Feel free to test and comment me your ideas!

Have fun!

Received on Sun Jul 01 2007 - 06:29:23 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:45:34 UTC