This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FILE="$HOME/tmp.png" | |
PROGRAM="$(xprop -id $(xprop -root _NET_ACTIVE_WINDOW | cut -d ' ' -f 5) WM_CLASS | awk -F: 'BEGIN { FS="="; } {print $2}' | awk 'match($1,/[a-z-]+/) {print substr($1,RSTART,RLENGTH)}')" | |
GTKVERSION="$(ldd /usr/bin/$PROGRAM | grep libgtk | awk '{print $1;}' | tail -n1)" | |
SCRPROGRAM="gnome-screenshot $1 -e none -f $FILE" | |
REGEX="libgt(k|kd)-3*" | |
if [[ $GTKVERSION =~ $REGEX && $1 == "-w" ]] |