aboutsummarylogtreecommitdiffstats
path: root/nwd-preexec.sh
blob: 19e97236f433c3fce1eeb00e9eac5ab716bc52a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
_precmd() {
    CURRENT_WS=$(i3-msg -t get_workspaces|jq -c '.[]| select(.focused)|.num')
    if [[ $NWD_FOCUSED_WS && $NWD_FOCUSED_WS -ne $CURRENT_WS ]]; then
        notify-send "$NWD_CMD" "Done @workspace=$NWD_FOCUSED_WS"
    fi

    NWD_FOCUSED_WS=
}

_preexec() {
    NWD_FOCUSED_WS=$(i3-msg -t get_workspaces|jq -c '.[]| select(.focused)|.num')
    NWD_CMD=$1
}

preexec_functions+=(_preexec)
precmd_functions+=(_precmd)