sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit b83c4ce1e2784e25a1f6f4f2bce5a0c2c7e52754
parent f15a0902243f6906a5cb2788c87bace052715eb0
Author: Christoph Lohmann <20h@r-36.net>
Date:   Sat,  8 Dec 2012 22:44:52 +0100

Merge branch 'master' of git://git.suckless.org/sites

Diffstat:
Mdwm.suckless.org/patches/ansistatuscolors.png | 0
Mdwm.suckless.org/screenshots/dwm-20120806.png | 0
Mdwm.suckless.org/screenshots/dwm-20120806s.png | 0
Dman.suckless.org/_werc/config | 2--
Dmatemobile.com/_werc/config | 2--
Dmatemobile.com/_werc/tpl/master.tpl | 47-----------------------------------------------
Dmatemobile.com/index.md | 4----
Mst.suckless.org/screenshots/20h-2012.png | 0
Mst.suckless.org/screenshots/hendry.png | 0
Msta.li/index.md | 1+
Msta.li/stali.png | 0
Msuckless.org/donations.md | 1+
Msuckless.org/index.md | 9---------
Msuckless.org/uriel.png | 0
Dtools.suckless.org/tabbed/patches/autohide.diff | 13-------------
Atools.suckless.org/tabbed/patches/autohide.md | 13+++++++++++++
Mtools.suckless.org/tabbed/tabbed.png | 0
Dwmi.suckless.org/_werc/config | 3---
Dwmi.suckless.org/index.md | 25-------------------------
Dwmi.suckless.org/screenshots/wmi-20080718.png | 0
Dwmi.suckless.org/screenshots/wmi-20080718s.png | 0
Dwmi.suckless.org/wmi-10_compile_fixes.diff | 107-------------------------------------------------------------------------------
Dwmii.suckless.org/_werc/config | 3---
Dwmii.suckless.org/code_snippets/plan_9_port/index.md | 170-------------------------------------------------------------------------------
Dwmii.suckless.org/code_snippets/plan_9_port/irssi_notifier.md | 104-------------------------------------------------------------------------------
Dwmii.suckless.org/code_snippets/plan_9_port/mail_notifier.md | 44--------------------------------------------
Dwmii.suckless.org/code_snippets/python/battery_indicator.md | 77-----------------------------------------------------------------------------
Dwmii.suckless.org/code_snippets/python/freebsd_battery_indicator.md | 21---------------------
Dwmii.suckless.org/code_snippets/python/index.md | 24------------------------
Dwmii.suckless.org/code_snippets/python/irssi_notifier.md | 99-------------------------------------------------------------------------------
Dwmii.suckless.org/code_snippets/python/memory_usage_indicator.md | 26--------------------------
Dwmii.suckless.org/code_snippets/sh/index.md | 89-------------------------------------------------------------------------------
Dwmii.suckless.org/index.md | 8--------
Dwmii.suckless.org/screenshots/wmii-20080117-thumb.png | 0
Dwmii.suckless.org/screenshots/wmii-20080117.png | 0
Dwmii.suckless.org/wmii.png | 0
36 files changed, 15 insertions(+), 877 deletions(-)

diff --git a/dwm.suckless.org/patches/ansistatuscolors.png b/dwm.suckless.org/patches/ansistatuscolors.png Binary files differ. diff --git a/dwm.suckless.org/screenshots/dwm-20120806.png b/dwm.suckless.org/screenshots/dwm-20120806.png Binary files differ. diff --git a/dwm.suckless.org/screenshots/dwm-20120806s.png b/dwm.suckless.org/screenshots/dwm-20120806s.png Binary files differ. diff --git a/man.suckless.org/_werc/config b/man.suckless.org/_werc/config @@ -1,2 +0,0 @@ -siteTitle='suckless.org' -siteSubtitle='man pages' diff --git a/matemobile.com/_werc/config b/matemobile.com/_werc/config @@ -1,2 +0,0 @@ -siteTitle='matemobile' -menuTitle='about' diff --git a/matemobile.com/_werc/tpl/master.tpl b/matemobile.com/_werc/tpl/master.tpl @@ -1,47 +0,0 @@ -<!doctype html> -<html> -<head> - <title>%($pageTitle%)</title> - <link rel="stylesheet" type="text/css" href="/pub/style.css"> - <meta charset="utf-8"> -</head> -<body> - <div id="header"> - <a href="/">%($"siteTitle%)</a> <span id="headerSubtitle">%($"siteSubtitle%)</span> - </div> - - <div id="menu"> - <span class="right"> - <a href="http://suckless.org">suckless.org</a> - <a href="http://eyjafjallajoekull.com">art</a> - </span> - </div> - - <div id="content"> -% if(! ~ $#handlers_bar_left 0) { - <div id="nav"> -% for(h in $handlers_bar_left) { -% run_handler $$h -% } - </div> -% } - - <div id="main"> - -% run_handlers $handlers_body_head - -% run_handler $handler_body_main - -% run_handlers $handlers_body_foot - - </div> - - </div> - - <div id="footer"> - <span class="right"> - &copy; 2012 matemobile | <a href="http://garbe.us/Contact">Impressum</a> - </span> - </div> -</body> -</html> diff --git a/matemobile.com/index.md b/matemobile.com/index.md @@ -1,4 +0,0 @@ -matemobile -========== - -Coming soon... diff --git a/st.suckless.org/screenshots/20h-2012.png b/st.suckless.org/screenshots/20h-2012.png Binary files differ. diff --git a/st.suckless.org/screenshots/hendry.png b/st.suckless.org/screenshots/hendry.png Binary files differ. diff --git a/sta.li/index.md b/sta.li/index.md @@ -25,6 +25,7 @@ discuss further development of sta.li. Some related links ------------------ +* [starch linux](http://starchlinux.org/) - a statically linked archlinux variant * [Bifrost/Linux](http://bifrost.slu.se/) - a minimalist Linux distro for USB media * [$6M libc](http://codingrelic.geekhold.com/2008/11/six-million-dollar-libc.html) - Bionic is a nice library, though only usable for sane stuff * [ldd arbitrary code execution](http://www.catonmat.net/blog/ldd-arbitrary-code-execution/) - Nice exploit diff --git a/sta.li/stali.png b/sta.li/stali.png Binary files differ. diff --git a/suckless.org/donations.md b/suckless.org/donations.md @@ -24,6 +24,7 @@ Following people have donated to the suckless.org project certain amounts of money, which have been used for the dedicated server rent in the past: +* Gordon Celesta donated <b>25 CAD</b> * Thomas Hilber donated <b>50 EUR</b> * Kirill Sapelkin donated <b>10 US</b> * Xavier Alvelo donated <b>20 USD</b> diff --git a/suckless.org/index.md b/suckless.org/index.md @@ -32,11 +32,6 @@ We will miss him a lot. RIP -2012-07-30 ----------- -[https://github.com/suckless](https://github.com/suckless) is a github mirror -of [http://git.suckless.org/](http://git.suckless.org/) updated with a daily cronjob. Please contribute by posting patches to the [mailing list](http://suckless.org/community). - 2012-07-14 ---------- [surf 0.5](http://surf.suckless.org) released: [download](http://dl.suckless.org/surf/surf-0.5.tar.gz) @@ -93,10 +88,6 @@ Some of us will visit [CLT2010](http://chemnitzer.linux-tage.de/2010/). Anselm w ---------- There was a small community meeting in Berlin! Thanks to all attenders. -2009-11-27 ----------- -[wmi-11](http://wmi.suckless.org/) released: [download](http://dl.suckless.org/wmi/wmi-11.tar.gz) - 2008-08-02 ---------- [wmname 0.1](http://tools.suckless.org/wmname) released: [download](http://dl.suckless.org/tools/wmname-0.1.tar.gz) diff --git a/suckless.org/uriel.png b/suckless.org/uriel.png Binary files differ. diff --git a/tools.suckless.org/tabbed/patches/autohide.diff b/tools.suckless.org/tabbed/patches/autohide.diff @@ -1,13 +0,0 @@ -Autohide -======== - -This patch hides the tab bar if only one tab is open. - -Download --------- -* [tabbed-0.4.1-autohide.diff](tabbed-0.4.1-autohide.diff) - -Author ------- -* original author unknown -* 0.4.1 doom - <dm@archlinux.info> diff --git a/tools.suckless.org/tabbed/patches/autohide.md b/tools.suckless.org/tabbed/patches/autohide.md @@ -0,0 +1,13 @@ +Autohide +======== + +This patch hides the tab bar if only one tab is open. + +Download +-------- +* [tabbed-0.4.1-autohide.diff](tabbed-0.4.1-autohide.diff) + +Author +------ +* original author Carlos Pita - <carlosjosepita_AT_gmail.com> +* 0.4.1 Doomicide - <dm_AT_archlinux.info> diff --git a/tools.suckless.org/tabbed/tabbed.png b/tools.suckless.org/tabbed/tabbed.png Binary files differ. diff --git a/wmi.suckless.org/_werc/config b/wmi.suckless.org/_werc/config @@ -1,3 +0,0 @@ -siteTitle='window manager improved (wmi)' -siteSubtitle='deprecated' -menuTitle='about' diff --git a/wmi.suckless.org/index.md b/wmi.suckless.org/index.md @@ -1,25 +0,0 @@ -wmi was the initial project which became popular, though -[wmii](http://wmii.suckless.org) is the successor of wmi. There are still some -occasional users of wmi. If you would like to experience the good old days, -please check it out; though, its code sucks more unfortunately than -our recent projects. - -->[![Screenshot](screenshots/wmi-20080718s.png)](screenshots/wmi-20080718.png)<- - -Download --------- -* [wmi-11](http://dl.suckless.org/wmi/wmi-11.tar.gz) 2009-11-27 (120kb) - -Development ------------ -You can also [browse](http://git.suckless.org/wmi) its source code repository or -get a copy using git with the -following command: - - git clone git://suckless.org/wmi - -Build ------ -Read the INSTALL file from the source tarball. - -Have fun! diff --git a/wmi.suckless.org/screenshots/wmi-20080718.png b/wmi.suckless.org/screenshots/wmi-20080718.png Binary files differ. diff --git a/wmi.suckless.org/screenshots/wmi-20080718s.png b/wmi.suckless.org/screenshots/wmi-20080718s.png Binary files differ. diff --git a/wmi.suckless.org/wmi-10_compile_fixes.diff b/wmi.suckless.org/wmi-10_compile_fixes.diff @@ -1,107 +0,0 @@ -diff -r 6b4e7138042b src/action.cpp ---- a/src/action.cpp Sat Jan 27 17:29:39 2007 +0300 -+++ b/src/action.cpp Sun Jul 13 22:21:27 2008 +0400 -@@ -2,6 +2,11 @@ - // See ../LICENSE.txt for license details. - // - // $Id$ -+ -+extern "C" { -+#include <stdlib.h> // free -+#include <string.h> // strdup -+} - - #include <string> - #include "wmi.h" -diff -r 6b4e7138042b src/frame.h ---- a/src/frame.h Sat Jan 27 17:29:39 2007 +0300 -+++ b/src/frame.h Sun Jul 13 22:21:27 2008 +0400 -@@ -35,7 +35,7 @@ - void focus(Client *client); - - void attach(Client *client); -- Client *Frame::detach(Client *client); -+ Client *detach(Client *client); - - virtual Window window(); - -diff -r 6b4e7138042b src/inputbar.cpp ---- a/src/inputbar.cpp Sat Jan 27 17:29:39 2007 +0300 -+++ b/src/inputbar.cpp Sun Jul 13 22:21:27 2008 +0400 -@@ -31,7 +31,7 @@ - prompt_ = 0; - promptCounter_ = 0; - isArgument_ = false; -- entryBegin_ = entryEnd_ = 0; -+ entryBegin_ = entryEnd_ = (Sstring::iterator)0; - partitionBegin_ = selected_ = entryBegin_; - args_ = ""; - LOGDEBUG("creating input"); -@@ -233,7 +233,7 @@ - clearPrevPartitionsStack(); - } - else { -- entryBegin_ = entryEnd_ = 0; -+ entryBegin_ = entryEnd_ = (Sstring::iterator)0; - partitionBegin_ = selected_ = entryBegin_; - text_ = text; - } -diff -r 6b4e7138042b src/kernel.h ---- a/src/kernel.h Sat Jan 27 17:29:39 2007 +0300 -+++ b/src/kernel.h Sun Jul 13 22:21:27 2008 +0400 -@@ -167,7 +167,7 @@ - - void cleanup(); - -- Prompt *Kernel::defaultPrompt() const; -+ Prompt *defaultPrompt() const; - - void setMenuMode(bool isMenuMode); - -diff -r 6b4e7138042b src/logger.cpp ---- a/src/logger.cpp Sat Jan 27 17:29:39 2007 +0300 -+++ b/src/logger.cpp Sun Jul 13 22:21:27 2008 +0400 -@@ -2,6 +2,10 @@ - // See ../LICENSE.txt for license details. - // - // $Id$ -+ -+extern "C" { -+#include <stdlib.h> // exit -+} - - #include <iostream> - -diff -r 6b4e7138042b src/main.cpp ---- a/src/main.cpp Sat Jan 27 17:29:39 2007 +0300 -+++ b/src/main.cpp Sun Jul 13 22:21:27 2008 +0400 -@@ -10,6 +10,7 @@ - #include <assert.h> - #include <unistd.h> // getopt stuff - #include <stdlib.h> // getenv stuff -+#include <string.h> // strlen - #include <X11/Xlib.h> - } - -diff -r 6b4e7138042b src/util.cpp ---- a/src/util.cpp Sat Jan 27 17:29:39 2007 +0300 -+++ b/src/util.cpp Sun Jul 13 22:21:27 2008 +0400 -@@ -5,6 +5,7 @@ - - extern "C" { - #include <unistd.h> -+#include <stdlib.h> // atoi - #include <X11/Xlib.h> - } - -diff -r 6b4e7138042b src/wmiremote.cpp ---- a/src/wmiremote.cpp Sat Jan 27 17:29:39 2007 +0300 -+++ b/src/wmiremote.cpp Sun Jul 13 22:21:27 2008 +0400 -@@ -7,6 +7,7 @@ - - extern "C" { - #include <unistd.h> // getopt stuff -+#include <stdlib.h> // exit - #include <X11/Xatom.h> - #include <X11/Xlib.h> - #include <X11/Xutil.h> diff --git a/wmii.suckless.org/_werc/config b/wmii.suckless.org/_werc/config @@ -1,3 +0,0 @@ -siteTitle='window manager improved 2 (wmii)' -siteSubtitle='(moved off-site)' -menuTitle='about' diff --git a/wmii.suckless.org/code_snippets/plan_9_port/index.md b/wmii.suckless.org/code_snippets/plan_9_port/index.md @@ -1,170 +0,0 @@ -Code snippets for wmii-snap -=========================== - -The [9P filesystem](http://en.wikipedia.org/wiki/9P) backend of wmii allows for -rich scripting possibilites, adding new features and more convenience to your -wmii. Because of the simple nature of the 9P protocol, scripting is possible in -any language, using either native 9P libraries in that language or external -tools like the supplied wmiir/[ixpc](http://libs.suckless.org/). - -Feel free to add your own scripts to this page! - -The snippets that are in `rc` syntax should be added to your `rc.wmii.local` -file. - -See this sample `rc.wmii.local`: [(3.6)](http://sqweek.dnsdojo.org/wmii/rc.wmii.local-3.6) [(newer snapshots)](http://sqweek.dnsdojo.org/wmii/rc.wmii.local-20080520) - -Cycle Views ------------ - fn next_tag { - awk -v curtag'='`{wmiir read /tag/sel/ctl | sed 1q} ' - NR==1 {first = $0} - $0==curtag { if(getline) print $0; else print first; exit }' - } - fn Key-$MODKEY-n { - wmiir xwrite /ctl view `{ read_tags | next_tag} - } - fn Key-$MODKEY-b { - wmiir xwrite /ctl view `{ read_tags | tail -r | next_tag} - } - -Resize windows with the keyboard --------------------------------- -Adds a resize pseudo-mode to easily move or resize windows. M-C-r -enters resize mode, Escape exits it. - - # <h/j/k/l> grows the window in the given direction - # C-<h/j/k/l> shrinks the window in the given direction - # S-<h/j/k/l> moves the window in the given direction - fn Key-$mod-Control-r { - @{ - . wmii.rc $"* - - fn mode { - mod=$1; cmd=$2; shift 2 - eval ' - fn Key-$mod^$left {' wmiir xwrite /tag/sel/ctl $cmd sel sel left $"* '} - fn Key-$mod^$right {' wmiir xwrite /tag/sel/ctl $cmd sel sel right $"* '} - fn Key-$mod^$up {' wmiir xwrite /tag/sel/ctl $cmd sel sel up $"* '} - fn Key-$mod^$down {' wmiir xwrite /tag/sel/ctl $cmd sel sel down $"* '}'} - mode '' grow - mode Control- grow -1 - mode Shift- nudge - - fn Key-Escape { wi_cleankeys; exit } - - wi_eventloop - }&} - -Tag selected client and jump to new view ----------------------------------------- -If tagged with multiple tags, it will jump to the last view of the set. - - fn Key-MODKEY-Control-t { - newtag=`{wi_tags | wi_menu} - wmiir xwrite /client/sel/tags $newtag - newtag=`{echo $newtag | sed 's/.*\+//; s/-.*//'} - wmiir xwrite /ctl view $newtag - } - -Switch to named view by number ------------------------------ - -This allows to switch to a view with its position number, regardless of the view's name. - - fn keynum { - echo `{echo $1 | sed 's/.*-//'} - } - fn tagnum { - echo `{read_tags | sed -n $1^p} - } - - for(i in `{seq 0 9}) { - fn Key-$MODKEY-$i { - wmiir xwrite /ctl view `{tagnum `{keynum $1}} - } - fn Key-Shift-$MODKEY-$i { - wmiir xwrite /client/sel/tags `{tagnum `{keynum $1}} - } - } - -Tag addition and subtraction using tag+ and tag- ------------------------------------------------- - -If you tend to rely on wimenu's completion for retagging, it can be annoying that + or - prefix -renders it useless. This snippet allows you to append the + or -, rather than prepending -it. Prepending still works as before. - - fn Key-$MODKEY-Shift-t { - tag=`{wi_tags | wimenu | sed 's/(.*)([+\-])$/\2\1/'} - wmiir xwrite /client/`{wmiir read /client/sel/ctl | sed 1q}^/tags $tag - } - -Retag all clients in a view ---------------------------- - fn clients_on { - wmiir read /tag/$1/index | awk '!/^#/ { print $2 }' - } - - fn Key-$MODKEY-r { - target=`{wi_tags | wimenu} - for(c in `{clients_on sel}){ - wmiir xwrite /client/$c/tags -sel+$target - } - wmiir xwrite /ctl view $target - } - -Cycle trough tags starting with a specific character ----------------------------------------------------- - -(No tested, but might work) -Add a event in wmiirc that calls the following code. -If you have 3 tags named plan9, planner and plant: by calling the script you will cycle between the 3. -(Note: it does not work with capitals) - - count=1 - fn TagCycle { - inputtag=$1 - currenttag=`{wmiir read /tag/sel/ctl | awk '{ print substr($2, 1, 1); exit }'} - if(~ $currenttag $inputtag) { - count=`{expr $count + 1} - maxcount=`{wi_tags | grep '^'$inputtag | wc -l} - if (test $count -gt $maxcount) - count=1 - } - if not - count=1 - gototag=`{wi_tags | grep '^'$inputtag | sed -n $count^p} - wmiir xwrite /ctl view $gototag - } - -To easily add the entire alphabet in the bound buttons you can use this code. -Add this to your rc.wmii BEFORE the other keys (you still want your other old keys to work right ?): - - # Tag cycle - key $MODKEY-A-^(a b c d e f g h i j k l m n o p q r s t u v w x y z) || fn $key { - TagCycle $1} - -Find and go to client ---------------------- - - fn title { - echo -n `{wmiir read /client/$1/label}} - - fn focusclient { - tag=`{wmiir read /client/$1/tags | cut -d+ -f1} - wmiir xwrite /tag/$tag/ctl select client $1 - wmiir xwrite /ctl view $tag} - - key $MODKEY-u || fn $key { - ifs=$wi_nl { - clients=`{wmiir ls /client | head -n -1 | sed 's/\/$//'} - sel=`{{for(c in $clients) echo `{title $c}} | sort | uniq -u | wimenu -i} - if(test $sel) { - for(c in $clients) { - if(~ $sel `{title $c}) - match=$c - } - if(test $match) - focusclient $match}}} - diff --git a/wmii.suckless.org/code_snippets/plan_9_port/irssi_notifier.md b/wmii.suckless.org/code_snippets/plan_9_port/irssi_notifier.md @@ -1,104 +0,0 @@ -Irssi Message Notifier -====================== - -This script notifies you, by setting the Urgent hint on your irssi window, of -messages with your nick, or in channels you care about. It can optionally -display the messages on the bar. You'll need to set the title of the window -running irssi to 'irssi' for this to work. I use `label`(1) from plan9port. - -See also the [../python/irssi_notifier](python version). - -This portion goes in your rc.wmii.local, or can be modified to run standalone: - - showmessage=false # true, false - - fn isirssi { ~ `{wmiir read /client/$"*/label} irssi } - fn clients { wmiir ls /client | sed 's,/,,; /^sel$/d' } - - fn Event-IRCMessage { - if(! isirssi sel) { - for(c in `{clients}) - if(isirssi $c) - wmiir xwrite /client/$c/ctl Urgent - if($showmessage) { - shift 2 - echo $WMII_NORMCOLORS $* | wmiir create /rbar/0status - } - } - } - - fn Event-ClientFocus { - if(isirssi $1) - wmiir xwrite /client/$1/ctl NotUrgent - } - -This portion is a perl script for irssi. It should go in `~/.irssi/scripts`, -and can be loaded with `/script load notify`, or autoloaded by symlinking it -into `~/.irssi/scripts/autorun`. The irssi `notify_channels` setting takes a -list of channels to always notify you of messages to, or '*' to notify you for -all channels. - - # --------------------------------------------------------------------------- - # "THE BEER-WARE LICENSE" (Revision 42): - # <maglione.k@gmail.com> wrote this file. As long as you retain this notice you - # can do whatever you want with this stuff. If we meet some day, and you think - # this stuff is worth it, you can buy me a beer in return. Kris Maglione - # --------------------------------------------------------------------------- - # <phk@FreeBSD.ORG> wrote this license. As long as you retain this notice you - # can do whatever you want with this stuff. If we meet some day, and you think - # this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp - # --------------------------------------------------------------------------- - - use strict; - - our $VERSION = '20091030'; - our %IRSSI = ( - authors => 'Kris Maglione', - contact => 'maglione.k@gmail.com', - name => 'notify', - description => 'Writes certain messages to the wmii event FIFO', - license => 'BEER-WARE', - url => '', - changed => $VERSION, - modules => '', - ); - - use Irssi; - use Fcntl; - - sub should_notify ($); - - sub message_handler { - my ($server, $mesg, $nick, $address, $target) = @_; - my $mynick = $server->{nick}; - - if (not defined $target - or should_notify($target) - or $mesg =~ /\b$mynick\b/) { - $mesg =~ s/\n/\\n/g; - $target = ($target ? " in $target" : ""); - - open my $fifo, '| wmiir write /event' or return; - print $fifo "IRCMessage from $nick$target: $mesg\n"; - close $fifo; - } - } - - sub should_notify ($) { - my $target = shift; - my @notifies = split /,\s*/, Irssi::settings_get_str('notify_channels'); - - return 1 if grep { $_ eq "*" || $_ eq $target } @notifies; - 0; - } - - Irssi::signal_add('message private', 'message_handler'); - Irssi::signal_add('message public', 'message_handler'); - Irssi::settings_add_str('misc', 'notify_channels', ''); - -You can also set the label as required, if you so choose, from the IRSSI -plugin as so: - - open my $tty, '>', '/dev/tty'; - print $tty "\033]0;irssi\007"; - diff --git a/wmii.suckless.org/code_snippets/plan_9_port/mail_notifier.md b/wmii.suckless.org/code_snippets/plan_9_port/mail_notifier.md @@ -1,44 +0,0 @@ -Mail Notifier -============= - -This script will notify you of mail by setting the urgent hint -on windows for mail folders in which you have new mail. It only -works for Maildirs, and assumes that you have a window on the -`mail` tag named for each folder you wish to check. The name -`inbox` is special, and is treated as the root folder. When -there are files in the `new` folder for a given window, its -urgent hint is set. Otherwise, it is unset. - - #!/usr/local/plan9/bin/rc - . 9.rc - - # Configuration - delay=5 - maildir=$home/Maildir - # End Configuration - - echo Start mail | wmiir write /event - - { wmiir read /event & - while(echo Tick) - sleep $delay - } | while(*=`{read}) - switch($1) { - case Start - if(~ $2 mail) - exit - case Tick - wmiir read /tag/mail/index | - while(l = `{read}) { - b = `{echo $l | awk -F: '{print $3}'} - if(~ $b inbox) - b = '' - if(! ~ $#b 0 && test -d $maildir/.$b/new) { - knot = '' - if(~ `{ls -l $maildir/.$b/new | wc -l} 0) - knot = Not - wmiir xwrite /client/$l(2)^/ctl $knot^Urgent - } - } - } - diff --git a/wmii.suckless.org/code_snippets/python/battery_indicator.md b/wmii.suckless.org/code_snippets/python/battery_indicator.md @@ -1,77 +0,0 @@ -Battery Indicator -================= - -This is a simple battery indicator. Depending on the value of `from_acpi` -it either uses the system command `acpi` or processes data from the `/proc` -filesystem. To use it place the following code in your `wmiirc_local.py` file. -Please note, that monitors in wmii are sorted -alphabetically by their function names, so you might want to change the name as -you see fit. - -The `trem` function is a helper function used to convert seconds to the format -`hh:mm:ss`. `info_path` and `state_path` point to virtual files containing relevant -information regarding the battery. - - ### - import subprocess - - from_acpi = False - #Read battery data from 'acpi' command. - #If set to 'False' read data from /proc filesystem - info_path = '/proc/acpi/battery/BAT0/info' - state_path = '/proc/acpi/battery/BAT0/state' - infostr = open(info_path) - statestr = open(state_path) - - def trem(sec): - """Convert number of seconds to the format hh:mm:ss""" - h = sec / 3600 - m = (sec - h * 3600) / 60 - s = (sec - h * 3600 - m * 60) - return '%02d:%02d:%02d' % (h, m, s) - ### - - @defmonitor - def indicator(self): - if from_acpi: - inp = subprocess.Popen(['acpi'], shell = False, stdout = subprocess.PIPE) - out = inp.communicate() - return wmii.cache['normcolors'], out[0][:-1] - else: - info_raw = infostr.readlines() - state_raw = statestr.readlines() - infostr.seek(0) - statestr.seek(0) - info_list = [] - state_list = [] - for i in info_raw: - temp = i.split(':') - temp = map(str.strip, temp) - info_list.append(temp) - for i in state_raw: - temp = i.split(':') - temp = map(str.strip, temp) - state_list.append(temp) - info = dict(info_list) - state = dict(state_list) - if state['charging state'] == 'charging': - perc = float(state['remaining capacity'].split()[0])/\ - float(info['last full capacity'].split()[0])*100 - rem = int((float(info['last full capacity'].split()[0]) - \ - float(state['remaining capacity'].split()[0]))/\ - float(state['present rate'].split()[0])*3600) - res = 'Battery: Charging, %d%%, ' %perc\ - + trem(rem) + ' remaining' - return wmii.cache['normcolors'], str(res) - elif state['charging state'] == 'discharging': - perc = float(state['remaining capacity'].split()[0])/\ - float(info['last full capacity'].split()[0])*100 - rem = int(float(state['remaining capacity'].split()[0])/\ - float(state['present rate'].split()[0])*3600) - return wmii.cache['normcolors'], 'Battery: Discharging, %d%%, ' %perc\ - + trem(rem) + ' remaining' - elif state['charging state'] == 'charged': - return wmii.cache['normcolors'], 'Battery: Fully Charged' - else: - return wmii.cache['focuscolors'], 'Battery: UNRECOGNIZED STATE!!!' - diff --git a/wmii.suckless.org/code_snippets/python/freebsd_battery_indicator.md b/wmii.suckless.org/code_snippets/python/freebsd_battery_indicator.md @@ -1,20 +0,0 @@ -FreeBSD Battery Indicator -========================= - -This is a battery indicator written specifically for FreeBSD. FreeBSD has a simple command 'acpiconf -i <battery_name>', which neatly returns all relevant information. The monitor below simply parses the output and returns a compact selection of crucial data. - - - - ### - import commands - bat = 'BAT0' - ### - - @defmonitor - def bsdbattery(self): - a = commands.getoutput('acpiconf -i' + bat).splitlines() - b = dict([[i for i in j.split('\t') if i is not ''] \ - for j in a]) - return wmii.cache['normcolors'], 'Status: ' + b['State:'] +\ - 'Capacity: ' + b['Remaining capacity:'] + ' ' +\ - 'Time remaining: ' + b['Remaining time:']- \ No newline at end of file diff --git a/wmii.suckless.org/code_snippets/python/index.md b/wmii.suckless.org/code_snippets/python/index.md @@ -1,24 +0,0 @@ -Code snippets for the Python wmiirc -=================================== - -To use these code snippets, simply add them to a file called -`wmiirc_local.py` somewhere in your `$WMII_CONFPATH` (usually -`~/.wmii`). Alternatively, you can add them to any file whose -name ends in `.py` under `~/.wmii/plugins/` - -Automatically enter and leave pass-through mode for a specific tag ------------------------------------------------------------------- -I use this for testing wmii under Xephyr or Xembed, but it's -also for VNC and NX sessions. This specific configuration adds a -key binding M-x which will switch to and from the 'x' tag. When -the 'x' tag is active, all key bindings other than M-x will be -disabled, and will pass through to the active application. - - tags.ignore.add('x') - keys.bind('main', { '%(mod)s-x': lambda k: tags.select('x') }) - keys.bind('xembed', { '%(mod)s-x': lambda k: tags.select(tags.PREV) }) - bind_events({ - Match('FocusTag', 'x'): lambda *a: setattr(keys, 'mode', 'xembed'), - Match('UnfocusTag', 'x'): lambda *a: setattr(keys, 'mode', 'main'), - }) - diff --git a/wmii.suckless.org/code_snippets/python/irssi_notifier.md b/wmii.suckless.org/code_snippets/python/irssi_notifier.md @@ -1,99 +0,0 @@ -Irssi Message Notifier -====================== - -An IRC notifier based on the [../plan9port/irssi_notifier](plan9port version). - -This script notifies you when messages containing your nick, private -messages, or messages in certain important channels, arrive in -irssi. - -First, create `~/.wmii/plugins/irc_notify.py` with the following -contents: - - from wmiirc import * - from pygmi import * - - def isirssi(client): - return Client(client).label == 'irssi' - - def irc_message(whom, message): - if not isirssi('sel'): - for c in Client.all(): - if isirssi(c): - c.urgent = True - notice.show('IRC: %s %s' % (whom, message)) - return - - events.bind({ - Match('ClientFocus', _): lambda e, c: isirssi(c) and setattr(Client(c), 'urgent', False), - 'IRCMessage': lambda s: irc_message(*s.split(' ', 2)[1:]), - }) - -This portion is a perl script for irssi. It should go in -`~/.irssi/scripts`, and can be loaded with `/script load notify`, or -autoloaded by symlinking it into `~/.irssi/scripts/autorun`. The -irssi `notify_channels` setting takes a list of channels to always -notify you of messages to, or '*' to notify you for all channels. - - # --------------------------------------------------------------------------- - # "THE BEER-WARE LICENSE" (Revision 42): - # <maglione.k@gmail.com> wrote this file. As long as you retain this notice you - # can do whatever you want with this stuff. If we meet some day, and you think - # this stuff is worth it, you can buy me a beer in return. Kris Maglione - # --------------------------------------------------------------------------- - # <phk@FreeBSD.ORG> wrote this license. As long as you retain this notice you - # can do whatever you want with this stuff. If we meet some day, and you think - # this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp - # --------------------------------------------------------------------------- - - use strict; - - our $VERSION = '20091030'; - our %IRSSI = ( - authors => 'Kris Maglione', - contact => 'maglione.k@gmail.com', - name => 'notify', - description => 'Writes certain messages to the wmii event FIFO', - license => 'BEER-WARE', - url => '', - changed => $VERSION, - modules => '', - ); - - use Irssi; - use Fcntl; - - open my $tty, '>', '/dev/tty'; - print $tty "\033]0;irssi\007"; - close $tty; - - sub should_notify ($); - - sub message_handler { - my ($server, $mesg, $nick, $address, $target) = @_; - my $mynick = $server->{nick}; - - if (not defined $target - or should_notify($target) - or $mesg =~ /\b$mynick\b/) { - $mesg =~ s/\n/\\n/g; - $target = ($target ? " in $target" : ""); - - open my $fifo, '| wmiir write /event' or return; - print $fifo "IRCMessage from $nick$target: $mesg\n"; - close $fifo; - } - } - - sub should_notify ($) { - my $target = shift; - my @notifies = split /,\s*/, Irssi::settings_get_str('notify_channels'); - - return 1 if grep { $_ eq "*" || $_ eq $target } @notifies; - 0; - } - - Irssi::signal_add('message private', 'message_handler'); - Irssi::signal_add('message public', 'message_handler'); - Irssi::settings_add_str('misc', 'notify_channels', ''); - diff --git a/wmii.suckless.org/code_snippets/python/memory_usage_indicator.md b/wmii.suckless.org/code_snippets/python/memory_usage_indicator.md @@ -1,26 +0,0 @@ -Memory Usage Indicator -====================== - -This is a simple memory usage indicator based on information obtainable from -the `free` system command. - -It was written to work with wmii-3.9 and higher. To use it you have to put it -in your `wmiirc_local.py` file. Please note, that monitors in wmii are sorted -alphabetically by their function names, so you might want to change the name as -you see fit. - - ### - import subprocess - ### - - @defmonitor - def fmem(self): - inp = subprocess.Popen(['free'], shell = False, stdout = subprocess.PIPE) - out = inp.communicate()[0].splitlines() - ram = int(out[2].split()[2])/1024 - maxram = int(out[1].split()[1])/1024 - swap = int(out[3].split()[2])/1024 - maxswap = int(out[3].split()[1])/1024 - return wmii.cache['normcolors'], 'RAM: ' + str(ram) + '/' + str(maxram) +\ - ' MB' + ' | SWAP: ' + str(swap) + '/' + str(maxswap) + ' MB' - diff --git a/wmii.suckless.org/code_snippets/sh/index.md b/wmii.suckless.org/code_snippets/sh/index.md @@ -1,89 +0,0 @@ -Code snippets for wmii-snap -=========================== - -The [9P filesystem](http://en.wikipedia.org/wiki/9P) backend of wmii allows for -rich scripting possibilites, adding new features and more convenience to your -wmii. Because of the simple nature of the 9P protocol, scripting is possible in -any language, using either native 9P libraries in that language or external -tools like the supplied wmiir/[ixpc](http://libs.suckless.org/). - -Feel free to add your own scripts to this page! - -Most of the snippets below can be added to `~/.wmii/wmiirc_local`. Key and -event bindings should be added as in the following example, unless the snippet -specifies otherwise: - local_events="$(cat <<'!' - local_events() { - sed 's/^ //' <<'!' - Event CreateTag - ... - Key $MODKEY-x - ... - ! - } - -Resize windows with the keyboard --------------------------------- -Adds a resize pseudo-mode to easily move or resize windows. M-C-r -enters resize mode, Escape exits it. - - # <h/j/k/l> grows the window in the given direction - # C-<h/j/k/l> shrinks the window in the given direction - # S-<h/j/k/l> moves the window in the given direction - Key $MODKEY-Control-r - ( - . wmii.sh - for i in "'' grow" "Control- grow -1" "Shift- nudge"; do - eval "set -- $i"; mod=$1; cmd=$2; shift 2 - cat 's/^ /' <<! - Key Escape - exit - Key $mod-$LEFT - wmiir xwrite /tag/sel/ctl $cmd sel sel left $* - Key $mod-$RIGHT - wmiir xwrite /tag/sel/ctl $cmd sel sel right $* - Key $mod-$UP - wmiir xwrite /tag/sel/ctl $cmd sel sel up $* - Key $mod-$DOWN - wmiir xwrite /tag/sel/ctl $cmd sel sel down $* - ! - done | wi_events - wi_eventloop - ) & - -Add a name to views 0..9 ------------------------- - -Add this code to the beginning of your wmiirc: - - VIEW_NAME='[0] [1] [2]Chat [3]Dev [4]Web [5] [6] [7] [8] [9]' - getviewname(){ - i=$(($i+1)) - echo $VIEW_NAME | awk "{print $`echo $i`}"; - } - -and replace this: - - for i in 0 1 2 3 4 5 6 7 8 9; do - cat <<! - Key $MODKEY-$i # Move to the numbered view - wmiir xwrite /ctl view "$i" - Key $MODKEY-Shift-$i # Retag selected client with the numbered tag - wmiir xwrite /client/sel/tags "$i" - ! - done - -by: - - for i in 0 1 2 3 4 5 6 7 8 9; do - cat <<! - Key $MODKEY-$i # Move to the numbered view - wmiir xwrite /ctl view "`getviewname $i`" - Key $MODKEY-Shift-$i # Retag selected client with the numbered tag - wmiir xwrite /client/sel/tags "`getviewname $i`" - ! - done - - - - diff --git a/wmii.suckless.org/index.md b/wmii.suckless.org/index.md @@ -1,8 +0,0 @@ -wmii is a small, dynamic window manager for X11. It is scriptable, has a 9p -filesystem interface and supports classic and tiling (acme-like) window -management. It aims to maintain a small and clean (read hackable and beautiful) -codebase. - -->[![Screenshot](screenshots/wmii-20080117-thumb.png)](screenshots/wmii-20080117.png)<- - -wmii is currently [hosted at http://wmii.googlecode.com/](https://wmii.googlecode.com). diff --git a/wmii.suckless.org/screenshots/wmii-20080117-thumb.png b/wmii.suckless.org/screenshots/wmii-20080117-thumb.png Binary files differ. diff --git a/wmii.suckless.org/screenshots/wmii-20080117.png b/wmii.suckless.org/screenshots/wmii-20080117.png Binary files differ. diff --git a/wmii.suckless.org/wmii.png b/wmii.suckless.org/wmii.png Binary files differ.