sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

index.md (8196B)


      1 tab
      2 ===
      3 
      4 Description
      5 -----------
      6 This patch transforms the monocle layout into a tabbed layout whenever more
      7 than one window is present in the current view. The tabs are displayed in a
      8 dedicated bar at either the top or bottom of the screen.
      9 
     10 In addition to monocle mode, the tab bar can also be enabled for all layouts
     11 through configuration options in config.h or config.def.h.
     12 
     13 
     14 Usage
     15 -----
     16 Navigation between windows can be performed using the usual Modkey-j and
     17 Modkey-k keybindings, or by clicking directly on a window tab.
     18 
     19 The tab bar can be toggled using Modkey-w by default. This keybinding can be
     20 changed through the configuration options in config.h or config.def.h.
     21 
     22 
     23 Installation
     24 ------------
     25 
     26 * Make sure the directory where you build dwm does not contain a config.h file;
     27 * Apply the patch;
     28 * Run make and make install.
     29 
     30 
     31 Configuration 
     32 --------------
     33 
     34 * To change the position of the tab bar use :- 
     35 ```c 
     36 static const int toptab             = 0;        /* 1 means top tab bar */
     37 ``` 
     38 
     39 * To use tab bar for all layouts :-
     40 
     41 ```c 
     42 static const int alltab             = 0;        /* 0 means no tabbar for all layouts */
     43 ```
     44 
     45 
     46 Download
     47 --------
     48 
     49 * Tab patch alone
     50  * [dwm-tab-20260512-44dbc68.diff](dwm-tab-20260512-44dbc68.diff)
     51 
     52 * Tab patch with pertag support; 
     53     apply it on top of an already patched pertag build.
     54  * [dwm-tab_pertag-20260512-44dbc68.diff](dwm-tab_pertag-20260512-44dbc68.diff)
     55 
     56 
     57 
     58 check below for the original code.
     59 
     60 
     61 Description
     62 -----------
     63 Transforms the monocle layout into a ''tabbed'' layout if more than one window
     64 is present on the monocle view. Navigating from window to window is done by
     65 clicking on the window tabs or using the usual Mod1-j, Mod1-k keys. The tabs
     66 are arranged in a bar on top or at bottom of the screen, which can also be
     67 displayed in the other layouts than monocle. Three display modes can be
     68 selected at run time, auto display, permanent display and no display. In
     69 permanent mode the tab bar is always display independently of the layout, while
     70 in the auto mode it is displayed only with the monocle layout and in presence
     71 of several windows.
     72 
     73 This patch can be used as an alternative to the
     74 [tabbed](//tools.suckless.org/tabbed/) tool. It differs in two ways: the
     75 ''tab'' feature is limited to the monocle mode; it works with any application
     76 without requiring to support the XEmbed protocol nor to define in advance the
     77 set of applications to be supported.
     78 
     79 Usage
     80 -----
     81 With the default configuration, use the key combination Mod1-w to toggle the
     82 tab bar display. Switch focus to a window with a mouse left-click on its tab or
     83 by using the usual Mod1-j, Mod1-k commands. Usage is also documented in the dwm
     84 man page once the patch is applied.
     85 
     86 The selected view (''tag'') is reminded at the right corner of the tab bar.
     87 This feature is mainly meant to be used when the standard status bar is
     88 disabled. In case of a multi-tag view three dots are displayed without
     89 additional details.
     90 
     91 Configuration and Installation
     92 ------------------------------
     93 
     94 ### Quick installation
     95 
     96 #### Using the default configuration file
     97 
     98 * Make sure the directory where you build dwm does not contain a config.h file;
     99 * Apply the patch;
    100 * Run make and make install.
    101 
    102 The bar is displayed only with monocle layout when the view contains more than
    103 one window. The section "More Options" explains how to add more display
    104 options.
    105 
    106 #### Using an existing customised configuration file
    107 
    108 * Apply the patch;
    109 * Add the following lines to your config.h dwm configuration file:
    110 
    111        /*   Display modes of the tab bar: never shown, always shown, shown only in  */
    112        /*   monocle mode in presence of several windows.                            */
    113        /*   A mode can be disabled by moving it after the showtab_nmodes end marker */
    114        enum showtab_modes { showtab_never, showtab_auto, showtab_nmodes, showtab_always};
    115        static const int showtab            = showtab_auto; /* Default tab bar show mode  */
    116 	       static const Bool toptab            = True;         /* False means bottom tab bar */
    117 
    118 If you use the combined pertag+tab patch, include also (adapt the number of '0'
    119 to your `tags` array configuration):
    120 
    121 	/* default layout per tags */
    122 	/* The first element is for all-tag view, following i-th element corresponds to */
    123 	/* tags[i]. Layout is referred using the layouts array index.*/
    124 	static int def_layouts[1 + LENGTH(tags)]  = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
    125 * Run make and make install.
    126 
    127 The tab bar is displayed only with the monocle layout when the view contains
    128 more than one window. The Mod1-w key and the mouse support are not included in
    129 this configuration. Activation of these options is explained in the next
    130 section.
    131 
    132 ### More Options
    133 
    134 Pressing the key Mod1-w will cycle over the display modes of the tab bar
    135 described below with the following element added to the `keys` array:
    136 
    137 	{ MODKEY, XK_w, tabmode, {-1} }
    138 
    139 Selection of a window by a mouse left-click on its tab is enabled by adding the
    140 following element to the `buttons` array:
    141 
    142 	{ ClkTabBar, 0, Button1, focuswin, {0} },
    143 
    144 An example on how to insert these lines can be found in the default config file
    145 template, config.def.h.
    146 
    147 The tab bar includes three display options: always, never, auto. In auto mode,
    148 the tab bar is displayed only with the monocle layout and when the view
    149 contains more than one window. The modes available at run time can be selected
    150 by changing the order of the elements in the `showtab_mode` enum of the
    151 config.h configuration file: the modes before `showtab_nmodes` are enabled, the
    152 ones after are disabled. The default mode is specified in the `showtab`
    153 variable, it must be one of the enabled modes.
    154 
    155 Note: keyboard shortcuts to switch to a given display mode can be defined by
    156 using the `tabmode` function like in the definition of the `Mod1-w` key
    157 provided above and passing as argument the display mode (`showtab_never`,
    158 `showtab_always`, `showtab_auto`) instead of -1.
    159 
    160 The tab bar can be displayed on top or at bottom of the screen, which is
    161 controlled by the 'toptab' variable. If the tab bar is displayed at bottom,
    162 then it is recommended to set the variable `resizehints` of the config.h file
    163 to False. This setting prevents possible gap between the windows and the tab
    164 bar. You can find more details about this variable and gap between windows in
    165 the dwm FAQ.
    166 
    167 Download
    168 --------
    169 * Tab patch alone
    170   * For dwm 6.1: [dwm-6.1-tab-v2b.diff](dwm-6.1-tab-v2b.diff)
    171   * For dwm from the git master branch: [dwm-tab-v2b-20210810-7162335.diff](dwm-tab-v2b-20210810-7162335.diff)
    172   * For dwm 6.2: [dwm-6.2-tab-v2b.diff](dwm-6.2-tab-v2b.diff)
    173   * i3 like tabs for dwm master branch: [dwm-tab-i3like-20211121-a786211.diff](dwm-tab-i3like-20211121-a786211.diff)
    174 * Combined patch of tab and the [pertag](../pertag/) patch from Jan Christoph
    175   Ebersbach.
    176   * Follow the [link](../pertag/) for the description of this patch and the
    177     credits. The possibility to define the default layout per view has been added.
    178   * For dwm 6.1: [dwm-6.1-pertag-tab-v2b.diff](dwm-6.1-pertag-tab-v2b.diff)
    179   * For dwm from the git master branch:
    180     [dwm-tab-v2b-pertab-56a31dc.diff](dwm-tab-v2b-pertab-56a31dc.diff)
    181 
    182 Change log
    183 ----------
    184 * Fixed bugs in the pertag-tab integration that caused the tab patch to behave
    185   like the normal tab patch without proper pertag support. These issues are
    186    resolved in dwm-tab_pertag-20260512-44dbc68.diff.
    187 * Simplified the tab-related code. Simplified the three tab mode.
    188 * Add i3 like tabs that cover whole screen width
    189 * Fixed the standalone tab patch not applying to the current git master.
    190 * **v2b** Fixed in the pertag-tab patch the support for per-tag default layout
    191   specification. No change in the tab only patch.
    192 * **v2a** Typo corrected in the man page. For the combined pertag-tab patch,
    193   specification of a default layout per-tag layout was added in the config.h
    194   configuration file, but it was not taken into account properly. The version v2b
    195   fixed this issue.
    196 * **v2** First public version.
    197 
    198 Authors
    199 -------
    200 * Kanishk Saini - `<saini07kanishk@gmail.com>`
    201 * Philippe Gras - `<philippe dot gras at free dot fr>`
    202 * Varun Iyer (6.2 ver) - `<varun_iyer@protonmail.com>`
    203 * howoz - `<howoz@airmail.cc>`