No Description

ohnonot 75ffc850b2 github to notabug 4 months ago
.gitignore 75ffc850b2 github to notabug 4 months ago
LICENSE 27a120780a 1st commit 2 years ago
README.md 2dd7dbc3cf v0.1.1 see changelog 2 years ago
changelog.md 2dd7dbc3cf v0.1.1 see changelog 2 years ago
config 75ffc850b2 github to notabug 4 months ago
install.sh 2dd7dbc3cf v0.1.1 see changelog 2 years ago
pacmenu 2dd7dbc3cf v0.1.1 see changelog 2 years ago
pacmenu.hook 2dd7dbc3cf v0.1.1 see changelog 2 years ago

README.md

pacmenu

Simple menu launcher that utilizes alpm data via expac (for archlinux-based distros)

Usage: pacmenu [-m] [-d dir] [-l launcher] [-c config] [-t term] [-h] [-v]

lists installed packages containing executables in $PATH, with description.
Choosing a package presents a list of these executables, to choose & execute.

  -m Show the menu. This is the default if no options are given.

  -u Update cache. Won't show the menu unless specified with -m.

  -d Cache directory. Applies to -m and -u options. In it, the files packages
     and paths are created. Defaults to $cache_dir.

  -l Launcher command. Defaults to $launch_cmd.

  -c Read config file. Defaults to ~/.config/pacmenu/config. Sourced by bash.
     Command line options override config options.

  -t Terminal emulator for final command. Not given, the script uses $TERMINAL,
     if defined. To force direct execution w/o terminal, supply an empty string.

Quick Start:

sudo ./install.sh will copy the executable to /usr/bin/ and the hook to /etc/pacman.d/hooks/

sudo pacmenu -u to initialize the menu cache (from now on, the pacmenu.hook automates this after every Install/Upgrade/Removal)

pacmenu to show the menu

Usage:

You can search packages by typing keywords, e.g. game, json, qt and so on. After choosing a package, a second menu appears with all the executables of that package. Highlighting one & pressing enter will execute it the usual way.

If you highlight one, press and append a semicolon ; to the line, then enter, it will execute in a terminal. If you append two semicolons ;; it will hold the terminal open by executing the default $SHELL after the command.

Hint: some commands don't exit by themselves. If you opened them with a double semicolon, then terminating them with Ctrl+C closes the terminal, too! However, I found that terminating them with Ctrl+D leaves the terminal open.

Explanation:

The idea of pacmenu was to have a menu/launcher that sees all "programs", i.e. executables, with descriptions as to what they do, and create an applauncher/menu that is not depending on .desktop files. Currently the list is sorted alphabetically by package names, with their description.
Packages that don't have executables in $PATH are filtered out.

The script pipes its output to a generic menu application like dmenu. This is configurable.

Additional grouping à la xdg-menu could be desired, but probably not practical with dmenu. On the other hand, dmenu matches keywords anywhere in the short description, so typing e.g. "game" should list most, if not all, games.

Requirements:

bash awk sed expac and a generic menu/launcher compatible with dmenu

Config file

# config options and their defaults

#cache_dir="/var/cache/pacmenu"
# command line option -c
# Cache directory. Applies to -m and -u options. In it, the files packages
# and paths are created.

#launch_cmd="/usr/bin/dmenu -l 22"
# command line option -l

#terminal_cmd="$TERMINAL"
# command line option -t
# Terminal emulator for final command. Not given, the script uses $TERMINAL,
# if defined. To force direct execution w/o terminal, supply an empty string.

An example is supplied with the package. If the script finds it in ~/.config/pacmenu/config it will source it.
Command line options override config file options.

Screenshots

First choice:
screenshot

Browsers maybe? screenshot

Second choice:
screenshot