Skip to content

Instantly share code, notes, and snippets.

@annalinneajohansson
Last active February 8, 2020 02:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save annalinneajohansson/095ca0b41d5c171cab8e to your computer and use it in GitHub Desktop.
Save annalinneajohansson/095ca0b41d5c171cab8e to your computer and use it in GitHub Desktop.
Match the first character of $desktop
#!/bin/bash
desktops=$(wmctrl -d | awk '{ print $2":"$10 }')
for desktop in $desktops
do
# example output of $desktop: -Work or *Leisure
if [[ $(echo $desktop | cut -c1-1) = '*' ]]; then
echo $desktop | cut -c3-
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment