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     | 27 +++++++++++++++++++++------
 tabbed/config.def.h |  2 ++
 tabbed/tabbed.1     | 31 ++++++++++++++++++-------------
 3 files changed, 41 insertions(+), 19 deletions(-)

diff --git a/tabbed/Makefile b/tabbed/Makefile
index 1b95d15..35ea321 100644
--- a/tabbed/Makefile
+++ b/tabbed/Makefile
@@ -4,7 +4,7 @@
 include config.mk
 
 SRC = tabbed.c xembed.c
-OBJ = ${SRC:.c=.o}
+OBJ = tabbed.default.o tabbed.meta.o xembed.o
 BIN = ${OBJ:.o=}
 
 all: options ${BIN}
@@ -15,9 +15,17 @@ options:
 	@echo "LDFLAGS  = ${LDFLAGS}"
 	@echo "CC       = ${CC}"
 
-.c.o:
+%.default.o: %.c
 	@echo CC $<
-	@${CC} -c ${CFLAGS} $<
+	@${CC} -o $@ -c ${CFLAGS} $<
+
+%.meta.o: %.c
+	@echo CC $<
+	@${CC} -o $@ -c -DMODKEY=Mod4Mask ${CFLAGS} $<
+
+xembed.o: xembed.c
+	@echo CC $<
+	@${CC} -o $@ -c ${CFLAGS} $<
 
 ${OBJ}: config.h config.mk
 
@@ -25,7 +33,11 @@ config.h:
 	@echo creating $@ from config.def.h
 	@cp config.def.h $@
 
-.o:
+tabbed.%: tabbed.%.o
+	@echo CC -o $@
+	@${CC} -o $@ $< ${LDFLAGS}
+
+xembed: xembed.o
 	@echo CC -o $@
 	@${CC} -o $@ $< ${LDFLAGS}
 
@@ -46,7 +58,9 @@ install: all
 	@echo installing executable files to ${DESTDIR}${PREFIX}/bin
 	@mkdir -p "${DESTDIR}${PREFIX}/bin"
 	@cp -f ${BIN} "${DESTDIR}${PREFIX}/bin"
-	@chmod 755 "${DESTDIR}${PREFIX}/bin/tabbed"
+	@chmod 755 "${DESTDIR}${PREFIX}/bin/tabbed.meta"
+	@chmod 755 "${DESTDIR}${PREFIX}/bin/tabbed.default"
+	@chmod 755 "${DESTDIR}${PREFIX}/bin/xembed"
 	@echo installing manual pages to ${DESTDIR}${MANPREFIX}/man1
 	@mkdir -p "${DESTDIR}${MANPREFIX}/man1"
 	@sed "s/VERSION/${VERSION}/g" < tabbed.1 > "${DESTDIR}${MANPREFIX}/man1/tabbed.1"
@@ -56,7 +70,8 @@ install: all
 
 uninstall:
 	@echo removing executable files from ${DESTDIR}${PREFIX}/bin
-	@rm -f "${DESTDIR}${PREFIX}/bin/tabbed"
+	@rm -f "${DESTDIR}${PREFIX}/bin/tabbed.meta"
+	@rm -f "${DESTDIR}${PREFIX}/bin/tabbed.default"
 	@rm -f "${DESTDIR}${PREFIX}/bin/xembed"
 	@echo removing manual pages from ${DESTDIR}${MANPREFIX}/man1
 	@rm -f "${DESTDIR}${MANPREFIX}/man1/tabbed.1"
diff --git a/tabbed/config.def.h b/tabbed/config.def.h
index defa426..f2c2a6c 100644
--- 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 Key keys[] = {
 	/* modifier             key        function     argument */
 	{ MODKEY|ShiftMask,     XK_Return, focusonce,   { 0 } },
diff --git a/tabbed/tabbed.1 b/tabbed/tabbed.1
index 05d4b80..9848f22 100644
--- 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
