Best patches for DWM (dynamic window manager)

19 respostas [Última entrada]
sam-d16
Desconectado
Joined: 09/28/2023

Hi all . I would be grateful for your advice and recommendations for using useful patches.

I like the patch dwm-moveresize https://dwm.suckless.org/patches/moveresize/
It allows you to move the terminal in different directions, as well as increase or decrease the size of the terminal, a very useful patches.

Avron

I am a translator!

Desconectado
Joined: 08/18/2020

Hi sam-d16. Since I tried dwm, I find that automatic tiling is a great feature.

> I would be grateful for your advice and recommendations for using useful patches.

I am using the azerty, systray and autostart patches (for autostart, I use the 2016 version, I had problems with the 2021 version). Perhaps you already know:
- http://ratfactor.com/dwm and
- http://ratfactor.com/dwm2 that mention a few patches.

> I like the patch dwm-moveresize https://dwm.suckless.org/patches/moveresize/
> It allows you to move the terminal in different directions, as well as increase or decrease the size of the terminal, a very useful patches.

Do you mean, the size of the terminal window?

In dwm, I only use 7 commands:
- open terminal
- open dmenu
- switch to tag
- move active window to tag
- swap between main and stack
- enlarge main
- shrink main.

I don't try to optimize more than that. If a window does not fit well, I just move it to an empty tag.

However, when I run a dwm session, I am missing the configuration tools from MATE or LXDE. Like things from the mate-control-center or to control sleep/hibernate. I can start MATE tools from dmenu but I need to identify the commands and they don't always work. To control sleep, I found that lxsession-logout works. I use slock to lock the screen.

I am now trying to run a MATE session with dwm. In MATE, I have a single MATE panel on the top, I unticked "extend" in the panel properties so that it does not take the whole space (and I removed window list, useless for me). I kill marco and start dwm in a terminal. After I made the MATE panel floating, I do a right click on it and select "properties", then resize by clicking on + or -, then it resizes itself and moved to the top, it partially hides the dwm status bar. This is not a perfect setting but it solves my problem.

I found that there is a manual tiling programme x-tile that can work with any DE/window manager. I tried using it but I did not understand it well so far. I hope I can use it to make an "autotile" shortcut that does dwm-style tiling, and support the "enlarge main" and "shrink main" shortcuts.

sam-d16
Desconectado
Joined: 09/28/2023

Hello Avron . Thank you very much for your answer.

Why don't you use rofi https://github.com/adi1090x/rofi instead of dmenu, I think it's more convenient)) It adds a little graphics to minimalism)

As for the panel, I use dwmblocks https://dwm.suckless.org/status_monitor/. You can download almost any scripts and use them.

Here is a video https://invidious.protokolla.fi/watch?v=tVcWrosQ9aU where the user explains and he has a configuration file on github

Avron

I am a translator!

Desconectado
Joined: 08/18/2020

Thanks for the advice, I will try some of those.

Actually, I don't miss the MATE panel at all, systray and dmenu have all I need. My problem is adjusting fonts, keyboard layout, display resolution/scaling, microphone source or other hardware-related aspects. In MATE, with the MATE control center, without much thinking, it usually takes one minute to find some adjustment which is ok.

I can start mate-control-center by dmenu but when I change settings with it, it often does not work. For instance, changing the screen resolution with it has no effect. I found out that lxrandr works even without an LXDE session, so I use it but it has less less options than the corresponding MATE tool, so recently I had to use xrandr in command line. This requires searching for documentations and reading them, a problem solved in one minute with the MATE control center might take me days or weeks to solve.

If anyone knows a "how to adjust your settings without a desktop environment" guide, I am interested.

andyprough
Conectado
Joined: 02/12/2015

You should use the arandr tool to have a GUI to change display settings when using DWM. Microphone source would just be using pavucontrol.

Fonts can be changed in the config.def.h file in your main dwm folder. Probably keyboard layout can be changed in the config.def.h file also - a little bit of online searching should find you a good answer for that.

sam-d16
Desconectado
Joined: 09/28/2023

Another useful patch called dwm-tagshift => https://dwm.suckless.org/patches/tagshift/

By default, the user uses the MOD key and the numbers 1,2,3,4, etc. to switch to another desktop.
This patch allows you to use the MOD key and the left and right arrows to switch between desktops, this is very convenient.

The MOD key can be changed to Ctrl in the configuration file.

andyprough
Conectado
Joined: 02/12/2015

It sounds good in principle, but I think of the tags in terms of numbers, not in terms of left-right, so it wouldn't benefit me.

sam-d16
Desconectado
Joined: 09/28/2023

Hello Andy . You are an advanced user )) I read your comments , you are interested in how much memory DWM uses . If we are talking about this then we need Trisquel to have something similar to netinstall (~300 MB) from Devuan https://www.devuan.org/get-devuan, when you can install a minimum number of programs on a clean system and then install DWM.

I see NetInstall https://trisquel.info/en/download

62 MB CD ISO image
Text based network installer

Have you tried using this ISO with DWM ?

andyprough
Conectado
Joined: 02/12/2015

Yes, I've done netinstall minimum installations with Devuan and with several other distros, including Artix and Void and antiX. The good thing is you can get down to incredibly low initial ram usage, such as around 75mb. The bad thing is that a lot of programs won't work right because a lack of a proper dbus setup or sound setup or various other missing systems. In recent years I've been satisfied with installing a more complete distro and using DWM as my primary window manager, usually with about 130mb to 250mb of ram in use initially. One of the best distros for running well with low ram usage is the GNUinOS Openbox spin. The Trisquel Mini version is also a very good one to use with DWM as a complete distro with lower ram usage.

sam-d16
Desconectado
Joined: 09/28/2023

Hello Andy . Thank you very much for your opinion.

I'll have to try https://www.gnuinos.org/, interesting project https://libreplanet.org/wiki/Incoming_distros

Just like you, I like the minimalistic approach in terms of memory consumption, this is important for laptops like the x200 or t400.

What do the numbers say about Hyperbola with DWM and without Dbus? https://www.hyperbola.info/news/end-of-d-bus-support/

andyprough
Conectado
Joined: 02/12/2015

In my experience Hyperbola is the lowest memory usage you can get unless you create a specialized system with Gentoo - you can get down around 70mb at boot with Hyperbola and DWM (Gentoo can go as low as about 45mb of ram from what I've heard). If you do not need Dbus then Hyperbola is the best libre distro for using minimal resources.

I have written some How-To's on using Hyperbola somewhere on this forum - if you are interested in trying it let me know and I'll find the links for you.

sam-d16
Desconectado
Joined: 09/28/2023

Thank you very much for your opinion and your experience.

Have you experimented with OpenBSD and DWM, for example?

Why I understand that OpenBSD is not libre is because, as you know, HyperbolaBSD should appear in a year or later. What numbers does this distro show?

And yes, I will be grateful if you add links here so that other users who are interested in DWM can find information here too..

Avron

I am a translator!

Desconectado
Joined: 08/18/2020

> I understand that OpenBSD is not libre

I have read that it is free software but that there is a command fw_update that fetches non-free firmware and is run at first boot after installation and at every release upgrade. Commenting the call to fw_update in /usr/sbin/sysupgrade might avoid this.

sam-d16
Desconectado
Joined: 09/28/2023

In addition to this topic, I would like to recommend using 4 useful patches for the ST terminal:

1.st-scrollback https://st.suckless.org/patches/scrollback/

2.st-scrollback-mouse https://st.suckless.org/patches/scrollback/st-scrollback-mouse-20220127-2c5edf2.diff

3.st-scrollback-mouse-altscreen https://st.suckless.org/patches/scrollback/st-scrollback-mouse-altscreen-20220127-2c5edf2.diff

4.st-blinking_cursor https://st.suckless.org/patches/blinking_cursor/

You can also use your favorite terminal, for example sakura instead of st is a simple terminal https://st.suckless.org/

sam-d16
Desconectado
Joined: 09/28/2023

Hello Avron.

The ntpd daemon synchronizes the local clock with one or more remote google servers))

doas editor /etc/ntpd.conf

I don't think they strive for freedom like HyperbolaBSD does... (this is just my opinion)

https://teddit.net/r/openbsd/comments/cb6emf/why_does_openbsd_call_out_to_google_every_time_i/

https://man.openbsd.org/ntpd.conf

Regarding the use of RAM, it would be interesting to compare with other distros where DWM is installed

Avron

I am a translator!

Desconectado
Joined: 08/18/2020

Do you know a patch so that the presence, either of a particular window or of all floating windows, in a tag will not make the tag appear as having a window in it?

I mean, so that the small square, up and left of a tag number, is absent when no other window is there.

This would be useful when I use dwm with MATE, making the panel a floating window will all tags.

sam-d16
Desconectado
Joined: 09/28/2023

Hello Avron.

Did I understand you correctly that you don’t want to see a small square in the tag?

Maybe this patch https://dwm.suckless.org/patches/alttagsdecoration/? If not, I’ll look at other options, I also looked for myself, maybe I’ll remember.

There is a solution when you can reduce (hide) all tags to free up more space, this patch https://dwm.suckless.org/patches/hide_vacant_tags/

Avron

I am a translator!

Desconectado
Joined: 08/18/2020

> Maybe this patch https://dwm.suckless.org/patches/alttagsdecoration/?

I don't want to change the square.

By default, if *any* window is in the tag, the square is displayed. What I want is that a particular window, or any floating window, is ignored, i.e. the square only appears if *another* window is in the tag or only if a *non-floating* window is in the tag.

andyprough
Conectado
Joined: 02/12/2015

>"What I want is that a particular window, or any floating window, is ignored, i.e. the square only appears if *another* window is in the tag or only if a *non-floating* window is in the tag."

You should start by trying out the "sticky" patch. Use sticky to make your floating panel show up on all tags.

"Press MODKEY+s (default) to make a client 'sticky'. A sticky client is visible on all tags. This is similar to setting the client's tags to all 1's, but with the ability to easily return it to its original tag by toggling it off by pressing MODKEY+s again."[1]

And then if you need more changes to the way the tag indicator looks, then you might try the 'stickyindicator' patch.[2]

[1] http://dwm.suckless.org/patches/sticky/
[2] http://dwm.suckless.org/patches/stickyindicator/

sam-d16
Desconectado
Joined: 09/28/2023

Hello Avron . I encountered the same problem when I was trying to find the patch I needed)) Since the list of patches is getting larger and larger, it is becoming more and more difficult for the user to find the desired patch. I wrote to one developer to ask those who make patches to take a screenshot before and after the patch, this is much better than a short explanation. It's not always clear what we're talking about.

There is a large community on unixporn, there are many examples there and users write what patches they use and post their compilations, here is the link https://l.opnxng.com/r/unixporn/search?q=unixporn++dwm&restrict_sr=on