File tree 3 files changed +40
-0
lines changed
3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6
19
19
20
20
### Changelog:
21
21
22
+ 2023-01-18 - Added the view history patch
23
+
22
24
2022-10-08 - Added the alt-tab patch
23
25
24
26
2022-08-12 - Added the nametag patch
@@ -802,6 +804,11 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6
802
804
- adds configurable gaps between windows differentiating between outer, inner, horizontal and
803
805
vertical gaps
804
806
807
+ - viewhistory
808
+ - adds a tag change history that is longer than the default current and previous tag
809
+ - `MOD`+Tab (`view(0)`) can be pressed multiple times to go further back to earlier tag
810
+ selections
811
+
805
812
- [viewontag](https://dwm.suckless.org/patches/viewontag/)
806
813
- follow a window to the tag it is being moved to
807
814
Original file line number Diff line number Diff line change 76
76
#define Button8 8
77
77
#define Button9 9
78
78
#define NUMTAGS 9
79
+ #define NUMVIEWHIST NUMTAGS
79
80
#define BARRULES 20
80
81
#if TAB_PATCH
81
82
#define MAXTABS 50
@@ -499,7 +500,11 @@ struct Monitor {
499
500
#endif // SETBORDERPX_PATCH
500
501
unsigned int seltags ;
501
502
unsigned int sellt ;
503
+ #if VIEW_HISTORY_PATCH
504
+ unsigned int tagset [NUMVIEWHIST ];
505
+ #else
502
506
unsigned int tagset [2 ];
507
+ #endif // VIEW_HISTORY_PATCH
503
508
int showbar ;
504
509
#if TAB_PATCH
505
510
int showtab ;
@@ -1607,7 +1612,12 @@ createmon(void)
1607
1612
1608
1613
m = ecalloc (1 , sizeof (Monitor ));
1609
1614
#if !EMPTYVIEW_PATCH
1615
+ #if VIEW_HISTORY_PATCH
1616
+ for (i = 0 ; i < LENGTH (m -> tagset ); i ++ )
1617
+ m -> tagset [i ] = 1 ;
1618
+ #else
1610
1619
m -> tagset [0 ] = m -> tagset [1 ] = 1 ;
1620
+ #endif // VIEW_HISTORY_PATCH
1611
1621
#endif // EMPTYVIEW_PATCH
1612
1622
m -> mfact = mfact ;
1613
1623
m -> nmaster = nmaster ;
@@ -4917,7 +4927,20 @@ view(const Arg *arg)
4917
4927
#if BAR_TAGPREVIEW_PATCH
4918
4928
tagpreviewswitchtag ();
4919
4929
#endif // BAR_TAGPREVIEW_PATCH
4930
+ #if VIEW_HISTORY_PATCH
4931
+ if (!arg -> ui ) {
4932
+ selmon -> seltags += 1 ;
4933
+ if (selmon -> seltags == LENGTH (selmon -> tagset ))
4934
+ selmon -> seltags = 0 ;
4935
+ } else {
4936
+ if (selmon -> seltags == 0 )
4937
+ selmon -> seltags = LENGTH (selmon -> tagset ) - 1 ;
4938
+ else
4939
+ selmon -> seltags -= 1 ;
4940
+ }
4941
+ #else
4920
4942
selmon -> seltags ^= 1 ; /* toggle sel tagset */
4943
+ #endif // VIEW_HISTORY_PATCH
4921
4944
if (arg -> ui & TAGMASK )
4922
4945
selmon -> tagset [selmon -> seltags ] = arg -> ui & TAGMASK ;
4923
4946
#if PERTAG_PATCH
Original file line number Diff line number Diff line change 1311
1311
*/
1312
1312
#define VANITYGAPS_MONOCLE_PATCH 0
1313
1313
1314
+ /* By default MOD+Tab will take the user back to the previous tag only. If the user keeps
1315
+ * using MOD+Tab then the view will switch back and forth between the current and previous tag.
1316
+ * This patch allows dwm to keep a longer history of previous tag changes such that MOD+Tab can
1317
+ * be pressed multiple times to go further back to earlier tag selections.
1318
+ *
1319
+ * The number of history elements is defined by the NUMVIEWHIST macro in dwm.c and defaults to
1320
+ * the number of tags in the system.
1321
+ */
1322
+ #define VIEW_HISTORY_PATCH 0
1323
+
1314
1324
/* Follow a window to the tag it is being moved to.
1315
1325
* https://dwm.suckless.org/patches/viewontag/
1316
1326
*/
You can’t perform that action at this time.
0 commit comments