aboutsummaryrefslogtreecommitdiff
path: root/bin/autostart
blob: 5580f74056ff691e7e5510b3cb591c3311e1fc61 (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
#!/usr/bin/env bash

run_if_exists () {
    local prog="$1"
    if command -v "$prog" > /dev/null; then
        "$@" &
    fi
}

run_if_exists fcitx5 -d
run_if_exists dunst
run_if_exists udiskie -a -n -s --appindicator
run_if_exists clipmenud
run_if_exists lxqt-policykit-agent

if [ "$XDG_SESSION_TYPE" = x11 ]; then
    run_if_exists "$HOME/.fehbg"
fi

if [ "$XDG_SESSION_TYPE" = wayland ]; then
    run_if_exists gammastep \
            -l $(curl -s "https://location.services.mozilla.com/v1/geolocate?key=geoclue" | awk 'OFS=":" {print $3,$5}' | tr -d ',}') \
            -m wayland
fi

run_if_exists "$HOME/.local/autostart"