Biont/sway-launcher-desktop

Pass Arguments to Commands

jhbruhn opened this issue · 4 comments

I like to run commands like killall waybar etc from my launcher, but unfortunately such commands do not seem to work using this launcher. An alternative would be to execute the search-input entered if no matching entry can be found.

Biont commented

Good idea! How are you attempting to do that currently? Are you using a custom provider? Or custom desktop files? Or some other way? Please elaborate on your current work flow a bit. I hope we can make it work

Until I found this project I used this script: https://github.com/jhbruhn/dotfiles/blob/master/.config/sway/sway_launcher based on a sway issue I found somewhere. It utilizes the fzf --print-query option to output the input the user entered.

I haven't attempted to implement command line arguments yet but I'll have another look. I'd add it into the internal command-provider (so not the one for desktop files) to pass everything after a space as an argument for commands, as those commands can't (shouldn't) have a space in the name anyways. Or do you think is solveable via a custom provider without listing every binary as a duplicate?

Biont commented

@jhbruhn I think I did it. Can you check the current master please?

Works for me! Nicely done, your implementation looks better than my hackery.