[hackers] [wmii] Added an experimental feature to notify users of views with urgent clients.

From: Kris Maglione <jg_AT_suckless.org>
Date: Tue Feb 13 05:32:37 2007

changeset: 1861:4a815c30c168
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Mon Feb 12 23:32:00 2007 -0500
summary: Added an experimental feature to notify users of views with urgent clients.

diff -r a08a4d2d5e75 -r 4a815c30c168 client.c
--- a/client.c Mon Feb 12 22:44:42 2007 -0500
+++ b/client.c Mon Feb 12 23:32:00 2007 -0500
@@ -305,21 +305,27 @@ static void
 static void
 set_urgent(Client *c, Bool urgent, Bool write) {
         XWMHints *wmh;
- char *cwrite;
+ char *cwrite, *cnot;
+ Frame *f;
 
         cwrite = "Client";
         if(write)
                 cwrite = "Manager";
+ cnot = "Not";
+ if(urgent)
+ cnot = "";
 
         if(urgent != c->urgent) {
- if(urgent)
- write_event("Urgent 0x%x %s\n", client->win, cwrite);
- else
- write_event("NotUrgent 0x%x %s\n", client->win, cwrite);
+ write_event("%sUrgent 0x%x %s\n", cnot, client->win, cwrite);
                 c->urgent = urgent;
- if(c->sel && c->sel->view == screen->sel) {
- update_frame_widget_colors(c->sel);
- draw_frame(c->sel);
+ if(c->sel) {
+ if(c->sel->view == screen->sel) {
+ update_frame_widget_colors(c->sel);
+ draw_frame(c->sel);
+ }
+ if(!urgent || c->sel->view != screen->sel)
+ for(f=c->frame; f; f=f->cnext)
+ write_event("%sUrgentTag %s %s\n", cnot, cwrite, f->view->name);
                 }
         }
 
diff -r a08a4d2d5e75 -r 4a815c30c168 rc/wmiirc
--- a/rc/wmiirc Mon Feb 12 22:44:42 2007 -0500
+++ b/rc/wmiirc Mon Feb 12 23:32:00 2007 -0500
@@ -169,6 +169,14 @@ do
                 ;;
         UnfocusTag)
                 wmiir echo "/lbar/$parms" "$WMII_NORMCOLORS" "$parms"
+ ;;
+ UrgentTag)
+ shift
+ wmiir echo "/lbar/$@" "*$@"
+ ;;
+ NotUrgentTag)
+ shift
+ wmiir echo "/lbar/$@" "$@"
                 ;;
         LeftBarClick)
                 shift
Received on Tue Feb 13 2007 - 05:32:37 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:15 UTC