DWM st (suckless terminal) doesn't start under user account

Experts,

I am running DWM. I upgraded my laptop from FreeBSD 11.2 to 12.0. i was under root account until Icomplete my upgrade and installing programs using port. i have managed to install DWM, dmenu and other stuff. When I booted into my user account. When Itry to invoke suckless terminal by Shift+Ctrl+Enter nothing is happening. Iam able to invoke dmenu by Alt+p however, st is not starting. Same is the issue with xterm. This makes me wonder what is that Iam missing to look at. Could someone shed some light on this? Help is much appreciated.
 
Hello. I am not an expert, but if you do not modify the configuration file, the terminal can be started by Alt+Shift+Enter
 
In the dwm config.h file it should have the terminal listed. This used to be "xterm" but they changed the default to "st".

Try running st from the command line and make sure you can get that started first.

Also have a look at the error log to see why st is not launching with the Alt-Shift-Enter shortcut.
 
Unless you've altered the defaults, you should also have dmenu installed started by a default of alt+p. You can try starting st from that (dmenu). Of course, that's one problem with dwm, if you can't get a terminal going, or at least dmenu, you can't even really troubleshoot. If you have a second window manager installed, you can also use that to see if st is working.
 
In the dwm config.h file it should have the terminal listed. This used to be "xterm" but they changed the default to "st".

Try running st from the command line and make sure you can get that started first.

Also have a look at the error log to see why st is not launching with the Alt-Shift-Enter shortcut.
Thank you kpedersen. Let my try starting my X with st starting by default and examine the error long.
 
Unless you've altered the defaults, you should also have dmenu installed started by a default of alt+p. You can try starting st from that (dmenu). Of course, that's one problem with dwm, if you can't get a terminal going, or at least dmenu, you can't even really troubleshoot. If you have a second window manager installed, you can also use that to see if st is working.
I have my dmenu starting fine. If it is possible to debug from dmenu, could please advise?
 
Sure. Try to start st from it. If nothing happens then do pkg install xterm or rxvt-unicode, which is called by urxvt and see if one of them starts with dmenu. (Or any other terminal that you like.)
Then you can use that terminal (xterm or urxvt) to see what happens when you call st from the command line--it'll probably be something silly like it's looking for a font that didn't get installed. (If that's the case, write the maintainer because that's a bug) :)
 
i have managed to install DWM, dmenu and other stuff.
I understand it that way that you have installed dwm and dmenu after the system upgrade. Before the upgrade you haven’t had them installed.
I upgraded my laptop from FreeBSD 11.2 to 12.0. i was under root account until Icomplete my upgrade and installing programs using port.
After upgrading the system to 12.0 have you reinstalled all ports/packages? It’s not clear if you have done it.

A possible cause for the malfunction could the be this:

When upgrading between major versions the ports/packages need to be reinstalled to match the system version. If you haven’t reinstalled the packages you may have runtime and library dependencies on which dwm, dmenu and st (sterm) depend on, but from a wrong system version ( dwm, dmenu,st build for 12.0, runtime/library dependencies build for 11.2 , installed by 11.2 packages/ports as dependency.).

If the above is not the case, and it’s not possible to start a terminal from dmenu, you mentioned in your first post that neither st or xterm would start from there, put a terminal in the users .xinitrc file (.xsession if you are using a login manager). That way you have a terminal at hand when entering dwm.
 
Ah I missed that xterm wouldn't start either. Sorry. You could try urxvt (pkg name is rxvt-unicode) or some other terminal.
 
I understand it that way that you have installed dwm and dmenu after the system upgrade. Before the upgrade you haven’t had them installed.

No. I had them before upgrading.

After upgrading the system to 12.0 have you reinstalled all ports/packages? It’s not clear if you have done it.
No, didn't.

A possible cause for the malfunction could the be this:

If that is the case then dmenu and dwm should not have started under root account too. But, they did start when I booted.

When upgrading between major versions the ports/packages need to be reinstalled to match the system version. If you haven’t reinstalled the packages you may have runtime and library dependencies on which dwm, dmenu and st (sterm) depend on, but from a wrong system version ( dwm, dmenu,st build for 12.0, runtime/library dependencies build for 11.2 , installed by 11.2 packages/ports as dependency.).

If the above is not the case, and it’s not possible to start a terminal from dmenu, you mentioned in your first post that neither st or xterm would start from there, put a terminal in the users .xinitrc file (.xsession if you are using a login manager). That way you have a terminal at hand when entering dwm.

I did placed st and urxvtcd on two separate tries. None of them worked. However, I started twm instead of dwm and it worked. Out of blue, I switched back to dwm the next time I rebooted my machine. And everything worked normally. I did nothing related to installation or upgrade or anything rather a couple of python scripts for organizing my music files. I have my user account completely fine now.

Thank you
 
EDIT: Oops, I missed that you seem to have everything solved already. Keeping my original post in case you did want to customise i.e the Dwm colors, etc...

Dwm is not really feasible to make into a FreeBSD package because it needs to be re-compiled to be configured. So we can only trust that the package maintainer has kept all the defaults?

So in: config.h (https://git.suckless.org/dwm/file/config.def.h.html)

We should see the following on line: 60.

Code:
static const char *termcmd[]  = { "st", NULL };

Are you able to run this terminal manually from within an xterm?

Code:
$ st

What I recommend is instead download the tiny source code

Code:
$ fetch https://dl.suckless.org/dwm/dwm-6.1.tar.gz

Extract it.

Code:
$ tar -xzf dwm-6.1.tar.gz

Build it once

Code:
$ cd dwm-6.1
$ make

Edit your .xinitrc to include the full path to the newly built dwm-6.1/dwm

Now you can edit the newly created config.h if you need to make changes and rebuild with make. This would be a good time to replace the default terminal with your preferred one.
 
My approach is to unpack dwm by make extract and copy the original dwm/files to a safe place, just in case. Then I copy config.def.h to config.def.h.orig. Then I do make patch to apply the patches. I change the config.def.h and compile the port. If I am happy with the result I run make makepatch which generates a dwm/files/patch-config.def.h. This patch file survives a make clean and can be easily re-used on other systems. May be I have to restore some of the other patches I have copied before. To ensure the patches work fine I run make clean. If make install generates the package as desired I run make clean and lock the port. By the way, I run same procedure with x11/sterm. Please have a look for a better description in https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/ which is not as scaring as it sounds;-).
 
You can easily configure the port. I describe it, to spam a bit, on my dwm page at http://srobb.net/dwm.html.
Download the port. As chrbr says, run make extract to get your config.h file (or copy over a config.h file from any installation.) Then, you can build from ports with

Code:
cd /usr/ports/x11-wm/dwm
make DWM_CONF=/usr/home/scottro/dwm/config.h install clean

If using portmaster then
Code:
 portmaster -m 'DWM_CONF=/usr/home/scottro/dwm/config.h x11-wm/dwm

Obviously, change that to match where you have your own config.h.

Or similar. Any patches you use can be placed, as chrbr describes, in /usr/ports/x11-wm/dwm/files.
 
Back
Top