Skip to content

Instantly share code, notes, and snippets.

@Gavinok
Last active July 6, 2020 23:34
Show Gist options
  • Save Gavinok/2b2a0ae9be2ff44fd709be1601fd88a9 to your computer and use it in GitHub Desktop.
Save Gavinok/2b2a0ae9be2ff44fd709be1601fd88a9 to your computer and use it in GitHub Desktop.
Collect urls from all surf windows in the current view.
WINDOWS=$(xprop -root | grep '^_NET_CLIENT_LIST(WINDOW).*' |sed -e 's/^.*# //' -e 's/, /\n/g')
echo "$WINDOWS" | while read window; do
if xprop -id $window | grep 'Surf' > /dev/null; then
xprop -id $window | grep '_SURF_URI(STRING) = ' | cut -d'"' -f 2
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment