summarylogtreecommitdiffstats
path: root/firefox-beta.sh
blob: 45ca64b1fa13bc2bb8eb07aa5b1a6d20d2422e5d (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
26
#!/bin/sh

# Set --class and --name argument if they are not provided

contains() {
    member="$1"
    shift
    for arg in "${@}"; do
        if [ "$arg" == "$member" ]; then
            return 0
        fi
    done
    return 1
}

args=("${@}")

if ! contains "--class" "${@}"; then
    args+=('--class' 'Firefox Beta')
fi

if ! contains "--name" "${@}"; then
    args+=('--name' 'Firefox Beta')
fi

exec /usr/lib/firefox-beta/firefox "${args[@]}"