Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ bit wonky, and will be fixed in the upcoming releases
- [ ] Clipboard History 20/12/2025
- [ ] Plugin Support 31/12/2025 (Partially implemented on 15/12/2025)
- [ ] Blur / transparent background (Partially implemented on 13/12/2025)
- [ ] Allow variables to be passed into custom shell scripts.
- [ ] Hyperkey - Map CMD + OPT + CTRL + SHIFT to a physical key
- [ ] Ability to pick between tabs in firefox / chromium browsers - using
[Puppeteer](https://pptr.dev/)
Expand All @@ -77,6 +76,7 @@ bit wonky, and will be fixed in the upcoming releases
- [x] Customisable themes (13/12/2025)
- [x] Configurable colours
- [x] Spotify control - Ability to control spotify via the app
- [x] Allow variables to be passed into custom shell scripts.
- [x] Google your query. Simply type your query, and then put a `?` at the end,
and press enter

Expand Down
12 changes: 12 additions & 0 deletions docs/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,15 @@ background_opacity = 1.0
blur = false
show_icons = true
show_scroll_bar = true

[[shells]]
command = "echo $var1 > file.txt" # This will start with $var1
icon_path = "" # optional
alias = "Variables 1" # the name that will be displayed in the results
alias_lc = "var" # the name used to search for it

[[shells]]
command = "echo $var2 > file.txt" # This will start with $var2 as there is 1 space in the alias_lc
icon_path = "" # optional
alias = "Variables 2" # the name that will be displayed in the results
alias_lc = "var again" # the name used to search for it
14 changes: 11 additions & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ impl Tile {
}

Message::RunFunction(command) => {
command.execute(&self.config);
command.execute(&self.config, &self.query);

if self.config.buffer_rules.clear_on_enter {
window::latest()
Expand Down Expand Up @@ -430,13 +430,21 @@ impl Tile {

let mut exact: Vec<App> = filter_vec
.par_iter()
.filter(|x| x.name_lc == query)
.filter(|x| match &x.open_command {
Function::RunShellCommand(_) => x
.name_lc
.starts_with(query.split_once(" ").unwrap_or((&query, "")).0),
_ => x.name_lc == query,
})
.cloned()
.collect();

let mut prefix: Vec<App> = filter_vec
.par_iter()
.filter(|x| x.name_lc != query && x.name_lc.starts_with(&query))
.filter(|x| match x.open_command {
Function::RunShellCommand(_) => false,
_ => x.name_lc != query && x.name_lc.starts_with(&query),
})
.cloned()
.collect();

Expand Down
12 changes: 9 additions & 3 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,31 @@ use crate::config::Config;
#[derive(Debug, Clone)]
pub enum Function {
OpenApp(String),
RunShellCommand(Vec<String>),
RunShellCommand(String),
RandomVar(i32),
GoogleSearch(String),
OpenPrefPane,
Quit,
}

impl Function {
pub fn execute(&self, config: &Config) {
pub fn execute(&self, config: &Config, query: &str) {
match self {
Function::OpenApp(path) => {
NSWorkspace::new().openURL(&NSURL::fileURLWithPath(
&objc2_foundation::NSString::from_str(path),
));
}
Function::RunShellCommand(shell_command) => {
let mut final_command = shell_command.to_owned();

for (argument_num, argument) in query.split_whitespace().enumerate() {
final_command =
final_command.replace(&format!("$var{}", argument_num), argument);
}
Command::new("sh")
.arg("-c")
.arg(shell_command.join(" "))
.arg(final_command)
.status()
.ok();
}
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl Default for Buffer {
/// Alias is the text that is used to call this command / search for it
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct Shelly {
command: Vec<String>,
command: String,
icon_path: Option<String>,
alias: String,
alias_lc: String,
Expand Down