#!/usr/bin/php
<?php

require __DIR__.'/base/block.php';

$volume = shell_exec('amixer get Master | grep Mono:');

if ($volume) {
    preg_match('/\[([0-9%]+)\]/', $volume, $mach);

    if (isset($mach[1])) {
        $v = (int) str_replace('%', '', $mach[1]);
        $fullText = ' '.$mach[1].' ';

        if ($v === 0) {
            $fullText.= emoji(0xf026);
        } elseif ($v < 50) {
            $fullText.= emoji(0xf027);
        } else {
            $fullText.= emoji(0xf028);
        }

        echo block(
            'volume',
            [
                'full_text' => $fullText,
                'color' => color('music'),
                'markup' => 'pango',
                'separator' => false,
                'separator_block_width' => 0,
            ]
        );
    }
}
Insertar
<div%key%id="gist-5c87c2f03db31-c401530fb73d9dbfe66cf53c65c3e87c3a2fa11f" class="gist-container"></div>
<script src="https://gist.deblan.org/es/embedjs/5c87c2f03db31" async></script>