Skip to content

Commit 9031eed

Browse files
author
Kamran
committed
fixed setup for pulseaudio
1 parent c7ca4fa commit 9031eed

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

setup-piprayer.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ if [ $# -ne 0 ]; then
2626
AZAAN=$1
2727
fi
2828

29+
if [ -z "$XDG_RUNTIME_DIR" ]; then
30+
echo "XDG_RUNTIME_DIR variable not set. Please set the variable and run the setup again."
31+
exit 1
32+
fi
33+
2934
if [ ! -f "$CONF_FILE" ]; then
3035
echo "Configuration file $CONF_FILE not found"
3136
exit 1
@@ -46,11 +51,11 @@ for prayer in $PRAYER_TIMES; do
4651
PRAYER_TIME_H=$(echo "$prayer" | cut -f2 -d- | cut -f1 -d:)
4752
PRAYER_TIME_M=$(echo "$prayer" | cut -f2 -d- | cut -f2 -d:)
4853

49-
NEW_CRON="$NEW_CRON\n$PRAYER_TIME_M $PRAYER_TIME_H * * * $CURR_PATH/play-azaan.sh $AZAAN #$PRAYER_NAME"
54+
NEW_CRON="$NEW_CRON\n$PRAYER_TIME_M $PRAYER_TIME_H * * * export XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR && $CURR_PATH/play-azaan.sh $AZAAN #$PRAYER_NAME"
5055
done
5156

52-
NEW_CRON="$NEW_CRON\n0 1 * * * $CURR_PATH/$(basename "$0") $AZAAN"
53-
NEW_CRON="$NEW_CRON\n$CRON_BLOCK"
57+
NEW_CRON="$NEW_CRON\n0 1 * * * export XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR && $CURR_PATH/$(basename "$0") $AZAAN"
58+
NEW_CRON="$NEW_CRON\n$CRON_BLOCK\n"
5459

5560
#echo -e "$NEW_CRON"
5661

0 commit comments

Comments
 (0)