commit 3638de51e06f84fbf8b59278c69685d70387414b
parent ea03dc79aad3c7695190542e95ecc989df9bee5d
Author: Denis Grelich <denisg@suckless.org>
Date: Sun, 24 Dec 2006 15:52:00 +0100
applied Stefan Tibus' 12_wmii-3.5-3colors.patch, introducing a third colour triple, WMII_FOCUSCOLOR, which is now used for focused frames.
Diffstat:
4 files changed, 23 insertions(+), 13 deletions(-)
diff --git a/frame.c b/frame.c
@@ -60,14 +60,14 @@ insert_frame(Frame *pos, Frame *f, Bool before) {
void
update_frame_widget_colors(Frame *f) {
- if(sel_screen && (f->client == sel_client()))
- f->tile.color = f->titlebar.color = def.selcolor;
- else
- f->tile.color = f->titlebar.color = def.normcolor;
- if(f->area->sel == f)
- f->grabbox.color = def.selcolor;
+ if(f->area->sel == f) {
+ if(sel_screen && (f->client == sel_client()))
+ f->grabbox.color = f->tile.color = f->titlebar.color = def.focuscolor;
+ else
+ f->grabbox.color = f->tile.color = f->titlebar.color = def.selcolor;
+ }
else
- f->grabbox.color = def.normcolor;
+ f->grabbox.color = f->tile.color = f->titlebar.color = def.normcolor;
}
void
diff --git a/fs.c b/fs.c
@@ -237,6 +237,11 @@ message_root(char *message)
srv.running = 0;
else if(!strncmp(message, "view ", 5))
select_view(&message[5]);
+ else if(!strncmp(message, "focuscolors ", 12)) {
+ message += 12;
+ n = strlen(message);
+ return parse_colors(&message, (int *)&n, &def.focuscolor);
+ }
else if(!strncmp(message, "selcolors ", 10)) {
message += 10;
n = strlen(message);
@@ -281,6 +286,7 @@ read_root_ctl() {
unsigned int i = 0;
if(screen->sel)
i += snprintf(&buffer[i], (BUFFER_SIZE - i), "view %s\n", screen->sel->name);
+ i += snprintf(&buffer[i], (BUFFER_SIZE - i), "focuscolors %s\n", def.focuscolor.colstr);
i += snprintf(&buffer[i], (BUFFER_SIZE - i), "selcolors %s\n", def.selcolor.colstr);
i += snprintf(&buffer[i], (BUFFER_SIZE - i), "normcolors %s\n", def.normcolor.colstr);
i += snprintf(&buffer[i], (BUFFER_SIZE - i), "font %s\n", def.font.fontstr);
diff --git a/rc/wmiirc b/rc/wmiirc
@@ -33,13 +33,14 @@ RIGHT=l
WMII_FONT='-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*'
# colors are text, bg, border
WMII_NORMCOLORS='#222222 #eeeeee #666666'
-WMII_SELCOLORS='#ffffff #335577 #447799'
+WMII_SELCOLORS='#444444 #bbbbbb #556088'
+WMII_FOCUSCOLORS='#ffffff #335577 #447799'
WMII_BACKGROUND='#333333'
DMENU="dmenu -b -fn $WMII_FONT -nb #eeeeee -nf #222222 -sb #335577 -sf #ffffff"
WMII_TERM="xterm"
-export DMENU WMII_FONT WMII_SELCOLORS WMII_NORMCOLORS WMII_TERM
+export DMENU WMII_FONT WMII_FOCUSCOLORS WMII_SELCOLORS WMII_NORMCOLORS WMII_TERM
# stop any running instances of wmiirc
echo Start wmiirc | wmiir write /event || exit 1
@@ -47,6 +48,7 @@ echo Start wmiirc | wmiir write /event || exit 1
# WM CONFIGURATION
wmiir write /ctl << EOF
font $WMII_FONT
+focuscolors $WMII_FOCUSCOLORS
selcolors $WMII_SELCOLORS
normcolors $WMII_NORMCOLORS
grabmod $MODKEY
@@ -61,7 +63,7 @@ EOF
# TAGGING RULES
wmiir write /tagrules <<EOF
/XMMS.*/ -> ~
-/Gimp.*/ -> ~
+/Gimp.*/ -> gimp
/MPlayer.*/ -> ~
/.*/ -> !
/.*/ -> 1
@@ -130,7 +132,7 @@ wmiir ls /tag | sed -e 's,/$,,; /^sel$/d' |
while read tag
do
if [ "X$tag" = "X$seltag" ]; then
- echo "$WMII_SELCOLORS" "$tag" | wmiir create "/lbar/$tag"
+ echo "$WMII_FOCUSCOLORS" "$tag" | wmiir create "/lbar/$tag"
else
echo "$WMII_NORMCOLORS" "$tag" | wmiir create "/lbar/$tag"
fi
@@ -158,7 +160,7 @@ do
wmiir remove "/lbar/$parms"
;;
FocusTag)
- xwrite "/lbar/$parms" "$WMII_SELCOLORS" "$parms"
+ xwrite "/lbar/$parms" "$WMII_FOCUSCOLORS" "$parms"
;;
UnfocusTag)
xwrite "/lbar/$parms" "$WMII_NORMCOLORS" "$parms"
diff --git a/wmii.h b/wmii.h
@@ -11,7 +11,8 @@
#include <ixp.h>
#define BLITZ_FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"
-#define BLITZ_SELCOLORS "#ffffff #335577 #447799"
+#define BLITZ_FOCUSCOLORS "#ffffff #335577 #447799"
+#define BLITZ_SELCOLORS "#444444 #bbbbbb #556088"
#define BLITZ_NORMCOLORS "#222222 #eeeeee #666666"
typedef struct Blitz Blitz;
@@ -182,6 +183,7 @@ struct Ruleset {
/* global variables */
struct {
+ BlitzColor focuscolor;
BlitzColor selcolor;
BlitzColor normcolor;
BlitzFont font;