Last active
October 8, 2023 08:50
-
-
Save bonnebulle/930c272b797715a54c366d0256223962 to your computer and use it in GitHub Desktop.
Close current app windows (linux)
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 | |
# DO Close all windows in current/active app | |
# USAGE Keyboard Shortcut Ctrl+Alt+W (like macOS) | |
# SOURCE https://www.tuxtips.info/linux/how-to-close-all-open-windows-in-linux ( close ALL) | |
# SOURCE https://unix.stackexchange.com/a/588813 ( search only current app ) | |
for n in $(xdotool search -class $(xdotool getactivewindow getwindowclassname) | awk $2 '!/-1/ {print $1}') | |
do | |
wmctrl -i -c $n; | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment