1 个不稳定版本

0.4.0 2022年7月23日

#percentage 中排名 #10

MIT 许可证

46KB
340

pw-volume

Basic interface to PipeWire volume controls

USAGE:
    pw-volume <SUBCOMMAND>

OPTIONS:
    -h, --help    Prints help information

SUBCOMMANDS:
    change    adjusts volume by decimal percentage, e.g. '+1%', '-0.5%'
    mute      mutes audio [possible values: on, off, toggle]
    status    get volume and mute information

示例用法

Sway

您可以使用 pw-volume 将多媒体键绑定到调节音量和静音。例如,在 Sway 的配置文件中

bindsym XF86AudioRaiseVolume exec "pw-volume change +2.5%; pkill -RTMIN+8 waybar"
bindsym XF86AudioLowerVolume exec "pw-volume change -2.5%; pkill -RTMIN+8 waybar"
bindsym XF86AudioMute exec "pw-volume mute toggle; pkill -RTMIN+8 waybar"

Waybar

"custom/pipewire": {
    "exec": "pw-volume status",
    "return-type": "json",
    "interval": "once",
    "signal": 8,
    "format": "{icon} {percentage}",
    "format-icons": {
        "mute": "",
        "default": ["󰕿", "󰖀", "󰕾"]
    }
},

依赖项

~1.4–2.3MB
~42K SLoC