diff --git a/README.md b/README.md
index 417399a..f2434c4 100644
--- a/README.md
+++ b/README.md
@@ -86,10 +86,10 @@ Swayr can be configured using the `~/.config/swayr/config.toml` config file.
If it doesn't exist, a simple default configuration will be created on the
first invocation for use with the [wofi](https://todo.sr.ht/~scoopta/wofi)
-launcher.
+menu program.
-It should be easy to adapt that default config for usage with other launchers
-such as [dmenu](https://tools.suckless.org/dmenu/),
+It should be easy to adapt that default config for usage with other menu
+programs such as [dmenu](https://tools.suckless.org/dmenu/),
[bemenu](https://github.com/Cloudef/bemenu),
[rofi](https://github.com/davatorium/rofi), a script spawning a terminal with
[fzf](https://github.com/junegunn/fzf), or whatever. The only requirement is
@@ -99,7 +99,7 @@ and spit out the selected item to stdout.
The default config looks like this:
```toml
-[launcher]
+[menu]
executable = 'wofi'
args = [
'--show=dmenu',
@@ -118,9 +118,9 @@ urgency_start = ''
urgency_end = ''
```
-In the `[launcher]` section, you can specify the launchen/menu program using
-the `executable` name or full path, and the `args` (flags and options) it
-should get passed. If some argument contains the placeholder `{prompt}`, it is
+In the `[menu]` section, you can specify the menu program using the
+`executable` name or full path, and the `args` (flags and options) it should
+get passed. If some argument contains the placeholder `{prompt}`, it is
replaced with a prompt such as "Switch to window" depending on context.
In the `[format]` section, format strings are specified defining how selection
@@ -144,11 +144,11 @@ right now.
* `urgency_end` is a string which replaces the `{urgency_end}` placeholder in
`window_format`.
-It is crucial that during selection (using wofi or some other launcher) each
-window has a different display string. Therefore, it is highly recommended to
-include the `{id}` placeholder at least in `window_format`. Otherwise, e.g.,
-two terminals (of the same terminal app) with the same working directory (and
-therefore, the same title) wouldn't be distinguishable.
+It is crucial that during selection (using wofi or some other menu program)
+each window has a different display string. Therefore, it is highly
+recommended to include the `{id}` placeholder at least in `window_format`.
+Otherwise, e.g., two terminals (of the same terminal app) with the same working
+directory (and therefore, the same title) wouldn't be distinguishable.
## Questions & Patches
diff --git a/src/cmds.rs b/src/cmds.rs
index 3c353b3..b1da812 100644
--- a/src/cmds.rs
+++ b/src/cmds.rs
@@ -76,7 +76,7 @@ pub fn exec_swayr_cmd(args: ExecSwayrCmdArgs) {
}
SwayrCommand::ExecuteSwaymsgCommand => exec_swaymsg_command(),
SwayrCommand::ExecuteSwayrCommand => {
- if let Some(c) = util::select_from_choices(
+ if let Some(c) = util::select_from_menu(
"Select swayr command",
&[
SwayrCommand::ExecuteSwaymsgCommand,
@@ -357,7 +357,7 @@ impl DisplayFormat for SwaymsgCmd<'_> {
pub fn exec_swaymsg_command() {
let cmds = get_swaymsg_commands();
- let cmd = util::select_from_choices("Execute swaymsg command", &cmds);
+ let cmd = util::select_from_menu("Execute swaymsg command", &cmds);
if let Some(cmd) = cmd {
run_sway_command(&cmd.cmd);
}
diff --git a/src/con.rs b/src/con.rs
index 54b71f0..25b8cb6 100644
--- a/src/con.rs
+++ b/src/con.rs
@@ -249,14 +249,14 @@ pub fn select_window<'a>(
prompt: &str,
windows: &'a [Window],
) -> Option<&'a Window<'a>> {
- util::select_from_choices(prompt, windows)
+ util::select_from_menu(prompt, windows)
}
pub fn select_workspace<'a>(
prompt: &str,
workspaces: &'a [Workspace],
) -> Option<&'a Workspace<'a>> {
- util::select_from_choices(prompt, workspaces)
+ util::select_from_menu(prompt, workspaces)
}
pub enum WsOrWin<'a> {
@@ -306,7 +306,7 @@ pub fn select_workspace_or_window<'a>(
prompt: &'a str,
ws_or_wins: &'a [WsOrWin<'a>],
) -> Option<&'a WsOrWin<'a>> {
- util::select_from_choices(prompt, ws_or_wins)
+ util::select_from_menu(prompt, ws_or_wins)
}
pub struct Workspace<'a> {
diff --git a/src/config.rs b/src/config.rs
index 3e848ab..c8892aa 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -24,13 +24,27 @@ use std::path::Path;
#[derive(Debug, Serialize, Deserialize)]
pub struct Config {
- pub launcher: Option,
+ pub menu: Option