Bug 227966 - x11-wm/dwm shipped with FreeBSD doesn't open a terminal
Summary: x11-wm/dwm shipped with FreeBSD doesn't open a terminal
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Many People
Assignee: Mateusz Piotrowski
URL:
Keywords: feature
Depends on:
Blocks:
 
Reported: 2018-05-04 08:37 UTC by Wojciech A. Koszek
Modified: 2018-07-20 09:46 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wojciech A. Koszek freebsd_committer freebsd_triage 2018-05-04 08:37:26 UTC
dwm is a minimalistic window manager. In Linux and OpenBSD case when you install it, it works by default. Pressing CMD+SHIFT+ENTER opens a terminal.

This doesn't work on FreeBSD. I think dwm tries to open uxterm by default, which I couldn't find on FreeBSD.

Somehow it works by default in OpenBSD.
Comment 1 Mateusz Piotrowski freebsd_committer freebsd_triage 2018-05-04 09:17:41 UTC
(In reply to Wojciech A. Koszek from comment #0)

dwm on FreeBSD comes with no additional patches by default. Stock dwm is configured to launch st (available as x11/sterm in ports). I don't know about OpenBSD but Debian is patching dwm to launch xterm instead. 

Actually, after the installation of dwm you should get a message that it is recommended to install additionally install sterm and dmenu. It's because dwm is preconfigured to launch those programs.

In order to modify the terminal dwm is launching when you hit Mod+Shift+Enter you've got to provide your own config.h file. This is the standard way to modify most software from suckless.org:

 1. Get a copy of config.h (for example from here[1])
 2. Get a copy of the ports tree on your machine
 3. Install dwm from ports using DWM_CONF to point to your custom config.h:

    # cd /usr/ports/x11-wm/dwm
    # make DWM_CONF="/path/to/your/config.h" install

PS I am trying to provide a detailed answer for future reference for other people who might not be experienced with FreeBSD just yet. Hence all those links to things you probably know better than I do. :) 

[1]: https://git.suckless.org/dwm/tree/config.def.h
[2]: https://www.freebsd.org/doc/handbook/ports-using.html
Comment 2 Mateusz Piotrowski freebsd_committer freebsd_triage 2018-05-04 09:21:36 UTC
I guess that we can think about two things here:

 1. Should we improve the after installation message? It seems to be a little bit confusing at the moment.
 2. Should we patch dwm just as Debian and OpenBSD do so that it use xterm, which is probably already installed by the time you launch dwm?

Let me know what you think.
Comment 3 Wojciech A. Koszek freebsd_committer freebsd_triage 2018-05-04 19:17:25 UTC
Mateusz,

If OpenBSD can work out of the box, so should FreeBSD. We can accomplish this by making dwm package depend on whatever other package it needs by default -- uxterm for dwm, so that when you `pkg install dwm`, the uxterm gets installed too.

Thanks,

Wojciech
Comment 4 Mateusz Piotrowski freebsd_committer freebsd_triage 2018-05-06 19:54:41 UTC
I guess that replacing st with uxterm seems to be a good idea.
Comment 5 Mateusz Piotrowski freebsd_committer freebsd_triage 2018-07-20 00:44:20 UTC
I am introducing an option, which adds x11/sterm and x11/dmenu to the runtime dependencies of dwm.

Differential revision: https://reviews.freebsd.org/D16358
Comment 6 commit-hook freebsd_committer freebsd_triage 2018-07-20 09:41:10 UTC
A commit references this bug:

Author: 0mp
Date: Fri Jul 20 09:40:26 UTC 2018
New revision: 475000
URL: https://svnweb.freebsd.org/changeset/ports/475000

Log:
  x11-wm/dwm: New option, which adds st and dmenu to runtime dependencies

  This patch adds an option to the dwm port, which makes x11/dmenu
  and x11/sterm be runtime dependencies of dwm. The option is enabled
  by default so that it's useful to users depending on pkg.

  While here:
  - Remove unused PATCH_SITES.
  - Silence STRIP_CMD.
  - Remove now outdated pkg-message.

  PR:		227966
  Reported by:	wkoszek
  Reviewed by:	krion (mentor)
  Approved by:	krion (mentor)
  Differential Revision:	https://reviews.freebsd.org/D16358

Changes:
  head/x11-wm/dwm/Makefile
  head/x11-wm/dwm/pkg-message
Comment 7 Mateusz Piotrowski freebsd_committer freebsd_triage 2018-07-20 09:46:00 UTC
Thanks, Wojciech!