Computer Science Mojo

~ David's Notes on coding, software and computer science


How to add a desktop notification when switching XFCE workspace

Category: Linux     Tag: XFCE  
By: David     On: Fri 22 May 2020     

When switching XFCE workspaces, theres no default notification that tells you which workspace you are on. I have a little script to get around it using wmctrl and notify-send.


  • Hook the script up with whatever event triggers swithing workspaces: eg. hot keys to go to the left or right workspace (do this manually)
  • The bash script takes either "left" or right" and would calculate what the next workspace would be when moving in that direction.
  • It Uses notify-send to send a small message to the upper right of the screen: Alt Text

link to script


# 0. add this file to /usr/local/bin/harry-xfce-workspace-switcher
# * Gesture switching using libinput
# 1. edit: ~/.config/libinput-gestures.conf
#   # Move between workspaces wrapped - left and right flipped for natural scrolling 
#   gesture swipe right 3 harry-xfce-workspace-switcher left 
#   gesture swipe left  3 harry-xfce-workspace-switcher right 
# * Keyboard switching with the hotkeys 
# 1. Go to Window Manager and disable the hot key switch 
# 2. Go to Keyboard and set up Application Shortcuts 
#   harry-libinput-workspace-switcher left
#   harry-libinput-workspace-switcher right