#!/usr/bin/env bash WM_DESKTOP=$(xdotool getwindowfocus) if [[ $WM_DESKTOP == "4194404" ]] ; then echo "" else WM_CLASS=$(xprop -id "$WM_DESKTOP" WM_CLASS | awk 'NF {print $NF}' | sed 's/"//g') WM_NAME=$(xprop -id "$WM_DESKTOP" WM_NAME | cut -d '=' -f 2 | awk -F '"' '{print $2}') # filtering if [ "$WM_NAME" == "tmux" ] ; then echo "tmux" elif [ "$WM_CLASS" == "st-256color" ] ; then echo "st" elif [ "$WM_CLASS" == "Brave-browser" ] ; then echo "Brave" elif [ "$WM_CLASS" == "Spotify" ] ; then echo "Spotify" elif [ "$WM_CLASS" == "Zathura" ] ; then echo "Zathura" else echo "$WM_NAME" fi fi