cliamp-terminal-music-player
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecliamp Terminal Music Player
cliamp 终端音乐播放器
Skill by ara.so — Devtools Skills collection.
cliamp is a retro terminal music player inspired by Winamp. It plays local files (MP3, FLAC, WAV, OGG, AAC, ALAC, Opus, WMA), streams (HTTP, HLS, Icecast), podcasts, and integrates with Spotify, YouTube Music, SoundCloud, Bilibili, NetEase Cloud Music, Navidrome, Plex, and Jellyfin. Features include a spectrum visualizer, parametric EQ, playlist management, radio browser, and Lua plugin system.
由ara.so开发的技能——Devtools Skills 合集。
cliamp是一款受Winamp启发的复古终端音乐播放器。它支持播放本地文件(MP3、FLAC、WAV、OGG、AAC、ALAC、Opus、WMA)、流媒体(HTTP、HLS、Icecast)、播客,并可与Spotify、YouTube Music、SoundCloud、B站、网易云音乐、Navidrome、Plex、Jellyfin集成。功能包括频谱可视化器、参数均衡器、播放列表管理、广播浏览器和Lua插件系统。
Installation
安装
Quick Install (macOS/Linux)
快速安装(macOS/Linux)
bash
curl -fsSL https://raw.githubusercontent.com/bjarneo/cliamp/HEAD/install.sh | shbash
curl -fsSL https://raw.githubusercontent.com/bjarneo/cliamp/HEAD/install.sh | shHomebrew (macOS)
Homebrew(macOS)
bash
brew install bjarneo/cliamp/cliampThe Homebrew formula automatically installs all required codec libraries (FLAC, Vorbis, Ogg).
bash
brew install bjarneo/cliamp/cliampHomebrew公式会自动安装所有必需的编解码器库(FLAC、Vorbis、Ogg)。
Arch Linux (AUR)
Arch Linux(AUR)
bash
yay -S cliampbash
yay -S cliampFrom Source
从源码安装
Prerequisites:
- Go 1.25.5 or later
- Linux: ALSA development headers (on Debian/Ubuntu,
libasound2-devon Fedora,alsa-lib-develon Arch)alsa-lib
bash
git clone https://github.com/bjarneo/cliamp.git
cd cliamp
make && make installOr without Make:
bash
go build -o cliamp .前置依赖:
- Go 1.25.5或更高版本
- Linux:ALSA开发头文件(Debian/Ubuntu为,Fedora为
libasound2-dev,Arch为alsa-lib-devel)alsa-lib
bash
git clone https://github.com/bjarneo/cliamp.git
cd cliamp
make && make install或不使用Make:
bash
go build -o cliamp .Optional Runtime Dependencies
可选运行时依赖
Install these for extended format and streaming support:
bash
undefined安装以下依赖以获得扩展格式和流媒体支持:
bash
undefinedmacOS
macOS
brew install ffmpeg yt-dlp
brew install ffmpeg yt-dlp
Debian/Ubuntu
Debian/Ubuntu
sudo apt install ffmpeg yt-dlp
sudo apt install ffmpeg yt-dlp
Arch
Arch
sudo pacman -S ffmpeg yt-dlp
- **ffmpeg**: AAC, ALAC, Opus, WMA playback
- **yt-dlp**: YouTube, YouTube Music, SoundCloud, Bandcamp, Bilibili, NetEase Cloud Musicsudo pacman -S ffmpeg yt-dlp
- **ffmpeg**:支持AAC、ALAC、Opus、WMA播放
- **yt-dlp**:支持YouTube、YouTube Music、SoundCloud、Bandcamp、B站、网易云音乐Quick Start
快速开始
Basic Playback
基础播放
bash
undefinedbash
undefinedPlay a directory
播放目录
cliamp ~/Music
cliamp ~/Music
Play specific files
播放指定文件
cliamp *.mp3 *.flac
cliamp *.mp3 *.flac
Play a stream URL
播放流媒体URL
Play YouTube video/playlist
播放YouTube视频/播放列表
Play SoundCloud track
播放SoundCloud曲目
cliamp "https://soundcloud.com/artist/track"
undefinedcliamp "https://soundcloud.com/artist/track"
undefinedInteractive Setup Wizard
交互式设置向导
Configure remote providers (Navidrome, Plex, Jellyfin, Spotify, YouTube Music, NetEase Cloud Music):
bash
cliamp setupThe wizard validates connections and writes configuration to .
~/.config/cliamp/config.toml配置远程服务提供商(Navidrome、Plex、Jellyfin、Spotify、YouTube Music、网易云音乐):
bash
cliamp setup向导会验证连接并将配置写入。
~/.config/cliamp/config.tomlKey Commands
核心命令
Press in the player to see all keybindings.
Ctrl+K在播放器中按查看所有快捷键。
Ctrl+KNavigation & Playback
导航与播放
- /
Space: Play/PauseP - : Next track
N - : Previous track
Shift+N - : Stop
S - : Open radio browser
R - : Toggle lyrics view
L - : Toggle fullscreen mode
F - /
Q: QuitCtrl+C
- /
Space:播放/暂停P - :下一曲
N - :上一曲
Shift+N - :停止
S - :打开广播浏览器
R - :切换歌词视图
L - :切换全屏模式
F - /
Q:退出Ctrl+C
Volume & EQ
音量与均衡器
- /
+: Volume up/down- - : Mute/unmute
M - : Toggle equalizer
E - Arrow keys in EQ: Adjust frequency bands
- /
+:音量增加/降低- - :静音/取消静音
M - :切换均衡器
E - 均衡器中按方向键:调整频段
Playlist Management
播放列表管理
- : Add to playlist
A - : Remove from playlist
D - : Clear playlist
C - : Shuffle playlist
Shift+S - : Save playlist
Ctrl+S
- :添加到播放列表
A - :从播放列表移除
D - :清空播放列表
C - :随机播放
Shift+S - :保存播放列表
Ctrl+S
Visualizer
可视化器
- : Cycle visualizer modes (spectrum, bars, dots, etc.)
V - : Toggle visualizer display
B
- :切换可视化器模式(频谱、柱状图、点状图等)
V - :切换可视化器显示
B
Configuration
配置
Configuration file:
~/.config/cliamp/config.toml配置文件:
~/.config/cliamp/config.tomlBasic Configuration
基础配置
toml
[player]
volume = 80
shuffle = false
repeat = "none" # none, one, all
visualizer = "spectrum"
[ui]
theme = "winamp" # winamp, nord, dracula, gruvbox, catppuccin
show_spectrum = true
show_lyrics = true
[audio]
sample_rate = 44100
buffer_size = 4096toml
[player]
volume = 80
shuffle = false
repeat = "none" # none, one, all
visualizer = "spectrum"
[ui]
theme = "winamp" # winamp, nord, dracula, gruvbox, catppuccin
show_spectrum = true
show_lyrics = true
[audio]
sample_rate = 44100
buffer_size = 4096Spotify Integration
Spotify集成
toml
[spotify]
enabled = true
username = "${SPOTIFY_USERNAME}"toml
[spotify]
enabled = true
username = "${SPOTIFY_USERNAME}"Credentials stored separately, configured via 'cliamp setup'
凭证单独存储,通过'cliamp setup'配置
Run `cliamp setup` and select Spotify to authenticate. The wizard handles OAuth flow and stores credentials securely.
运行`cliamp setup`并选择Spotify进行认证。向导会处理OAuth流程并安全存储凭证。Navidrome Integration
Navidrome集成
toml
[navidrome]
enabled = true
server_url = "https://music.example.com"
username = "${NAVIDROME_USERNAME}"
password = "${NAVIDROME_PASSWORD}"toml
[navidrome]
enabled = true
server_url = "https://music.example.com"
username = "${NAVIDROME_USERNAME}"
password = "${NAVIDROME_PASSWORD}"Plex Integration
Plex集成
toml
[plex]
enabled = true
server_url = "https://plex.example.com:32400"
token = "${PLEX_TOKEN}"toml
[plex]
enabled = true
server_url = "https://plex.example.com:32400"
token = "${PLEX_TOKEN}"Jellyfin Integration
Jellyfin集成
toml
[jellyfin]
enabled = true
server_url = "https://jellyfin.example.com"
api_key = "${JELLYFIN_API_KEY}"
user_id = "${JELLYFIN_USER_ID}"toml
[jellyfin]
enabled = true
server_url = "https://jellyfin.example.com"
api_key = "${JELLYFIN_API_KEY}"
user_id = "${JELLYFIN_USER_ID}"YouTube Music Integration
YouTube Music集成
toml
[youtube_music]
enabled = truetoml
[youtube_music]
enabled = trueRequires yt-dlp and browser cookies
需要yt-dlp和浏览器Cookie
cookies_from_browser = "firefox" # chrome, firefox, safari, etc.
Extract cookies with yt-dlp:
```bash
yt-dlp --cookies-from-browser firefox --print cookies https://music.youtube.comcookies_from_browser = "firefox" # chrome, firefox, safari等
使用yt-dlp提取Cookie:
```bash
yt-dlp --cookies-from-browser firefox --print cookies https://music.youtube.comCustom Radio Stations
自定义广播电台
Create :
~/.config/cliamp/radios.tomltoml
[[stations]]
name = "Soma FM Groove Salad"
url = "https://somafm.com/groovesalad130.pls"
genre = "Ambient"
[[stations]]
name = "NTS Radio 1"
url = "https://stream-relay-geo.ntslive.net/stream"
genre = "Eclectic"
[[stations]]
name = "Jazz24"
url = "https://live.wostreaming.net/direct/ppm-jazz24aac-ibc1"
genre = "Jazz"创建:
~/.config/cliamp/radios.tomltoml
[[stations]]
name = "Soma FM Groove Salad"
url = "https://somafm.com/groovesalad130.pls"
genre = "Ambient"
[[stations]]
name = "NTS Radio 1"
url = "https://stream-relay-geo.ntslive.net/stream"
genre = "Eclectic"
[[stations]]
name = "Jazz24"
url = "https://live.wostreaming.net/direct/ppm-jazz24aac-ibc1"
genre = "Jazz"Playlist Management
播放列表管理
Save/Load Playlists
保存/加载播放列表
bash
undefinedbash
undefinedSave current playlist
保存当前播放列表
cliamp --save-playlist my-playlist.m3u
cliamp --save-playlist my-playlist.m3u
Load playlist
加载播放列表
cliamp --playlist ~/Music/playlists/favorites.m3u
cliamp --playlist ~/Music/playlists/favorites.m3u
Create M3U playlist manually
手动创建M3U播放列表
cat > my-playlist.m3u << EOF
#EXTM3U
#EXTINF:180,Artist - Song Title
/path/to/song.mp3
#EXTINF:240,Another Artist - Another Song
https://example.com/stream.mp3
EOF
cliamp --playlist my-playlist.m3u
undefinedcat > my-playlist.m3u << EOF
#EXTM3U
#EXTINF:180,Artist - Song Title
/path/to/song.mp3
#EXTINF:240,Another Artist - Another Song
https://example.com/stream.mp3
EOF
cliamp --playlist my-playlist.m3u
undefinedSupported Playlist Formats
支持的播放列表格式
- M3U / M3U8
- PLS
- Direct URLs (one per line)
- M3U / M3U8
- PLS
- 直接URL(每行一个)
Remote Control (IPC)
远程控制(IPC)
cliamp supports IPC commands when running in daemon mode:
bash
undefinedcliamp在守护进程模式下支持IPC命令:
bash
undefinedStart in headless daemon mode
以无头守护进程模式启动
cliamp --headless ~/Music
cliamp --headless ~/Music
Control from another terminal
在另一个终端中控制
cliamp ipc play
cliamp ipc pause
cliamp ipc next
cliamp ipc previous
cliamp ipc volume 75
cliamp ipc seek 30 # seek to 30 seconds
cliamp ipc status # get current track info
undefinedcliamp ipc play
cliamp ipc pause
cliamp ipc next
cliamp ipc previous
cliamp ipc volume 75
cliamp ipc seek 30 # 跳转到30秒位置
cliamp ipc status # 获取当前曲目信息
undefinedIPC in Scripts
脚本中的IPC
bash
#!/bin/bashbash
#!/bin/bashSkip to next track if current track is longer than 10 minutes
如果当前曲目时长超过10分钟则跳至下一曲
status=$(cliamp ipc status --json)
duration=$(echo "$status" | jq -r '.duration')
if [ "$duration" -gt 600 ]; then
cliamp ipc next
fi
undefinedstatus=$(cliamp ipc status --json)
duration=$(echo "$status" | jq -r '.duration')
if [ "$duration" -gt 600 ]; then
cliamp ipc next
fi
undefinedLua Plugins
Lua插件
cliamp supports Lua plugins for custom visualizers, audio effects, and UI extensions.
cliamp支持Lua插件,用于自定义可视化器、音频效果和UI扩展。
Plugin Directory Structure
插件目录结构
~/.config/cliamp/plugins/
└── my-plugin/
├── plugin.lua
└── config.toml (optional)~/.config/cliamp/plugins/
└── my-plugin/
├── plugin.lua
└── config.toml(可选)Example Plugin: Custom Visualizer
示例插件:自定义可视化器
~/.config/cliamp/plugins/pulse-visualizer/plugin.lualua
-- Plugin metadata
plugin = {
name = "Pulse Visualizer",
version = "1.0.0",
author = "Your Name",
description = "Pulsing circle visualizer"
}
-- Called on each audio frame
function on_audio_frame(samples, sample_rate)
-- samples: table of audio samples [-1.0, 1.0]
-- sample_rate: integer
local sum = 0
for i, sample in ipairs(samples) do
sum = sum + math.abs(sample)
end
local avg = sum / #samples
local radius = math.floor(avg * 50)
-- Return render data
return {
type = "circle",
x = 40,
y = 12,
radius = radius,
color = {r = 255, g = 100, b = 200}
}
end
-- Called when plugin loads
function on_load()
print("Pulse Visualizer loaded")
end
-- Called when plugin unloads
function on_unload()
print("Pulse Visualizer unloaded")
end~/.config/cliamp/plugins/pulse-visualizer/plugin.lualua
-- 插件元数据
plugin = {
name = "Pulse Visualizer",
version = "1.0.0",
author = "Your Name",
description = "Pulsing circle visualizer"
}
-- 每个音频帧时调用
function on_audio_frame(samples, sample_rate)
-- samples: 音频样本表 [-1.0, 1.0]
-- sample_rate: 整数
local sum = 0
for i, sample in ipairs(samples) do
sum = sum + math.abs(sample)
end
local avg = sum / #samples
local radius = math.floor(avg * 50)
-- 返回渲染数据
return {
type = "circle",
x = 40,
y = 12,
radius = radius,
color = {r = 255, g = 100, b = 200}
}
end
-- 插件加载时调用
function on_load()
print("Pulse Visualizer loaded")
end
-- 插件卸载时调用
function on_unload()
print("Pulse Visualizer unloaded")
endEnable Plugin
启用插件
Add to :
~/.config/cliamp/config.tomltoml
[plugins]
enabled = ["pulse-visualizer"]添加到:
~/.config/cliamp/config.tomltoml
[plugins]
enabled = ["pulse-visualizer"]Plugin API Reference
插件API参考
Available Lua functions:
lua
-- Audio data
on_audio_frame(samples, sample_rate)
-- Track events
on_track_change(track) -- track: {title, artist, album, duration}
on_play()
on_pause()
on_stop()
-- Lifecycle
on_load()
on_unload()
-- Drawing functions (available in plugin context)
draw_text(x, y, text, color)
draw_rect(x, y, width, height, color)
draw_circle(x, y, radius, color)
draw_line(x1, y1, x2, y2, color)
-- Utility functions
log(message)
get_config(key) -- Read plugin config.toml
http_get(url) -- Simple HTTP request可用Lua函数:
lua
-- 音频数据
on_audio_frame(samples, sample_rate)
-- 曲目事件
on_track_change(track) -- track: {title, artist, album, duration}
on_play()
on_pause()
on_stop()
-- 生命周期
on_load()
on_unload()
-- 绘图函数(在插件上下文可用)
draw_text(x, y, text, color)
draw_rect(x, y, width, height, color)
draw_circle(x, y, radius, color)
draw_line(x1, y1, x2, y2, color)
-- 工具函数
log(message)
get_config(key) -- 读取插件config.toml
http_get(url) -- 简单HTTP请求Community Plugins
社区插件
- Soap Bubbles Visualizer: https://github.com/bjarneo/cliamp-plugin-soap-bubbles
Install community plugins:
bash
cd ~/.config/cliamp/plugins/
git clone https://github.com/bjarneo/cliamp-plugin-soap-bubbles.git soap-bubblesEnable in config:
toml
[plugins]
enabled = ["soap-bubbles"]- Soap Bubbles Visualizer:https://github.com/bjarneo/cliamp-plugin-soap-bubbles
安装社区插件:
bash
cd ~/.config/cliamp/plugins/
git clone https://github.com/bjarneo/cliamp-plugin-soap-bubbles.git soap-bubbles在配置中启用:
toml
[plugins]
enabled = ["soap-bubbles"]SSH Streaming
SSH流媒体
Stream audio from a remote server to your local machine:
bash
undefined将音频从远程服务器流式传输到本地机器:
bash
undefinedOn remote server, start cliamp in headless mode
在远程服务器上,以无头模式启动cliamp
cliamp --headless --http-server 0.0.0.0:8080 ~/Music
cliamp --headless --http-server 0.0.0.0:8080 ~/Music
On local machine, forward port and play
在本地机器上,转发端口并播放
ssh -L 8080:localhost:8080 user@remote-server
cliamp http://localhost:8080/stream
undefinedssh -L 8080:localhost:8080 user@remote-server
cliamp http://localhost:8080/stream
undefinedAdvanced Usage
高级用法
Custom Audio Quality
自定义音频质量
bash
undefinedbash
undefinedHigh quality playback
高质量播放
cliamp --sample-rate 96000 --buffer-size 8192 ~/Music
cliamp --sample-rate 96000 --buffer-size 8192 ~/Music
Low latency (smaller buffer)
低延迟(更小缓冲区)
cliamp --buffer-size 2048 ~/Music
undefinedcliamp --buffer-size 2048 ~/Music
undefinedBatch Processing with Shell Scripts
Shell脚本批量处理
bash
#!/bin/bashbash
#!/bin/bashPlay all albums in directory sequentially
按顺序播放目录中的所有专辑
for album_dir in ~/Music/*/; do
echo "Playing: $album_dir"
cliamp "$album_dir"
done
undefinedfor album_dir in ~/Music/*/; do
echo "正在播放: $album_dir"
cliamp "$album_dir"
done
undefinedIntegration with System Media Controls (Linux)
与系统媒体控制集成(Linux)
Enable MPRIS support to control cliamp with media keys:
toml
[player]
mpris = trueControl with playerctl:
bash
playerctl -p cliamp play-pause
playerctl -p cliamp next
playerctl -p cliamp previous启用MPRIS支持以使用媒体键控制cliamp:
toml
[player]
mpris = true使用playerctl控制:
bash
playerctl -p cliamp play-pause
playerctl -p cliamp next
playerctl -p cliamp previousNow-Playing Display (Quickshell)
正在播放显示(Quickshell)
Example Quickshell widget configuration for displaying currently playing track:
qml
// ~/.config/quickshell/nowplaying.qml
import Quickshell
import Quickshell.Services.Mpris
MprisPlayer {
player: "cliamp"
Text {
text: player.metadata.title + " - " + player.metadata.artist
font.pointSize: 12
}
}用于显示当前播放曲目的Quickshell小部件配置示例:
qml
// ~/.config/quickshell/nowplaying.qml
import Quickshell
import Quickshell.Services.Mpris
MprisPlayer {
player: "cliamp"
Text {
text: player.metadata.title + " - " + player.metadata.artist
font.pointSize: 12
}
}Troubleshooting
故障排除
No Audio Output (Silence)
无音频输出(静音)
On Linux with PipeWire or PulseAudio, install the ALSA bridge:
bash
undefined在使用PipeWire或PulseAudio的Linux系统上,安装ALSA桥:
bash
undefinedPipeWire (Arch)
PipeWire(Arch)
sudo pacman -S pipewire-alsa
sudo pacman -S pipewire-alsa
PulseAudio (Arch)
PulseAudio(Arch)
sudo pacman -S pulseaudio-alsa
sudo pacman -S pulseaudio-alsa
PipeWire (Debian/Ubuntu)
PipeWire(Debian/Ubuntu)
sudo apt install pipewire-alsa
sudo apt install pipewire-alsa
PulseAudio (Debian/Ubuntu)
PulseAudio(Debian/Ubuntu)
sudo apt install pulseaudio-alsa
undefinedsudo apt install pulseaudio-alsa
undefined"Library not loaded" on macOS
macOS上出现“Library not loaded”错误
If you downloaded pre-built binaries directly (not via Homebrew):
bash
brew install flac libvorbis liboggOr install via Homebrew to avoid this:
bash
brew install bjarneo/cliamp/cliamp如果直接下载预编译二进制文件(未通过Homebrew安装):
bash
brew install flac libvorbis libogg或通过Homebrew安装以避免此问题:
bash
brew install bjarneo/cliamp/cliampYouTube/SoundCloud Not Playing
YouTube/SoundCloud无法播放
Ensure yt-dlp is installed and up-to-date:
bash
undefined确保yt-dlp已安装并更新至最新版本:
bash
undefinedUpdate yt-dlp
更新yt-dlp
pip install --upgrade yt-dlp
pip install --upgrade yt-dlp
or
或
brew upgrade yt-dlp
brew upgrade yt-dlp
Test yt-dlp
测试yt-dlp
yt-dlp --version
undefinedyt-dlp --version
undefinedSpotify Authentication Failed
Spotify认证失败
Re-run setup wizard:
bash
cliamp setupSelect Spotify and follow the OAuth flow. Ensure your Spotify account is Premium (free accounts are not supported for streaming).
重新运行设置向导:
bash
cliamp setup选择Spotify并遵循OAuth流程。确保你的Spotify账户为Premium(免费账户不支持流媒体)。
High CPU Usage
CPU占用过高
Reduce visualizer complexity or disable it:
toml
[ui]
show_spectrum = falseOr use a lighter visualizer mode (press to cycle).
V降低可视化器复杂度或禁用它:
toml
[ui]
show_spectrum = false或使用更轻量的可视化器模式(按切换)。
VPlaylist Not Saving
播放列表无法保存
Ensure the directory exists and is writable:
bash
mkdir -p ~/.config/cliamp/playlists
cliamp --save-playlist ~/.config/cliamp/playlists/my-playlist.m3u确保目录存在且可写:
bash
mkdir -p ~/.config/cliamp/playlists
cliamp --save-playlist ~/.config/cliamp/playlists/my-playlist.m3uRemote Server Connection Issues
远程服务器连接问题
Check firewall rules and server URL:
bash
undefined检查防火墙规则和服务器URL:
bash
undefinedTest Navidrome connection
测试Navidrome连接
curl -u "${NAVIDROME_USERNAME}:${NAVIDROME_PASSWORD}"
"https://music.example.com/rest/ping.view?v=1.16.1&c=cliamp"
"https://music.example.com/rest/ping.view?v=1.16.1&c=cliamp"
curl -u "${NAVIDROME_USERNAME}:${NAVIDROME_PASSWORD}"
"https://music.example.com/rest/ping.view?v=1.16.1&c=cliamp"
"https://music.example.com/rest/ping.view?v=1.16.1&c=cliamp"
Test Plex connection
测试Plex连接
curl -H "X-Plex-Token: ${PLEX_TOKEN}"
"https://plex.example.com:32400/library/sections"
"https://plex.example.com:32400/library/sections"
curl -H "X-Plex-Token: ${PLEX_TOKEN}"
"https://plex.example.com:32400/library/sections"
"https://plex.example.com:32400/library/sections"
Test Jellyfin connection
测试Jellyfin连接
curl -H "X-Emby-Token: ${JELLYFIN_API_KEY}"
"https://jellyfin.example.com/Users/${JELLYFIN_USER_ID}"
"https://jellyfin.example.com/Users/${JELLYFIN_USER_ID}"
undefinedcurl -H "X-Emby-Token: ${JELLYFIN_API_KEY}"
"https://jellyfin.example.com/Users/${JELLYFIN_USER_ID}"
"https://jellyfin.example.com/Users/${JELLYFIN_USER_ID}"
undefinedCommon Patterns
常见使用模式
Daily Playlist Rotation
每日播放列表轮换
bash
#!/bin/bashbash
#!/bin/bashRotate through daily playlists
轮换每日播放列表
day=$(date +%u) # 1-7 for Mon-Sun
cliamp --playlist ~/.config/cliamp/playlists/day-${day}.m3u
undefinedday=$(date +%u) # 1-7对应周一至周日
cliamp --playlist ~/.config/cliamp/playlists/day-${day}.m3u
undefinedRandom Album Playback
随机专辑播放
bash
#!/bin/bashbash
#!/bin/bashPlay a random album from library
从音乐库中随机播放一张专辑
albums=(~/Music/*/)
random_album=${albums[$RANDOM % ${#albums[@]}]}
cliamp "$random_album"
undefinedalbums=(~/Music/*/)
random_album=${albums[$RANDOM % ${#albums[@]}]}
cliamp "$random_album"
undefinedStatus Bar Integration (i3/polybar)
状态栏集成(i3/polybar)
bash
#!/bin/bashbash
#!/bin/bashDisplay current track in status bar
在状态栏中显示当前曲目
status=$(cliamp ipc status --json 2>/dev/null)
if [ $? -eq 0 ]; then
title=$(echo "$status" | jq -r '.title // "N/A"')
artist=$(echo "$status" | jq -r '.artist // "N/A"')
echo "♫ $artist - $title"
else
echo ""
fi
undefinedstatus=$(cliamp ipc status --json 2>/dev/null)
if [ $? -eq 0 ]; then
title=$(echo "$status" | jq -r '.title // "N/A"')
artist=$(echo "$status" | jq -r '.artist // "N/A"')
echo "♫ $artist - $title"
else
echo ""
fi
undefinedAuto-Resume Last Playlist
自动恢复上次播放列表
Add to shell profile:
bash
undefined添加到shell配置文件:
bash
undefined~/.bashrc or ~/.zshrc
~/.bashrc 或 ~/.zshrc
alias music='cliamp --playlist ~/.config/cliamp/last-session.m3u'
alias music='cliamp --playlist ~/.config/cliamp/last-session.m3u'
Save on exit (add to cliamp config or wrapper script)
退出时保存(添加到cliamp配置或包装脚本)
trap 'cliamp ipc save-playlist ~/.config/cliamp/last-session.m3u' EXIT
This skill covers installation, configuration, CLI usage, plugin development, remote control, integrations, and troubleshooting for the cliamp terminal music player.trap 'cliamp ipc save-playlist ~/.config/cliamp/last-session.m3u' EXIT
本技能涵盖了cliamp终端音乐播放器的安装、配置、CLI使用、插件开发、远程控制、集成及故障排除等内容。