forked from Drugoy/Autohotkey-scripts-.ahk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVDesktops (win+shift+1230 to bind windows to desktops and win+1230 to switch).ahk
161 lines (137 loc) · 2.45 KB
/
VDesktops (win+shift+1230 to bind windows to desktops and win+1230 to switch).ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#SingleInstance,Force
#Persistent
ScriptName = VDesktops
ScriptVersion = 1.003
grupoactual = 0
changer = False
gosub Hide_Groups
SetTitleMatchMode 2
menu,Tray,add,Program Reload,ProgramReload
menu,Tray,add,Program Exit,ProgramExit
menu,tray,nostandard
menu,tray,tip,%ScriptName% V%scriptVersion%
return
ProgramReload:
GoSub Exiting
reload
ProgramExit:
GoSub Exiting
exitapp
#0::
Button0:
gosub MostraGrupos
grupoactual = 0
return
LWin & Right::
result:=mod(grupoactual+1,4)
gosub Button%result%
return
LWin & left::
result:=mod(grupoactual-1,4)
if(result=-1)
result=3
gosub Button%result%
return
#c::
if changer = false
{
changer = true
Gosub ShowChanger
return
}
changer = false
GoSub HideChanger
return
#1::
Button1:
GoSub,Hide_Groups
GrupoActual = 1
WinShow,ahk_group Grupo1
GroupActivate,Grupo1
return
+#1::
WinIdent:=WinExist("A")
GroupAdd,Grupo1,ahk_id %WinIdent%
WinGetTitle,WinTitle,ahk_id %WinIdent%
ToolTip =%WinTitle% -> Group 1
if GrupoActual != 1
gosub,Button%GrupoActual%
Gosub ToolTip
return
#2::
Button2:
GoSub,Hide_Groups
GrupoActual = 2
WinShow,ahk_group Grupo2
GroupActivate,Grupo2
return
+#2::
WinIdent:=WinExist("A")
GroupAdd,Grupo2,ahk_id %WinIdent%
WinGetTitle,WinTitle,ahk_id %WinIdent%
ToolTip =%WinTitle% -> Group 2
if GrupoActual != 2
gosub,Button%GrupoActual%
Gosub ToolTip
return
#3::
Button3:
GoSub,Hide_Groups
GrupoActual = 3
WinShow,ahk_group Grupo3
GroupActivate,Grupo3
return
+#3::
WinIdent:=WinExist("A")
GroupAdd,Grupo3,ahk_id %WinIdent%
WinGetTitle,WinTitle,ahk_id %WinIdent%
ToolTip =%WinTitle% -> Group 3
if GrupoActual != 3
gosub,Button%GrupoActual%
Gosub ToolTip
return
Hide_Groups:
loop 9
{
WinHide,ahk_group Grupo%A_Index%
}
return
MostraGrupos:
loop 9
{
WinShow,ahk_group Grupo%A_Index%
}
return
TOOLTIP:
ToolTip,%ToolTip%
SetTimer,ToolTipOFF,1000
Return
TOOLTIPOFF:
ToolTip,
SetTimer,ToolTipOFF,Off
Return
ShowChanger:
Gui,+ToolWindow +AlwaysOnTop -Disabled -SysMenu -Caption
Gui, Add, Button, x0 y0 w30 h30,1
Gui, Add, Button, x30 y0 w30 h30,2
Gui, Add, Button, x60 y0 w30 h30,3
Gui, Add, Button, x90 y0 w30 h30,0
Gui, Color, EEAAEE
Gui, +Lastfound ; Make the GUI window the last found window.
WinSet, TransColor, EEAAEE
SysGet,Monitor,MonitorWorkArea,1
MonitorBottom := MonitorBottom - 30
Gui, Show, x%MonitorLeft% y%MonitorBottom% h30 w120, JGPaiva
Return
HideChanger:
Gui,Destroy
return
GuiClose:
return
OnExit,Exiting
Exiting:
loop 9
{
WinShow,ahk_group Grupo%A_Index%
}
return