Skip to content

Instantly share code, notes, and snippets.

@ChildishGiant
Created June 18, 2021 20:31
Show Gist options
  • Save ChildishGiant/f751ea2860477eff819c8aa6f0c5e923 to your computer and use it in GitHub Desktop.
Save ChildishGiant/f751ea2860477eff819c8aa6f0c5e923 to your computer and use it in GitHub Desktop.
#!/bin/bash
status="$(wmctrl -m | grep "showing the desktop" | sed -r 's/(.*)(ON|OFF)/\2/g')"
if [ $status == "ON" ]; then
wmctrl -k off
else
wmctrl -k on
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment