返回顶部
h

home-music全屋音乐控制

Control whole-house music scenes combining Spotify playback with Airfoil speaker routing. Quick presets for morning, party, chill modes.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
2,059
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

home-music

♪ ♫ ♪ ♫ ♪ ♫ ♪ ♫ ♪ ♫ ♪ ♫ ♪ ♫ ♪ ♫ ♪ ♫ ♪ ♫

🏠 全 屋 音 乐 🎵

╔══════════════════════════════════════════╗
║ 全屋音乐场景 ║
║ 一条指令。所有音箱。完美。 ║
╚══════════════════════════════════════════╝

♪ ♫ ♪ ♫ ♪ ♫ ♪ ♫ ♪ ♫ ♪ ♫ ♪ ♫ ♪ ♫ ♪ ♫ ♪ ♫

一条指令就能搞定的事,为什么要点17次? – 欧文 🐸


🎯 这个技能是做什么的?

Home Music 将 Spotify + Airfoil 整合成神奇的音乐场景。一条指令——就能让正确的歌单以完美的音量在正确的音箱上播放。

想象一下:

  • - 你醒来 → home-music morning → 浴室里响起轻柔的旋律
  • 朋友来了 → home-music party → 所有音箱播放摇滚乐
  • 该放松了 → home-music chill → 到处是休闲氛围
  • 一天结束 → home-music off → 安静。平和。宁静。



📋 依赖项


项目用途链接
🍏 macOS此技能使用 AppleScript
🟢 Spotify 桌面应用
音乐来源!必须正在运行。 | spotify.com |
| 📡 Airfoil | 将音频路由到 AirPlay 音箱 | rogueamoeba.com |
| 🎵 spotify-applescript | 用于控制 Spotify 的 Clawdbot 技能 | skills/spotify-applescript/ |

⚠️ 重要提示: 启动任何场景前,必须确保 Spotify 和 Airfoil 都已运行!


🎬 场景

🌅 早晨

温柔地开启新的一天

bash
home-music morning

  • - 音箱: Sonos Move
  • 音量: 40%
  • 歌单: 早晨歌单
  • 氛围: ☕ 咖啡 + 好心情

🎉 派对

庆祝时刻!

bash
home-music party

  • - 音箱: 全部(电脑、MacBook、Sonos Move、客厅电视)
  • 音量: 70%
  • 歌单: 摇滚派对混音
  • 氛围: 🤘 邻居最讨厌这一招

😌 放松

纯粹的放松

bash
home-music chill

  • - 音箱: Sonos Move
  • 音量: 30%
  • 歌单: 休闲酒廊
  • 氛围: 🧘 唵...

🔇 关闭

安静

bash
home-music off

  • - 暂停 Spotify
  • 断开所有音箱
  • 氛围: 🤫 终于,安静了

📊 状态

现在在播放什么?

bash
home-music status

显示:

  • - 当前 Spotify 曲目
  • 已连接的音箱



🔧 安装

bash

使脚本可执行


chmod +x ~/clawd/skills/home-music/home-music.sh

创建全局符号链接

sudo ln -sf ~/clawd/skills/home-music/home-music.sh /usr/local/bin/home-music

现在 home-music 可以在终端的任何位置使用了!🎉



🎨 自定义歌单和场景

更改歌单

打开 home-music.sh 找到歌单配置:

bash

=== 歌单配置 ===


PLAYLIST_MORNING=spotify:playlist:19n65kQ5NEKgkvSAla5IF6
PLAYLIST_PARTY=spotify:playlist:37i9dQZF1DXaXB8fQg7xif
PLAYLIST_CHILL=spotify:playlist:37i9dQZF1DWTwnEm1IYyoj

如何找到歌单 URI:

  1. 1. 在 Spotify 中右键点击歌单
  2. 分享 → 复制 Spotify URI
  3. 或复制 URL 并提取 /playlist/ 部分

添加新场景

在 main 代码块中添加新的 case:

bash

在 home-music.sh 中,scene_chill 函数之后:

scene_workout() {
echo 💪 开始健身场景...
airfoilsetsource_spotify
airfoil_connect Sonos Move
sleep 0.5
airfoil_volume Sonos Move 0.8
$SPOTIFYCMD play spotify:playlist:YOURWORKOUT_PLAYLIST
$SPOTIFY_CMD volume 100
echo ✅ 健身:Sonos Move @ 80%,嗨起来!
}

在 case 代码块中:

workout) scene_workout ;;

可用音箱

bash
ALL_SPEAKERS=(Computer Andys M5 Macbook Sonos Move Living Room TV)

你可以添加任何 AirPlay 音箱——只需它们在 Airfoil 中可见即可。



🐛 故障排除

❌ 音箱无法连接

检查 1: Airfoil 是否在运行?
bash
pgrep -x Airfoil || echo Airfoil 未运行!

检查 2: 音箱是否在网络中?

  • - 打开 Airfoil 应用
  • 检查音箱是否出现在列表中
  • 尝试手动连接

检查 3: 名称是否完全正确?

  • - 音箱名称区分大小写!
  • 打开 Airfoil 并复制确切的名称



❌ 没有声音

检查 1: Spotify 是否在播放?
bash
~/clawd/skills/spotify-applescript/spotify.sh status

检查 2: Airfoil 音源是否正确?

  • - 打开 Airfoil
  • 检查是否选择了 Spotify 作为音频源
  • 如果没有:点击 Source → 选择 Spotify

检查 3: 音箱音量?
bash

手动检查音量


osascript -e tell application Airfoil to get volume of (first speaker whose name is Sonos Move)


❌ Spotify 无法启动

Spotify 是否已打开?
bash
pgrep -x Spotify || open -a Spotify

spotify-applescript 是否已安装?
bash
ls ~/clawd/skills/spotify-applescript/spotify.sh



❌ 权限被拒绝

bash
chmod +x ~/clawd/skills/home-music/home-music.sh



🔊 直接 Airfoil 命令

如果你想手动控制 Airfoil:

bash

连接音箱


osascript -e tell application Airfoil to connect to (first speaker whose name is Sonos Move)

设置音箱音量 (0.0 - 1.0)

osascript -e tell application Airfoil to set (volume of (first speaker whose name is Sonos Move)) to 0.5

断开音箱

osascript -e tell application Airfoil to disconnect from (first speaker whose name is Sonos Move)

列出已连接音箱

osascript -e tell application Airfoil to get name of every speaker whose connected is true

设置音频源

osascript -e tell application Airfoil set theSource to (first application source whose name contains Spotify) set current audio source to theSource end tell

📁 文件

skills/home-music/
├── SKILL.md # 本文档
└── home-music.sh # 主脚本



💡 专业技巧

  1. 1. 设置别名 以便更快访问:
bash alias mm=home-music morning alias mp=home-music party alias mc=home-music chill alias mo=home-music off
  1. 2. 与 Clawdbot 配合使用:
> 嘿,启动派对模式 > 放点放松的音乐 > 停止音乐

3

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 home-music-1776388205 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 home-music-1776388205 技能

通过命令行安装

skillhub install home-music-1776388205

下载

⬇ 下载 home-music v1.0.0(免费)

文件大小: 5.63 KB | 发布时间: 2026-4-17 14:24

v1.0.0 最新 2026-4-17 14:24
Initial release - Whole-house music scenes with Spotify + Airfoil

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部