zkondor / znotch

zNotch is for toggling (hide/show) your M1/M2 Macbook's notch
Other
74 stars 0 forks source link

Command line wrapper - request to contribute #6

Open egurnov opened 3 months ago

egurnov commented 3 months ago

Hello @zkondor !

I'd like to contribute a thin wrapper function for command line calls. Where do I put it?

Here's the function:

znotch() {
  case $1 in
  "show"|"s")
    open 'xyz.kondor.znotch://v1/manage?action=show'
    ;;
  "hide"|"h")
    open 'xyz.kondor.znotch://v1/manage?action=hide'
    ;;
  "toggle"|"t")
    open 'xyz.kondor.znotch://v1/manage?action=toggle'
    ;;
  *)
    echo "Invalid action: $1"
    echo "Available actions: show, hide, toggle"
    exit 1
    ;;
  esac
}
zkondor commented 3 months ago

Hey Alexander,

Thank you for the proposal. The initial goal of providing API is that everyone could create own personal wrapper for very own use cases (e.g..

What is your daily use case of this wrapper for the record? Currently there are no plans for having such wrapper though, since API is pretty straightforward.

egurnov commented 2 months ago

Hi Andrew,

Yes, the API is indeed quite simple and pleasant. However, I've found that it's still too much typing.

I've seen your Raycast plugin, but unfortunately, I'm not a Raycast user. But I do have a terminal open at all times. So this is my shortcut to zNotch.

I appreciate the fact that zNotch has a UI (drop-down menu in the status bar), but I've found myself in a situation where zNotch itself was hidden behind the notch.