Package: suckless-tools / 48-1

Change-Mod-key-to-the-Windows-key.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
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 } },