From: Ilias Tsitsimpis <i.tsitsimpis@gmail.com>
Date: Sat, 10 Oct 2015 19:57:37 +0300
Subject: tabbed: Change Mod key to the Windows key

Provide 'tabbed.meta' alternative which uses the Windows key as Mod key.

Forwarded: no (Debian specific)
---
 tabbed/Makefile     |   18 ++++++++++++++----
 tabbed/config.def.h |    2 ++
 tabbed/tabbed.1     |   31 ++++++++++++++++++-------------
 3 files changed, 34 insertions(+), 17 deletions(-)

--- a/tabbed/Makefile
+++ b/tabbed/Makefile
@@ -17,7 +17,7 @@ CPPFLAGS += -DVERSION=\"${VERSION}\" -D_
 #TABBED_CFLAGS = -I/usr/X11R6/include -I/usr/X11R6/include/freetype2 ${CFLAGS}
 
 SRC = tabbed.c xembed.c
-OBJ = ${SRC:.c=.o}
+OBJ = tabbed.default.o tabbed.meta.o xembed.o
 BIN = ${OBJ:.o=}
 MAN1 = ${BIN:=.1}
 HDR = arg.h config.def.h
@@ -25,15 +25,25 @@ DOC = LICENSE README
 
 all: ${BIN}
 
-.c.o:
-	${CC} -o $@ -c $< ${CFLAGS} ${CPPFLAGS}
+%.default.o: %.c
+	@${CC} -o $@ -c ${CFLAGS} ${CPPFLAGS} $<
+
+%.meta.o: %.c
+	@${CC} -o $@ -c -DMODKEY=Mod4Mask ${CFLAGS} ${CPPFLAGS} $<
+
+xembed.o: xembed.c
+	@${CC} -o $@ -c ${CFLAGS} ${CPPFLAGS} $<
 
 ${OBJ}: config.h
 
 config.h:
 	cp config.def.h $@
 
-.o:
+
+tabbed.%: tabbed.%.o
+	@${CC} -o $@ $< ${LDFLAGS}
+
+xembed: xembed.o
 	${CC} -o $@ $< ${LDFLAGS}
 
 clean:
--- a/tabbed/tabbed.1
+++ b/tabbed/tabbed.1
@@ -110,38 +110,38 @@ defines the urgent foreground color.
 prints version information to stderr, then exits.
 .SH USAGE
 .TP
-.B Ctrl\-Shift\-Return
+.B Mod\-Shift\-Return
 open new tab
 .TP
-.B Ctrl\-Shift\-h
+.B Mod\-Shift\-h
 previous tab
 .TP
-.B Ctrl\-Shift\-l
+.B Mod\-Shift\-l
 next tab
 .TP
-.B Ctrl\-Shift\-j
+.B Mod\-Shift\-j
 move selected tab one to the left
 .TP
-.B Ctrl\-Shift\-k
+.B Mod\-Shift\-k
 move selected tab one to the right
 .TP
-.B Ctrl\-Shift\-u
+.B Mod\-Shift\-u
 toggle autofocus of urgent tabs
 .TP
-.B Ctrl\-Tab
+.B Mod\-Tab
 toggle between the selected and last selected tab
 .TP
-.B Ctrl\-`
+.B Mod\-`
 open dmenu to either create a new tab appending the entered string or select
 an already existing tab.
 .TP
-.B Ctrl\-q
+.B Mod\-q
 close tab
 .TP
-.B Ctrl\-u
+.B Mod\-u
 focus next urgent tab
 .TP
-.B Ctrl\-[0..9]
+.B Mod\-[0..9]
 jumps to nth tab
 .TP
 .B F11
@@ -158,8 +158,13 @@ $ xid=$(tabbed \-d);urxvt \-embed $xid
 $ tabbed \-r 2 st \-w '' \-e tmux
 .SH CUSTOMIZATION
 .B tabbed
-can be customized by creating a custom config.h and (re)compiling the source
-code. This keeps it fast, secure and simple.
+by default uses Ctrl as Mod key and can be customized by creating a custom
+config.h and (re)compiling the source code. This keeps it fast, secure and
+simple.
+
+Debian also provides the
+.B tabbed.meta
+alternative which uses the Windows key as Mod key.
 .SH AUTHORS
 See the LICENSE file for the authors.
 .SH LICENSE
--- a/tabbed/config.def.h
+++ b/tabbed/config.def.h
@@ -33,7 +33,9 @@ static Bool npisrelative  = False;
         } \
 }
 
+#ifndef MODKEY
 #define MODKEY ControlMask
+#endif
 static const Key keys[] = {
 	/* modifier             key        function     argument */
 	{ MODKEY|ShiftMask,     XK_Return, focusonce,   { 0 } },
