Skip to content

Instantly share code, notes, and snippets.

@javierarilos
Created July 28, 2015 10:31
Show Gist options
  • Save javierarilos/2ec0b532e8ddf4c1a820 to your computer and use it in GitHub Desktop.
Save javierarilos/2ec0b532e8ddf4c1a820 to your computer and use it in GitHub Desktop.
XFCE4 show desktop workspace when changing it.
#!/bin/bash
#Description: Using notify-send, pop-up the current workspace number when changing workspaces
#Requires: xfce4-notifyd, libnotify, wmctrl
CURRENT_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))
while true
do
sleep 1
NEW_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))
if [ $CURRENT_WORKSPACE -ne $NEW_WORKSPACE ]; then
notify-send -t 500 " workspace" "<b><span font='100'>$NEW_WORKSPACE</span></b>"
CURRENT_WORKSPACE=$NEW_WORKSPACE
fi
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment