Close tab and tab stack on hover (AHK script)
-
I have different color for the close button:
Tab:
Tab Stack:
So I think why not use the different colors for tab and tab stack to close them on hover.
I change the "X" color to have a unique color of the square:
The code of AHK script for the tab stack is this , but the same you can use to close a tab:
#Persistent SendMode Input color := "0xFF8132" CoordMode, Pixel, Screen Loop { if WinActive("ahk_exe vivaldi.exe") { ;MouseGetPos, MouseX, MouseY ;PixelGetColor, thisColor, MouseX, MouseY Sleep, 100 If thisColor = color Send !k Else Sleep, 100 } Sleep, 500 continue }
ALT+k is the shortcut to the command chain for close tab stack.
-
Following the same color principle you can :
1.- SELECT A TAB ON HOVER: Color the entire tab on hover :
2.- SELECT A LINK ON HOVER :Color the links new and visited:
So with this AHK script you obtain ON HOVER :
1.- CLOSE TAB
2.- CLOSE TAB STACK
3.- SELECT TAB
4.- SELECT LINKS#Persistent SendMode Input color1 := "0x3281FF", color2 := "0x2281FF", ; Close Tab stack color3 := "0x820004", color4 := "0x830000", ; Close Tabs color5 := "0xa3a3a3", ; Select tabs color6 := "0x00ff00", color7 := "0x3f81ea", ; Links new and visited ; The tabs of first level has a little bit different close color from the second level, so you need 2 colors CoordMode, Pixel, Screen Loop { if WinActive("ahk_exe vivaldi.exe") { MouseGetPos, MouseX, MouseY PixelGetColor, thisColor, MouseX, MouseY, RGB Sleep, 250 PixelGetColor, thisColor2, MouseX, MouseY, RGB ; You need to hover for 250 milliseconds If ((thisColor2 = color1) or(thisColor2 = color2)) and (thisColor = thisColor2) and (MouseY < 150) Send !k ; Close Tab stack If ((thisColor2 = color3) or (thisColor2 = color4)) and (thisColor = thisColor2) and (MouseY < 150) Send !o ; Close Tabs If (thisColor2 = color5) and (thisColor = thisColor2) and (MouseY < 150) Click ; Select Tabs If ((thisColor2 = color6) or (thisColor2 = color7)) and (thisColor = thisColor2) Click ; Select links } Sleep, 500 continue }