DWM Tiling wm users did you compile from source (e.g. suckelss.org) or did you use ports?

gomster

Member

Reaction score: 4
Messages: 43

I'm coming over from arch, where i used dwm. It was brought to my attention that compiling from source(in the case of dwm, from suckless.org) may not be the optimal choice for freebsd, since the ports version may be a bit different and work better on freebsd. What is the better option in this scenario? I havent decided if i will stay on dwm but maybe i'll just have multiple wms. The ones that I'm looking at are: qtile, xmonad and dwm.
 

chrbr

Aspiring Daemon

Reaction score: 361
Messages: 879

I use the version from ports. But for customization I have an additional e]patch-config.def.h[/file][fil in /usr/ports/x11-wm/dwm/files/. After compilation I run pkg lock dwm to avoid that the compiled version is replaced by the package.

To generate the patch file I do make patch in the root directory of the port. Since I have a patch already there appears a config.def.h.orig in /usr/ports/x11-wm/dwm/work/dwm-6.2/. If there is no orig file just copy the unmodified version. Then apply your changes in config.def.h, go back to the root directory /usr/ports/x/usr/ports/x11-wm/dwm # cd work/dwm-6.2/11-wm/dwm/ and run make makepatch. Then a patch-config.def.h should appear in /usr/ports/x11-wm/dwm/files/ which reflect your modifications. That file will survive updates of the port. A make install should compile the stuff and install your customized package.
 

scottro

Daemon

Reaction score: 893
Messages: 2,040

I answered this in the other thread, but will put it here in case it shows up for people on a web search. Even with suckless stuff, the port will give you the opportunity to customize the config.h file during installation. I have a page on dwm that I updated yesterday :) which mentions installing on FreeBSD. You can get the port's default config.h file by doing make extract. Edit said config.h and save it somewhere. Any patches you have can be put in /usr/ports/x11-wm/dwm/files and the patches will be applied during installation of the port, for example, I like the move-resize patch.

Then, with patch in the port's files directory and my custom config.h in, for example, my home directory, I can do
make DWM_CONF=/home/scottro/config.h install clean.

I think the two main points are that sometimes, suckless and other programs are often created with Linux in mind and may have various errors if you try to compile on FreeBSD. These can usually be quickly fixed, but point 2 is that with ports, it's pretty easy to customize a package.
 

drhowarddrfine

Son of Beastie

Reaction score: 2,339
Messages: 4,304

the ports version may be a bit different and work better on freebsd.
If you mean work differently then no. The software works the same. Using ports means a FreeBSD maintainer has already ported, installed and tested it on FreeBSD. It saves you any trouble they may have had doing that. Packages are just pre-compiled ports with default configurations. Ports allows you to make customizations.
 

Zirias

Son of Beastie

Reaction score: 1,492
Messages: 2,607

To state the obvious: It seems "overengineering" was replaced by "oversimplifying" here. Expecting users to edit a header file and recompile for configuration, uhm, IMHO doesn't really "suck less", to the contrary.

Yep, the pretty nice and simple patch-management in ports has you covered (and chrbr described the general usage, not specific to this port). But imagine you're operating a system used by multiple users and they want the same software, but in different configurations?

And yes, saying "they should just all compile themselves and install in their home dirs" is nice as long as the software is written perfectly portable without any hickups on any Unix-like platform. In practice, this almost never happens.
 

scottro

Daemon

Reaction score: 893
Messages: 2,040

As a dwm fan, I feel obligated to point out that the philosophy there seems to be to create small programs with little overhead. I know little more of C than include stdio.h (which, being in my early 20's in the disco era, I always think of as studio h, as in Studio 54), but it's quite easy to figure out, and if not, there's a great tutorial on the Debian forums explaining it. Once it's been installed, if you want to say, change the bar from the top to the bottom, you would change one line and recompile, but it takes less than 10 seconds to do so.

The Debian forums tutorial is here.

However, I have to concede that on a multiuser system, with everyone using dwm, it would be a real pain. In such a case, something like spectrwm might be a better choice, plain text config file that can be easily adjusted for each user. I have another dated page about that one, https://srobb.net/spectrwm.html

I suppose in FreeBSD, one could do make extract, have each user keep the work/dwm-6.2 file in their home directory, make their changes and install in $HOME/bin/, but it seems an unlikely scenario. Might just depend upon which user of the machine was more skilled at fighting. :)

However, I think, judging from the original post,that the OP wouldn't be sharing their FreeBSD workstation with anyone else. I could be wrong, of course. And the stock dwm install has some fairly sane defaults, even if they're not to my taste--for example, their default is alt+shift+enter which opens an st terminal. I prefer Mod4 (the Winders key) +r to open urxvt. You can at least change Mod1 to Mod4 during original port configuration.

BTW to the original poster. I don't know if anyone's mentioned this in either of the threads, but once you have your dwm port configured and installed and you're happy with it, you can always run pkg create dwm You don't need root privilege to do this and you can create it in your home directory if you like. Then, if an upgrade or an error messes up your configuration, you can reinstall the version that was working for you with
sudo pkg install dwm-whatever.txz
 

aragats

Daemon

Reaction score: 700
Messages: 1,618

keep the work/dwm-6.2 file in their home directory, make their changes and install in $HOME/bin/
That's how I use it. I created a fork long time ago. It has incorporated a couple of patches e.g. GIMP layout (adjusted by me for Pidgin/Skype) etc. I don't care about possible new features, I like what I have, I revised DWM's code a few times before, made some changes/fixes/additions (not really essential).
 
Top