-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPROJECT
31 lines (22 loc) · 1.11 KB
/
PROJECT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
hmenu will use huffman coding to optimally sort dmenu list entries
it spawns a dmenu instance as a subprogram, and passes in an optimized
menu list, based on past interaction. Past interaction is stored in an
SQLite database. The schema is simple:
+------------+-------+
| Menu Entry | Count |
+------------+-------+
The user will pass in a database file as its first parameter, and then
normal dmenu paramters aftwerwards.
The program will pass the menu entries sorted by the count field into
the standard input of a dmenu process that is spawned as a child
process. It will pass in the dmenu arguments it received as well.
The hmenu process will wait until the child process returns, and will
read the child process's standard output using file redirection
(again).
If the returned menu entry is not in the database, a new row is added
to the database. If it is in the database, its count field is
incremented by one.
Finally, the chosen menu entry is returned as hmenu's standard output,
mimicking dmenu.
* TODO
add support for __init__ function that will be called if the perl file exists and a menu item was returned