aboutsummaryrefslogtreecommitdiff
path: root/bin/autostart
blob: e54c51c34574dc9ffe561b764283313e472cdd82 (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
27
28
29
#!/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 lxqt-policykit-agent
run_if_exists /usr/lib/kdeconnectd
run_if_exists kdeconnect-indicator
run_if_exists /usr/lib/geoclue-2.0/demos/agent
run_if_exists thunar --daemon

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"