distribution/packages/jelos/sources/scripts/say

22 lines
377 B
Bash
Executable file

#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2023-present Fewtarius (https://github.com/fewtarius)
. /etc/profile
AUDIOTEST=$(ps -ef | grep [p]ulseaudio)
if [ ! $? = 0 ]
then
PLAYCMD="aplay -q"
else
PLAYCMD="paplay"
fi
case $1 in
-b)
espeak --stdout "$(battery_percent)%" | ${PLAYCMD}
;;
*)
espeak --stdout "$*" | ${PLAYCMD}
;;
esac