···1112from qbpm import profiles
13from qbpm.profiles import Profile
14-from qbpm.utils import SUPPORTED_MENUS, error, get_default_menu, user_data_dir
151617def from_session(
···88def choose(args: argparse.Namespace) -> bool:
89 menu = args.menu or get_default_menu()
90 if not menu:
91- error(f"No menu program found, please install one of: {SUPPORTED_MENUS}")
92 return False
93 if menu == "applescript" and platform != "darwin":
94 error(f"Menu applescript cannot be used on a {platform} host")
···140 command = f"{menu} --dmenu {prompt}"
141 elif program in ["dmenu", "dmenu-wl"]:
142 command = f"{menu} {prompt}"
00143 exe = command.split(" ")[0]
144 if not shutil.which(exe):
145 error(f"command '{exe}' not found")
···1112from qbpm import profiles
13from qbpm.profiles import Profile
14+from qbpm.utils import AUTO_MENUS, error, get_default_menu, user_data_dir
151617def from_session(
···88def choose(args: argparse.Namespace) -> bool:
89 menu = args.menu or get_default_menu()
90 if not menu:
91+ error(f"No menu program found, please install one of: {AUTO_MENUS}")
92 return False
93 if menu == "applescript" and platform != "darwin":
94 error(f"Menu applescript cannot be used on a {platform} host")
···140 command = f"{menu} --dmenu {prompt}"
141 elif program in ["dmenu", "dmenu-wl"]:
142 command = f"{menu} {prompt}"
143+ elif program == "fzf":
144+ command = f"{menu} --prompt 'qutebrowser '"
145 exe = command.split(" ")[0]
146 if not shutil.which(exe):
147 error(f"command '{exe}' not found")
+3-4
qbpm/utils.py
···89from xdg import BaseDirectory # type: ignore
1011-SUPPORTED_MENUS = ["wofi", "rofi", "dmenu", "dmenu-wl", "applescript"]
0121314def error(msg: str) -> None:
···37def get_default_menu() -> Optional[str]:
38 if sys.platform == "darwin":
39 return "applescript"
40- for menu_cmd in SUPPORTED_MENUS:
41- if menu_cmd == "applescript":
42- continue
43 if which(menu_cmd) is not None:
44 return menu_cmd
45 return None
···89from xdg import BaseDirectory # type: ignore
1011+AUTO_MENUS = ["wofi", "rofi", "dmenu", "dmenu-wl"]
12+SUPPORTED_MENUS = AUTO_MENUS + ["fzf", "applescript"]
131415def error(msg: str) -> None:
···38def get_default_menu() -> Optional[str]:
39 if sys.platform == "darwin":
40 return "applescript"
41+ for menu_cmd in AUTO_MENUS:
0042 if which(menu_cmd) is not None:
43 return menu_cmd
44 return None