Skip to content

Instantly share code, notes, and snippets.

@2xlink
Created January 15, 2023 21:56
Show Gist options
  • Select an option

  • Save 2xlink/8a83d354305898b5c93b7d9f396efa72 to your computer and use it in GitHub Desktop.

Select an option

Save 2xlink/8a83d354305898b5c93b7d9f396efa72 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -eu
touch /tmp/current_desktop
last=$(cat /tmp/current_desktop)
wmctrl -d | grep "*" | cut -d " " -f 1 > /tmp/current_desktop
if [[ -z $last ]]; then
last=$(cat /tmp/current_desktop)
fi
wmctrl -s $last
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment