I'm using i3 as my WM with a Dual-Head setup. I have already mapped some keys to switch between workspaces on one of the monitors (Mod+Keypad 1..8) and I would like to use the same keybindings on both monitors (each one has 8 workspaces).
Considering i3 cannot bind keys twice, I would instead use a script that detects the monitor, and sends the correct message through i3-msg. However, I need to know which monitor is focused to do this.
So, is there a way to get the name of the focused monitor in this scenario?