diff --git a/config.def.h b/config.def.h
index 1677f6f..625bc56 100644
--- a/config.def.h
+++ b/config.def.h
@@ -12,11 +12,11 @@ static const float fullscreen_bg[]         = {0.1, 0.1, 0.1, 1.0};
 static const int tagcount = TAGCOUNT;
 
 static const Rule rules[] = {
-	/* app_id     title       tags mask     isfloating   monitor */
+	/* app_id     title       tags mask     switchtotag   isfloating   monitor */
 	/* examples:
-	{ "Gimp",     NULL,       0,            1,           -1 },
+	{ "Gimp",     NULL,       0,            0,            1,           -1 },
+	{ "firefox",  NULL,       1 << 8,       1,            0,           -1 },
 	*/
-	{ "firefox",  NULL,       1 << 8,       0,           -1 },
 };
 
 /* layout(s) */
diff --git a/dwl.c b/dwl.c
index 4118fd8..e5c8974 100644
--- a/dwl.c
+++ b/dwl.c
@@ -125,6 +125,7 @@ typedef struct {
 	unsigned int bw;
 	uint32_t tags;
 	int isfloating, isurgent, isfullscreen;
+	int switchtotag;
 	uint32_t resize; /* configure serial of a pending resize */
 } Client;
 
@@ -207,6 +208,7 @@ typedef struct {
 	const char *id;
 	const char *title;
 	uint32_t tags;
+	bool switchtotag;
 	int isfloating;
 	int monitor;
 } Rule;
@@ -465,6 +467,11 @@ applyrules(Client *c)
 			wl_list_for_each(m, &mons, link)
 				if (r->monitor == i++)
 					mon = m;
+			if (r->switchtotag) {
+				c->switchtotag = selmon->tagset[selmon->seltags];
+				mon->seltags ^= 1;
+				mon->tagset[selmon->seltags] = r->tags & TAGMASK;
+			}
 		}
 	}
 	wlr_scene_node_reparent(&c->scene->node, layers[c->isfloating ? LyrFloat : LyrTile]);
@@ -2486,6 +2493,10 @@ unmapnotify(struct wl_listener *listener, void *data)
 	wlr_scene_node_destroy(&c->scene->node);
 	printstatus();
 	motionnotify(0);
+	if (c->switchtotag) {
+		Arg a = { .ui = c->switchtotag };
+		view(&a);
+	}
 }
 
 void