~pvsr/qpm

8b6b26a0bc2aeb7b75c9b8a6281fbe31bf8afc34 — Peter Rice 21 days ago d298efa master
document dmenu-wl support
3 files changed, 7 insertions(+), 4 deletions(-)

M qpm/main.py
M qpm/operations.py
M qpm/utils.py
M qpm/main.py => qpm/main.py +2 -1
@@ 7,6 7,7 @@ from xdg import BaseDirectory  # type: ignore

from qpm import __version__, operations, profiles
from qpm.profiles import Profile
from qpm.utils import SUPPORTED_MENUS

DEFAULT_PROFILE_DIR = Path(BaseDirectory.xdg_data_home) / "qutebrowser-profiles"



@@ 115,7 116,7 @@ def main(mock_args=None) -> None:
    choose.add_argument(
        "-m",
        "--menu",
        help="select which menu application to use",
        help=f"select which menu application to use (options: {SUPPORTED_MENUS})",
    )
    choose.add_argument(
        "--dmenu",

M qpm/operations.py => qpm/operations.py +3 -3
@@ 11,7 11,7 @@ from xdg.DesktopEntry import DesktopEntry  # type: ignore

from qpm import profiles
from qpm.profiles import Profile
from qpm.utils import error, get_default_menu, user_data_dir
from qpm.utils import SUPPORTED_MENUS, error, get_default_menu, user_data_dir


def from_session(


@@ 84,9 84,9 @@ def choose(args: argparse.Namespace) -> None:
        if not args.menu:
            error("No suitable menu program found, please install rofi or dmenu")
            return None
    elif args.menu not in ["rofi", "dmenu", "applescript"]:
    elif args.menu not in SUPPORTED_MENUS:
        error(
            f"{args.menu} is not a valid menu program, please specify one of rofi, dmenu, or applescript"
            f"'{args.menu}' is not a valid menu program, please specify one of: {SUPPORTED_MENUS}"
        )
        return None
    elif args.menu == "applescript" and platform != "darwin":

M qpm/utils.py => qpm/utils.py +2 -0
@@ 8,6 8,8 @@ from typing import Optional

from xdg import BaseDirectory  # type: ignore

SUPPORTED_MENUS = ["rofi", "dmenu", "dmenu-wl", "applescript"]


def error(msg: str) -> None:
    print(f"Error: {msg}", file=stderr)