dwmm is a dynamic window manager for X. It is lightweight, fast, and highly customizable. One of its great features is the ability to organize windows into tags. In this article, we will learn how to archive the same window visible in a specific tag or tags in dwm.
By default, dwm does not have a built-in feature to archive the same window in multiple tags. However, we can achieve this functionality by making a small modification to the dwm source code and recompiling it. Don't worry, it's not as complicated as it sounds!
Step 1: Download the dwm source code
The first step is to download the dwm source code. You can find the latest version on the official website or on GitHub. Once you have downloaded the source code, extract it to a directory of your choice.
Step 2: Modify the dwm source code
Next, we need to make a modification to the dwm source code to enable the feature of archiving the same window in multiple tags. Open the dwm.c file in a text editor of your choice.
Look for the following line of code:
static void
tag(const Arg *arg)
Below this line, add the following code:
if (selmon->sel && arg->ui > 0)
{
selmon->sel->tags = arg->ui;
arrange(selmon);
}
This code snippet checks if there is a selected window and if the argument passed to the tag function is greater than zero. If both conditions are true, it updates the tags of the selected window with the argument value and arranges the windows accordingly.
Step 3: Recompile and install dwm
After making the necessary modifications, save the dwm.c file and close it. Open a terminal and navigate to the directory where you extracted the dwm source code.
Run the following command to compile and install dwm:
sudo make clean install
This command will compile the modified dwm source code and install the updated dwm binary on your system.
Step 4: Using the new feature
Now that you have installed the modified version of dwm, you can start using the new feature to archive the same window in multiple tags.
To archive the same window in multiple tags, follow these steps:
- Select the window you want to archive by clicking on it.
- Hold down the
MODKEY(by default, it is theAltkey) and press the number keys corresponding to the tags you want the window to be visible in. For example, if you want the window to be visible in tags 1, 2, and 3, hold down theMODKEYand press1,2, and3on your keyboard. - The window will now be visible in the selected tags. You can switch between tags using the
MODKEYand the number keys.
This is how you can archive the same window in a specific tag or tags in dwm. Enjoy the improved productivity and organization that this feature brings!
Conclusion
dwm is a powerful and lightweight window manager that can be customized to suit your needs. By making a small modification to the dwm source code, we have enabled the feature of archiving the same window in multiple tags. This allows for better organization and productivity when working with multiple windows. Follow the steps outlined in this article to enable and use this feature in dwm.
References
| Reference | Link |
|---|---|
| dwm - dynamic window manager | https://dwm.suckless.org/ |
| dwm on GitHub | https://github.com/dwm |