Can someone to examine this code and tell me if you see any problems? This code is tested for a KDE desktop. This seems to be most reliable method I've found through searching.

Code:
        printf "open window...\n"

        if [[ $(wmctrl -m | grep KWin) ]]; then     
             kdesu dolphin /var/log/VirusVault/  >/dev/null 2>&1 &
        fi

        if [[ $(wmctrl -m | grep GNOME) ]]; then     
             gnome-open /var/log/VirusVault/  >/dev/null 2>&1 &
        fi
        
        #xdg-open /var/log/VirusVault >/dev/null 2>&1 &
        printf "\n"