summarylogtreecommitdiffstats
path: root/krunner-mpd-git.install
blob: 766cf3a2b66b38a05b860c9e136e5a19d453dd34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
post_install() {
    echo "Run 'kquitapp5 krunner && kstart5 krunner' to restart krunner so it finds"
    echo "krunner-mpd (you may need to enable it in the krunner settings as well)."
}

post_upgrade() {
    # Kill the old instance so that krunner launches the new version

    local _pid_file='krunner-mpd.pid'
    local _pid_dir=$XDG_RUNTIME_DIR
    if [ -z "$_pid_dir" ]; then
        _pid_dir="/var/run/user/$(id -u)"
        if [ ! -f "$_pid_dir/$_pid_file" -a -n "$SUDO_UID" ]; then
            _pid_dir="/var/run/user/$SUDO_UID"
        fi
    fi

    if [ -f "$_pid_dir/$_pid_file" ]; then
        kill "$(cat "$_pid_dir/$_pid_file")"
    fi
}