Skip to main content

pri3o-dmenu-desktop

Description

pri3o-dmenu-desktop is a drop-in replacement for Michael Stapelberg's i3-dmenu-desktop that adds simple application priorization. It supports all options present in i3-dmenu-desktop and a few more.

At this point priority is simply the absolute number times the program was run. For example a program ran three times has a higher priority than a program only run twice. It's very simple but pretty effective. In the future I might add a time-based component as well.

The priority data is stored in a sqlite database in $XDG_CONFIG_HOME/pri3o-dmenu-desktop/dmenu.db (defaults to ~/.config/pri3o-dmenu-desktop/dmenu.db) but a custom location can be specified via command line parameter. A new db will be create if it does not exist yet.

Requirements

To run this you need Python 3, all used libraries should be present in the standard distribution. Python 3 should already be present in any modern, non-minimal distribution. For older/LTS distributions (e.g. CentOS 7) you may need to install it.

For RedHat based distros this can be done via:

yum install python3

For Debian based distros use:

apt install python3

Installing

The easiest way to install is using pip3:

pip3 install pri3o_dmenu_desktop

Running

Just run using

pri3o-dmenu-desktop [OPTIONS]

If run without parameters, will behave like i3-dmenu-desktop without parameters. The optional commandline parameters are:

  • -d, --database=PATH path to database file; default $XDG_CONFIG_HOME/pri3o-dmenu-desktop/dmenu.db
  • -e, --entry-type=TYPE display "Name" (TYPE=name), "Exec" (TYPE=command) or .desktop filename (TYPE=filename) in dmenu, default name
  • -l, --locale=LOCALE use LOCALE (e.g. en_GB) for localisation of "Name", default is system locale
  • -m, --dmenu=COMMAND run this command for dmenu, default dmenu -i
  • -t, --term=COMMAND use this command for programs that need to be run in a terminal, default i3-sensible-terminal -e

Speed

As some people may wonder about how fast it is:

 % time pri3o-dmenu-desktop --dmenu=/bin/false
pri3o-dmenu-desktop --dmenu=/bin/false  0,06s user 0,01s system 99% cpu 0,070 total

 % time i3-dmenu-desktop --dmenu=/bin/false
i3-dmenu-desktop --dmenu=/bin/false  0,11s user 0,01s system 99% cpu 0,114 total

 % time j4-dmenu-desktop --dmenu=/bin/false
j4-dmenu-desktop --dmenu=/bin/false  0,00s user 0,00s system 97% cpu 0,006 total

On my system (SSD-only) it is slightly faster than i3-dmenu-desktop, but still much slower than j4-dmenu-desktop. For all practical purposes these differences should be negligible unless you have a lot of applications and/or a slow hard drive.

For comparison I ran the tests on an old Lenovo T61 with HDD, where the delay is definitely noticable. These values are always for the second run (after the .desktop files where in RAM). For the first run you can add around 800ms on top.

 % time pri3o-dmenu-desktop --dmenu=/bin/false
pri3o-dmenu-desktop --dmenu=/bin/false  0,13s user 0,02s system 99% cpu 0,154 total

 % time i3-dmenu-desktop --dmenu=/bin/false
i3-dmenu-desktop --dmenu=/bin/false  0,35s user 0,02s system 99% cpu 0,376 total

 % time j4-dmenu-desktop --dmenu=/bin/false
j4-dmenu-desktop --dmenu=/bin/false  0,00s user 0,01s system 96% cpu 0,011 total

Metadata

Release files for pri3o-dmenu-desktop 0.1.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pri3o-dmenu-desktop 0.1.4.1
File Size Uploaded
pri3o_dmenu_desktop-0.1.4.1.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pri3o-dmenu-desktop 0.1.4.1
File Interpreter ABI Platform
pri3o_dmenu_desktop-0.1.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.6 kB

Release files / pri3o_dmenu_desktop-0.1.4.1.tar.gz

Download URL pri3o_dmenu_desktop-0.1.4.1.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c809ef5cf3fff2c63e81e699fe8452b9bc21e4d3d177cfc7c0cf9c6f323b4008
BLAKE2b-256 checksum
How to use checksums
58f9ef7060b3545f7abd9add7aea0f33051ad363ed33eec462a13ef6865c88a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release files / pri3o_dmenu_desktop-0.1.4.1-py3-none-any.whl

Download URL pri3o_dmenu_desktop-0.1.4.1-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f923b72e162925649001fcf29720ba27bcc72183aa4edb7ed7701de086e220de
BLAKE2b-256 checksum
How to use checksums
7c888497d5abfa931bc8d4e249678989c13472191a58f3866a76c5ba0fece25e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.1.4.1 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page