MatthiasGrandl / Loungy

Loungy is a WIP launcher in the vein of Spotlight, Alfred, Raycast.
MIT License
1.48k stars 71 forks source link

Pass Argument to Loungy to Control Launched View #33

Closed distek closed 5 months ago

distek commented 5 months ago

Hi!

I have absolutely no Rust experience so I'm not sure how this would be done in order to contribute, but it would be fantastic if we could pass which feature we'd like to launch in Loungy like:

/Applications/Loungy.app/Contents/MacOS/loungy clipboard

The above launching the clipboard feature without the need to bind a MacOS wide hotkey.

This would be useful in likely several scenarios. The main scenario for me would be to use skhd to launch Loungy without needing to trick MacOS into thinking I pressed a certain key combo like I do right now (karabiner.json, cmd+shift+c being what I set the clipboard hotkey to):

          {
            "description": "fn+shift+c to cmd+shift+c",
            "manipulators": [
              {
                "from": {
                  "key_code": "c",
                  "modifiers": {
                    "mandatory": ["fn", "left_shift"]
                  }
                },
                "to": [
                  {
                    "key_code": "c",
                    "modifiers": ["left_command", "left_shift"]
                  }
                ],
                "type": "basic"
              }
            ]
          },

Whereas I could just do:

fn - shift - c : command open -a /Applications/Loungy.app/Contents/MacOS/loungy clipboard

Unless, of course, there's already a way to do this and I'm just missing it :)

Thanks for this, by the way! This app has been incredibly helpful for me thus far, and it's only been a day!

MatthiasGrandl commented 5 months ago

Not yet possible, but planned. This would improve cross platform hotkey possibilities quite a bit as well.

MatthiasGrandl commented 5 months ago

Rough early implementation:

> cargo run --all-features -- --help
    Finished dev [unoptimized + debuginfo] target(s) in 1.46s
     Running `target/debug/loungy --help`
Loungy is a WIP launcher in the vein of Raycast and Alfred.

Usage: loungy <Action> [Command]

Arguments:
  <Action>   [possible values: toggle, show, hide, quit, command]
  [Command]  [possible values: clipboard, tailscale, bitwarden, matrix, theme, root, process, menu]

Options:
  -h, --help     Print help
  -V, --version  Print version

Usage: loungy command clipboard

MatthiasGrandl commented 5 months ago

It's released in 0.1.3 if you want to give it a shot!

distek commented 5 months ago

Works wonderfully!

in my skhdrc:

fn - d : command /Applications/Loungy.app/Contents/MacOS/loungy command root
fn + shift - c : command /Applications/Loungy.app/Contents/MacOS/loungy command clipboard

Thank you!