6

So I just installed Ubuntu for the first time and I was trying to install Dmenu, and I opened the readme.txt to find this:

Installation

Edit config.mk to match your local setup (dmenu is installed into the /usr/local namespace by default).

Afterwards enter the following command to build and install dmenu (if necessary as root):

make clean install

What exactly is this telling me to do?

2
  • 4
    Dmenu can be installed with sudo apt-get install dmenu or your software center because it's available at the official Ubuntu repository. No need to compile.
    – user589808
    Sep 22 '16 at 23:38
  • 1
    Actually, it's not called dmenu. Note, selecting 'suckless-tools' instead of 'dmenu' Sep 23 '16 at 1:45
8

It's telling you to make sure config.mk has the settings you want. It looks like config.mk has the install path, as well as a few other options that more advanced users may want to tweak.

As CelticWarrior pointed out, you can install dmenu without having to worry about source code with sudo apt install dmenu or sudo apt install suckless-tools.

0

If you still want to know how to install dmenu from source code, here's some hint that I tried to install dmenu2 from source under xubuntu 20.04 focal. Dmenu2 is a patched version of dmenu. Which also works with dmenu of course.

The commands and explanations:

The bitbucket repo of dmenu2 uses mercurial, so...

sudo apt install mercurial

Check original dmenu package details to see from which repository is installed as mentioned dmenu is a virtual package name so look for suckless-tools:

apt show suckless-tools 

The interesting line is:

APT-Sources: http://fr.archive.ubuntu.com/ubuntu focal/universe amd64 Packages

And especially the universe repository Uncomment, if necessary, the line in /etc/apt/sources.list (span your favorite editor)

sudo vim /etc/apt/sources.list

The line we are looking for is a deb-src for the universe repository, it might look like:

deb-src http://fr.archive.ubuntu.com/ubuntu/ focal universe

update the packages list

sudo apt update

and let the packaging magic do the rest, this will install all the needed dependencies to build the packages:

sudo apt-get build-dep suckless-tools

now simply let the build tools do the job:

cd path/to/cloned/dmenu
make

You should have an fresh compiled ./dmenu in your local directory.

See inside the Makefile the actions that will be performed:

install: all
    mkdir -p $(DESTDIR)$(PREFIX)/bin
    cp -f dmenu dmenu_path dmenu_run stest $(DESTDIR)$(PREFIX)/bin
    chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu
    chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_path
    chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_run
    chmod 755 $(DESTDIR)$(PREFIX)/bin/stest
    mkdir -p $(DESTDIR)$(MANPREFIX)/man1
    sed "s/VERSION/$(VERSION)/g" < dmenu.1 > $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
    sed "s/VERSION/$(VERSION)/g" < stest.1 > $(DESTDIR)$(MANPREFIX)/man1/stest.1
    chmod 644 $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
    chmod 644 $(DESTDIR)$(MANPREFIX)/man1/stest.1

To finally install it to the destination configured (PREFIX = /usr/local in config.mk)

sudo make install

Have fun!

Want even more fun? check rofi instead, a drop in replacement for dmenu, and many more.

Which is also packaged already:

sudo apt install rofi
ls | rofi -dmenu

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.