raycast / extensions

Everything you need to extend Raycast.
https://developers.raycast.com
MIT License
5.19k stars 2.88k forks source link

Input/Output presets [Set Audio Device] #13519

Open SamEdwardes opened 1 month ago

SamEdwardes commented 1 month ago

Extension

https://www.raycast.com/benvp/audio-device

Description

Great work on this extension. I use it everyday and find it really helpful! One thing that I would like is the ability to switch to a new input/output combo in one command. For example:

I would think of the above examples of "profiles". As a user I can create profiles that select a specific input and output device.

Who will benefit from this feature?

All users who have multiple input/output setups.

Anything else?

No response

raycastbot commented 1 month ago

Thank you for opening this issue!

🔔 @benvp @mathieudutour @mike182uk @FezVrasta @rcruzper @thomaspaulmann @arthur-fontaine @pernielsentikaer you might want to have a look.

💡 Author and Contributors commands The author and contributors of `benvp/audio-device` can trigger bot actions by commenting: - `@raycastbot close this issue` Closes the issue. - `@raycastbot rename this issue to "Awesome new title"` Renames the issue. - `@raycastbot reopen this issue` Reopens the issue. - `@raycastbot assign me` Assigns yourself to the issue. - `@raycastbot good first issue` Adds the "Good first issue" label to the issue. - `@raycastbot keep this issue open` Make sure the issue won't go stale and will be kept open by the bot.
bigplayer-ai commented 3 weeks ago

Extension

https://www.raycast.com/benvp/audio-device

Description

Great work on this extension. I use it everyday and find it really helpful! One thing that I would like is the ability to switch to a new input/output combo in one command. For example:

  • Set Input/Output Device: Silent

    • out=Jabra Link 380
    • in=Jabra Link 380
  • Set Input/Output Device: WeWork

    • out=MacBook Pro Speakers
    • in=Yeti X

I would think of the above examples of "profiles". As a user I can create profiles that select a specific input and output device.

Who will benefit from this feature?

All users who have multiple input/output setups.

Anything else?

No response

Why not using quick links + macOS shortcuts application to run the deep link/quick link generated by set audio extension?

SamEdwardes commented 3 weeks ago

Why not using quick links + macOS shortcuts application to run the deep link/quick link generated by set audio extension?

Good idea! I have not thought of that.

SamEdwardes commented 3 weeks ago

OK I got something working:

#!/bin/bash

# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Set Audio Device Presets
# @raycast.mode silent

# Optional parameters:
# @raycast.icon 🎙️
# @raycast.packageName Set Audio Device Presets
# @raycast.argument1 { "type": "dropdown", "placeholder": "Input/Output", "data": [ { "title": "Yeti/MacBook", "value": "Yeti/Macbook" }, { "title": "Jabra/Jabra", "value": "Jabra/Jabra" }, { "title": "Macbook/Macbook", "value": "Macbook/Macbook" },  { "title": "Airpods/Airpods", "value": "Airpods/Airpods" } ] }

# Documentation:
# @raycast.description Set input audio device to the Yeti X and set the output audio devic to MacBook Pro Seakers
# @raycast.author edwardes.s
# @raycast.authorURL https://raycast.com/edwardes.s

# Inputs
IN_YETI_X='raycast://extensions/benvp/audio-device/set-input-device?context=%7B%22deviceId%22%3A103%7D&launchType=userInitiated'
IN_MACBOOK='raycast://extensions/benvp/audio-device/set-input-device?context=%7B%22deviceId%22%3A98%7D&launchType=userInitiated'
IN_JABRA='raycast://extensions/benvp/audio-device/set-input-device?context=%7B%22deviceId%22%3A112%7D&launchType=userInitiated'
IN_AIRPODS='raycast://extensions/benvp/audio-device/set-input-device?context=%7B%22deviceId%22%3A148%7D&launchType=userInitiated'

# Outputs
OUT_MACBOOK='raycast://extensions/benvp/audio-device/set-output-device?context=%7B%22deviceId%22%3A91%7D&launchType=userInitiated'
OUT_JABRA='raycast://extensions/benvp/audio-device/set-output-device?context=%7B%22deviceId%22%3A107%7D&launchType=userInitiated'
OUT_AIRPODS='raycast://extensions/benvp/audio-device/set-output-device?context=%7B%22deviceId%22%3A142%7D&launchType=userInitiated'

# Switch audio devices
if [ "$1" = "Yeti/Macbook" ]; then
    open -g "$IN_YETI_X" &
    sleep 2
    open -g "$OUT_MACBOOK" &
elif [ "$1" = "Jabra/Jabra" ]; then
    open -g "$IN_JABRA" &
    sleep 2
    open -g "$OUT_JABRA" &
elif [ "$1" = "Macbook/Macbook" ]; then
    open -g "$IN_MACBOOK" &
    sleep 2
    open -g "$OUT_MACBOOK" &
elif [ "$1" = "Airpods/Airpods" ]; then
    open -g "$IN_AIRPODS" &
    sleep 2
    open -g "$OUT_AIRPODS" &
fi

It is a bit finicky though. Raycast opens and closes a few times which is a bit distracting. I can't seem to get the deeplinks to just run in the background without actually opening raycast.

I think this extension could still be improved with some kind of built-in presets.