Last active
February 8, 2020 02:50
-
-
Save annalinneajohansson/095ca0b41d5c171cab8e to your computer and use it in GitHub Desktop.
Match the first character of $desktop
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 | |
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