about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--config.arg.h1
-rw-r--r--config.default.h1
-rw-r--r--dwm.h1
-rw-r--r--view.c8
4 files changed, 11 insertions, 0 deletions
diff --git a/config.arg.h b/config.arg.h
index 3215c77..e6ea4ea 100644
--- a/config.arg.h
+++ b/config.arg.h
@@ -45,6 +45,7 @@ static Key key[] = { \
 	{ MODKEY|ControlMask|ShiftMask,	XK_4,		toggletag,	{ .i = 3 } }, \
 	{ MODKEY|ShiftMask,		XK_c,		killclient,	{ 0 } }, \
 	{ MODKEY,			XK_space,	togglemode,	{ 0 } }, \
+	{ MODKEY|ShiftMask,		XK_space,	togglefloat,	{ 0 } }, \
 	{ MODKEY,			XK_0,		viewall,	{ 0 } }, \
 	{ MODKEY,			XK_1,		view,		{ .i = 0 } }, \
 	{ MODKEY,			XK_2,		view,		{ .i = 1 } }, \
diff --git a/config.default.h b/config.default.h
index 85cc135..acacfdc 100644
--- a/config.default.h
+++ b/config.default.h
@@ -42,6 +42,7 @@ static Key key[] = { \
 	{ MODKEY|ControlMask|ShiftMask,	XK_5,		toggletag,	{ .i = 4 } }, \
 	{ MODKEY|ShiftMask,		XK_c,		killclient,	{ 0 } }, \
 	{ MODKEY,			XK_space,	togglemode,	{ 0 } }, \
+	{ MODKEY|ShiftMask,		XK_space,	togglefloat,	{ 0 } }, \
 	{ MODKEY,			XK_0,		viewall,	{ 0 } }, \
 	{ MODKEY,			XK_1,		view,		{ .i = 0 } }, \
 	{ MODKEY,			XK_2,		view,		{ .i = 1 } }, \
diff --git a/dwm.h b/dwm.h
index 18672d0..1f7dfe8 100644
--- a/dwm.h
+++ b/dwm.h
@@ -164,6 +164,7 @@ extern void focusprev(Arg *arg);		/* focuses previous visible client, arg is ign
 extern Bool isvisible(Client *c);		/* returns True if client is visible */
 extern void resizemaster(Arg *arg);		/* resizes the master percent with arg's index value */
 extern void restack(void);			/* restores z layers of all clients */
+extern void togglefloat(Arg *arg);		/* toggles selected client floating/tiled resp. */
 extern void togglemode(Arg *arg);		/* toggles global arrange function (dotile/dofloat) */
 extern void toggleview(Arg *arg);		/* toggles the tag with arg's index (in)visible */
 extern void view(Arg *arg);			/* views the tag with arg's index */
diff --git a/view.c b/view.c
index e7d7a99..21e7bbd 100644
--- a/view.c
+++ b/view.c
@@ -201,6 +201,14 @@ restack(void) {
 }
 
 void
+togglefloat(Arg *arg) {
+	if (!sel)
+		return;
+	sel->isfloat = !sel->isfloat;
+	arrange();
+}
+
+void
 togglemode(Arg *arg) {
 	arrange = (arrange == dofloat) ? dotile : dofloat;
 	if(sel)
ref='#n234'>234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301