0

I wrote a python file, which based on wmctrl output of the current window, changes the panel color. I want to bind this file to the Alt+Tab . I tried using system shortcuts but It disables the normal function of Alt+Tab. explaining this issue is kinda hard. consider sometimes you hold the Altkey , and press Tab key multiple times to switch to the desired window. I want right after releasing the Alt key , this python file to be run. I simply want to know, what is the complete command for Alt+Tab behavior (obviously I want a wmctrl syntax-based), then do something like :

sh -c "command 1; command 2"

which command 1 : is the command for Alt+Tab and command 2 : is something like : python3 file.py

please help me

NIMISHAN
  • 1,575
  • 4
  • 19
  • 28

1 Answers1

1

Look into dbus-monitor (https://dbus.freedesktop.org/doc/dbus-monitor.1.html). It is probably already installed on your system.

You could run dbus-monitor "interface=org.gnome.Shell.Introspect" as a service on your system. It will fire every time you press Alt-Tab:

signal time=1589208011.321827 sender=:1.54 -> destination=(null destination) serial=17043 path=/org/gnome/Shell/Introspect; interface=org.gnome.Shell.Introspect; member=RunningApplicationsChanged
method call time=1589208011.322378 sender=:1.44 -> destination=:1.54 serial=489 path=/org/gnome/Shell/Introspect; interface=org.gnome.Shell.Introspect; member=GetRunningApplications
Jos
  • 29,224