index.md - sites - public wiki contents of suckless.org
HTML git clone git://git.suckless.org/sites
DIR Log
DIR Files
DIR Refs
---
index.md (1286B)
---
1 Sort By Popularity
2 ==================
3
4 Description
5 -----------
6
7 The list of programs is sorted by popularity. Each time you run the program,
8 its popularity score increases by 1. The popularity data is saved in the cache
9 file located at: `{CACHE_PATH}/dmenu_pop.txt`.
10
11 #### Requirements
12
13 * One of the following system env **shall** be set `XDG_CACHE_HOME` or `HOME`
14 * Folder `$XDG_CACHE_HOME` or `$HOME/.cache` **shall** exist
15
16 #### How it works
17
18 The order of programs is based on their popularity, with more popular programs
19 appearing first. Programs with the same popularity are ordered according to
20 their position in the cache file.
21
22 For example, consider the following programs: `A`, `B1`, `B2`, `C`
23
24 `[User input] -> [dmenu output] -> [User's choice] -> {PROGRAM: POPULARITY}`
25
26 1. ` ` -> `A`, `B1`, `B2`, `C` -> `C` -> `{}`
27 2. ` ` -> `C`, `B1`, `B2`, `A` -> `B2` -> `{C: 1}`
28 3. ` ` -> `C`, `B2`, `B1`, `A` -> ` ` -> `{C: 1, B2: 1}`
29 4. `B` -> `B2`, `B1` -> `B1` -> `{C: 1, B2: 1}`
30 5. `B` -> `B2`, `B1` -> `B1` -> `{C: 1, B2: 1, B1: 1}`
31 6. `B` -> `B1`, `B2` -> ` ` -> `{C: 1, B2: 1, B1: 2}`
32
33 Download
34 --------
35 * [dmenu-sort_by_popularity-20250117-86f0b51.diff](dmenu-sort_by_popularity-20250117-86f0b51.diff) (2025-01-17)
36
37 Author
38 ------
39 * Wojciech Madry - <madrywojciech99@gmail.com>