Autorotate + Suspend change
This commit is contained in:
parent
d0fc98ca4f
commit
0eb1620a5a
4 changed files with 46 additions and 7 deletions
|
|
@ -1,7 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
# check if any player has status "Playing"
|
||||
playerctl -a status | pkgs.ripgrep Playing -q
|
||||
# only suspend if nothing is playing
|
||||
if [ $? == 1 ]; then
|
||||
bash -c $1
|
||||
set -e
|
||||
|
||||
# 1. Видео / музыка
|
||||
if playerctl -a status 2>/dev/null | rg -q Playing; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# 2. Звонки / микрофон
|
||||
if pactl list sources 2>/dev/null | rg -q "State: RUNNING"; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
bash -c "$1"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue