aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/playerctl_systray
blob: 559b48318b678ab3451b385452bbbd1ae9163848 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

BIN_PATH=~/.local/share/python-playerctl_systray/playerctl_systray
SCRIPT_PATH=~/.local/share/python-playerctl_systray/playerctl_systray.py
BIN_XAYMUP_PATH=~/.local/share/python-playerctl_systray/playerctl_systray_Xaymup
SCRIPT_XAYMUP_PATH=~/.local/share/python-playerctl_systray/playerctl_systray_Xaymup.py

if ! command -v playerctl >/dev/null 2>&1; then
    echo "playerctl is not installed but is required."
    notify-send "dependency missing:" "playerctl is required to run playerctl_systray." --urgency critical
    exit 1
fi

if [ -f "$BIN_XAYMUP_PATH" ]; then
    $BIN_XAYMUP_PATH
elif [ -f "$BIN_PATH" ]; then
    $BIN_PATH
elif [ -f "$SCRIPT_XAYMUP_PATH" ]; then
    python3 $SCRIPT_XAYMUP_PATH
elif [ -f "$SCRIPT_PATH" ]; then
    python3 $SCRIPT_PATH
else
    echo "playerctl_systray(.py) not found"
    notify-send "error!" "playerctl_systray(.py) not found" --urgency critical
fi