Last active
August 10, 2016 07:41
-
-
Save hamrammi/f77465b56fb21dbd3698ea493822dab7 to your computer and use it in GitHub Desktop.
Ubuntu: Minimize all windows except active one
This file contains hidden or 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
#! /usr/bin/python | |
import gi | |
gi.require_version('Gtk', '3.0') | |
gi.require_version('Wnck', '3.0') | |
from gi.repository import Gtk, Wnck | |
screen = Wnck.Screen.get_default() | |
screen.force_update() | |
while Gtk.events_pending(): | |
Gtk.main_iteration() | |
windows = screen.get_windows() | |
active_app = screen.get_active_window().get_application() | |
for w in windows: | |
if not w.get_application() == active_app: | |
w.minimize() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The idea of using this script http://unix.stackexchange.com/questions/159334/focusing-the-current-window-minimizing-all-of-the-others