MCPcopy Index your code
hub / github.com/Shizcow/dmenu-rs

github.com/Shizcow/dmenu-rs @5.5.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release 5.5.4 ↗ · + Follow
214 symbols 548 edges 38 files 26 documented · 12% updated 22mo ago5.5.4 · 2024-08-20★ 2053 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

dmenu-rs - dynamic menu

dmenu is an efficient dynamic menu for X.
dmenu-rs is a 1:1 port of dmenu rewritten in Rust. It looks, feels, and runs pixel-for-pixel exactly the same.
It also has plugin support for easy modification.

State of the project

The master branch is a stable, feature complete product. It it not unmaintained; it's finished.

There is a small and ever-shrinking chance that this will be updated or overhauled in the distant future. It is much more likely that I will write a spiritual successor from scratch, but that won't happen until at least 2023.

Why Rust?

Inspiration

This project started with dmenu-calc. Initially, I wanted much more function than what is provided by bc. However, I found the bottleneck to be a lack of functionality and modability in dmenu(1) itself. So, the choice I had was to either mod dmenu(1) or rewrite it. Because dmenu source is horrendously annoying to read, I decided to rewrite it in a language which lends itself to writing code that is easier to modify. There are other languages for this, but I like Rust.

Improvements

As mentioned earlier, dmenu-rs runs exactly the same as dmenu. However, there are some significant performance enhancements under the hood. The most impactful is memory usage: dmenu-rs uses 21.65% less memory[1], while managing it much more safely without any performance impacts. The other large improvement is plugin support; read below.

Plugins

dmenu-rs leverages rust crates overrider and proc_use to provide an easy to write and powerful plugin system. The end-result are plugins which are dead-simple to enable.
For a list of available plugins and more info on enabling plugins, run make plugins.
For more info on developing plugins, read the plugin guide.

Requirements

  • Xlib header files
  • Cargo / rustc
  • A working C compiler

Installation

Standalone

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 dmenu:
make
Then, to install (if necessary as root):
make install

Distros

dmenu-rs is available from the following sources: - Arch AUR - stable branch
- Arch AUR - development branch

If you'd like for this to be available on another distro, raise an issue or submit a pull request with a README change pointing to the released package.

Running dmenu

See the man page for details. For a quick test, run:
make test

[1]: According to valgrind(1)

Extension points exported contracts — how you extend this code

Semigroup (Interface)
This module implements a Semigroup trait for several types used by stest. Semigroups are a common abstraction in functi [2 …
src/stest/src/semigroup.rs
ToFiles (Interface)
(no doc) [1 implementers]
src/stest/tests/integration_tests.rs
ToBytes (Interface)
(no doc) [1 implementers]
src/stest/tests/integration_tests.rs

Core symbols most depended-on inside this repo

len
called by 77
src/dmenu/item.rs
map
called by 69
src/dmenu/drw.rs
push
called by 41
src/dmenu/drw.rs
pop
called by 14
src/dmenu/drw.rs
into_iter
called by 14
src/dmenu/drw.rs
draw
called by 10
src/dmenu/drw.rs
textw
called by 9
src/dmenu/drw.rs
setscheme
called by 9
src/dmenu/drw.rs

Shape

Method 139
Function 48
Class 17
Enum 7
Interface 3

Languages

Rust100%

Modules by API surface

src/stest/tests/integration_tests.rs33 symbols
src/stest/src/file.rs30 symbols
src/dmenu/drw.rs21 symbols
src/dmenu/plugin_entry.rs20 symbols
src/dmenu/item.rs15 symbols
src/stest/src/lib.rs14 symbols
src/man/src/lib.rs10 symbols
src/plugins/calc/main.rs6 symbols
src/dmenu/fnt.rs6 symbols
src/dmenu/config.rs6 symbols
src/config/src/util.rs6 symbols
src/plugins/spellcheck/main.rs5 symbols

For agents

$ claude mcp add dmenu-rs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact