lightsOn icon indicating copy to clipboard operation
lightsOn copied to clipboard

Checks in isAppRunning look very repetitive - can this be shortened?

Open crhbetz opened this issue 9 years ago • 0 comments

Example:

    # Check if user want to detect VLC fullscreen.
    if [ $vlc_detection == 1 ]; then
        if [[ "$activ_win_title" = *vlc* ]]; then
            # Check if VLC is running.
            if [ "$(pidof -s vlc)" ]; then
                log "isAppRunning(): vlc fullscreen detected"
                return 1
            fi
        fi
    fi

    # Check if user want to detect Minitube fullscreen.
    if [ $minitube_detection == 1 ]; then
        if [[ "$activ_win_title" = *minitube* ]]; then
            # Check if Minitube is running.
            if [ "$(pidof -s minitube)" ]; then
                log "isAppRunning(): minitube fullscreen detected"
                return 1
            fi
        fi
    fi

Take care though, some look slightly different (when involving flash).

crhbetz avatar Jul 24 '15 10:07 crhbetz