私はALSAを使用しています。私は、サウンドが再生されている間、PCがサスペンドしないようにしたい。私は、画面ロッカーを実行するには、このbashのコードを使用して、suspendコマンド:現在、Linuxでサウンドが再生されていることを検出する方法はありますか?
私はその音や映像が再生さを検出し、停止するPCを防ぎたい# Run a screen locker.
#xautolock -time 5 -locker slimlock &
# Run suspend
#xautolock -time 6 -locker 'systemctl suspend' &
。例えば 擬似コード:
if (video is not played)
{
run a screen locker
}
if (sound is not played and video is not played)
{
run suspend command
}
音や映像が、コマンドラインユーティリティで遊んでいることを検出する方法は?
はhttp://unix.stackexchange.com/questions/61337/testing-from-a-script-if-audio-devices-are-in-silent – devnull