I'm looking to raise the brightness when I maximize or foreground the Terminal window which has Vim running. I would like to reset the brightness to normal when I minimize or background that process as well.
I usually need more brightness when working with the black background of Vim than the white background of Chrome so I'd like it to happen automatically.
I use this to programatically decrease the brightness:
$ echo 1 | sudo tee /sys/class/backlight/acpi_video0/brightness Can I somehow hook into the minimize/maximize event of a GUI window and run the above as a script if the window is Terminal with Vim running?