Skip to content

Commit

Permalink
v1.45
Browse files Browse the repository at this point in the history
  • Loading branch information
EnhancedJax committed Oct 24, 2021
1 parent 4b54a45 commit 579e853
Show file tree
Hide file tree
Showing 38 changed files with 310 additions and 18 deletions.
2 changes: 1 addition & 1 deletion @Resources/Act.inc
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ Total=0
14Icon=
15Name=
15Action=
15Icon=
15Icon=
2 changes: 1 addition & 1 deletion @Resources/Actions/Hotkeys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ Key13InString=
Key14=
Key14InString=
Key15=
Key15InString=
Key15InString=
Binary file removed @Resources/IconCache/#CoreHome_lnk.png
Binary file not shown.
Binary file removed @Resources/IconCache/Badlion Client_lnk.png
Binary file not shown.
Binary file removed @Resources/IconCache/Discord_lnk.png
Binary file not shown.
Binary file removed @Resources/IconCache/Edge_lnk.png
Binary file not shown.
Binary file removed @Resources/IconCache/GIMP 2.10.24_lnk.png
Binary file not shown.
Binary file removed @Resources/IconCache/GitHub Desktop_lnk.png
Binary file not shown.
Binary file removed @Resources/IconCache/Google Chrome_lnk.png
Binary file not shown.
Binary file removed @Resources/IconCache/JaxCore_lnk.png
Binary file not shown.
Binary file removed @Resources/IconCache/Microsoft Edge_lnk.png
Binary file not shown.
Binary file removed @Resources/IconCache/Notion Enhanced_lnk.png
Binary file not shown.
Binary file removed @Resources/IconCache/Notion Setup 2.0.16_exe.png
Binary file not shown.
Binary file removed @Resources/IconCache/Notion_exe.png
Binary file not shown.
Binary file removed @Resources/IconCache/Notion_lnk.png
Binary file not shown.
Binary file removed @Resources/IconCache/PaintDotNet_exe.png
Binary file not shown.
Binary file removed @Resources/IconCache/Process Hacker_lnk.png
Binary file not shown.
Binary file removed @Resources/IconCache/Registry Editor_lnk.png
Binary file not shown.
Binary file removed @Resources/IconCache/Spotify_Lnk.png
Binary file not shown.
Binary file removed @Resources/IconCache/Sublime Text 3_lnk.png
Binary file not shown.
Binary file removed @Resources/IconCache/Terminal_lnk.png
Binary file not shown.
Binary file removed @Resources/IconCache/Vscode_lnk.png
Binary file not shown.
Binary file removed @Resources/IconCache/WPS Office_lnk.png
Binary file not shown.
Binary file removed @Resources/IconCache/Xodo_lnk.png
Binary file not shown.
Binary file removed @Resources/IconCache/folder_png.png
Binary file not shown.
Binary file removed @Resources/IconCache/msedge_exe.png
Binary file not shown.
4 changes: 2 additions & 2 deletions @Resources/Vars.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ ExecuteAt=1
LaunchAt=1
Caps=1

AniStyle=Expand
AniStyle=Center
GlobalFont=Atami Stencil

UpdateRate=0
ShowAni=1
FontSizeModifier=2

LongDelay=1000
LongDelay=800
ShortDelay=500
2 changes: 1 addition & 1 deletion @Resources/Version.inc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[variables]
Version=1.4
Version=1.45
274 changes: 274 additions & 0 deletions Core/GenKeylaunchKey.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
function Initialize()
t = tonumber(SKIN:GetVariable('Total'))
saveLocation = SKIN:GetVariable('Sec.SaveLocation')
root = SKIN:GetVariable('ROOTCONFIGPATH')
skinroot = SKIN:GetVariable('SKINSPATH')..SKIN:GetVariable('Skin.Name')..'\\'
if t == nil then print("ERROR, CONTACT DEVELOPER FOR MORE INFORMATION")
elseif t >= 1 then
for i=1,t do
_G["Name"..i] = SKIN:GetVariable(i..'Name')
_G["Action"..i] = SKIN:GetVariable(i..'Action')
_G["Icon"..i] = SKIN:GetVariable(i..'Icon')
_G["Key"..i] = SKIN:GetVariable('Key'..i)
_G["KeyS"..i] = SKIN:GetVariable('Key'..i..'InString')
end
elseif t == 0 then
print('Blank canvas. Writing data right now.')
Add()
end

if tonumber(SKIN:GetVariable('Sec.ForceWriteVariables')) == 1 then
print('Force-Writing')
local t1 = t
local t2 = t + 2
local t3 = t + 3

Write(t1, t2, t3)
SKIN:Bang('!WriteKeyValue', 'Variables', 'Sec.ForceWriteVariables', '0', skinroot..'Core\\General.inc')
SKIN:Bang('!UpdateMeasure', 'Auto_Refresh:M')
SKIN:Bang('!Refresh')
end

local tryGetIndex = SKIN:GetVariable('Sec.Num')
if tryGetIndex then cacheIndex = tryGetIndex end
end

function Edit(round, parm1, parm2, parm3, parm4)
if round == 0 then
cacheIndex = parm2:gsub('^EditButton', '')
if parm1 == 0 then
-- SKIN:Bang('!CommandMeasure', 'Choose:M', 'ChooseFile 1')
SKIN:Bang('!WriteKeyvalue', 'Variables', 'Sec.Num', cacheIndex, root..'\\Accessories\\Action\\Main.ini')
SKIN:Bang('!WriteKeyvalue', 'Variables', 'Sec.Variant', 'Keylaunch', root..'\\Accessories\\Action\\Main.ini')
SKIN:Bang('!ActivateConfig', '#JaxCore\\Accessories\\Action')
SKIN:Bang('!Update', '#JaxCore\\Accessories\\Action')
SKIN:Bang('!Move', '(#CURRENTCONFIGX#+#CURRENTCONFIGWIDTH#/2-500/2)', '(#CURRENTCONFIGY#+#CURRENTCONFIGHEIGHT#/2-500/2)', '#JaxCore\\Accessories\\Action')
-- elseif parm1 == 1 then
-- SKIN:Bang('!CommandMeasure', 'Choose:M', 'ChooseFolder 1')
else
print('error')
end
else
-- local parm3 = parm3:gsub('%.', '_')
SKIN:Bang('!WriteKeyValue', 'Variables', cacheIndex..'Name', parm1, saveLocation)
SKIN:Bang('!WriteKeyValue', 'Variables', cacheIndex..'Action', '["'..parm2..'"]', saveLocation)
SKIN:Bang('!WriteKeyValue', 'Variables', cacheIndex..'Icon', parm3..'_'..parm4, saveLocation)
SKIN:Bang('!Refresh', '#JaxCore\\Accessories\\Action')
-- SKIN:Bang('!UpdateMeasure', 'Auto_Refresh:M')
-- SKIN:Bang('!Refresh')
end
end

function Add()
local t1 = t + 1
local t2 = t + 2
local t3 = t + 3

Write(t1, t2, t3)
SKIN:Bang('!Refresh')
end

function Remove(initSelection, startingIndex)
if toggleDelete == nil then toggleDelete = 0 end
if initSelection == 1 and toggleDelete == 0 then
toggleDelete = 1
SKIN:Bang('!SetOptionGroup', 'ActionButton', 'Text', '[\\xF78A]')
SKIN:Bang('!SetOptionGroup', 'ActionButtonShape', 'MeterStyle', 'Set.Button:S | Sec.Delete:S')
SKIN:Bang('!SetOptionGroup', 'ActionButtonShape', 'Fill', 'Fill Color 255,0,0,100')
SKIN:Bang('!UpdateMeterGroup', 'Actions')
SKIN:Bang('!Redraw')
elseif initSelection == 1 and toggleDelete == 1 then
toggleDelete = 0
SKIN:Bang('!SetOptionGroup', 'ActionButton', 'Text', '[\\xE70F]')
SKIN:Bang('!SetOptionGroup', 'ActionButtonShape', 'MeterStyle', 'Set.Button:S | Sec.Edit:S')
SKIN:Bang('!SetOptionGroup', 'ActionButtonShape', 'Fill', 'Fill Color 0,255,50,100')
SKIN:Bang('!UpdateMeterGroup', 'Actions')
SKIN:Bang('!Redraw')
elseif initSelection == 0 then
startingIndex = startingIndex:gsub('^EditButton', '')
for i=startingIndex,(t-1) do
local nextIndex = i + 1
local HotkeyFile = SKIN:GetVariable('SKINSPATH')..'Keylaunch\\@Resources\\Actions\\Hotkeys.ini'
SKIN:Bang('!WriteKeyValue', 'Variables', i..'Name', _G["Name"..nextIndex], saveLocation)
SKIN:Bang('!WriteKeyValue', 'Variables', i..'Action', _G["Action"..nextIndex], saveLocation)
SKIN:Bang('!WriteKeyValue', 'Variables', i..'Icon', _G["Icon"..nextIndex], saveLocation)
SKIN:Bang('!WriteKeyValue', 'Variables', 'Key'..i, _G["Key"..nextIndex], HotkeyFile)
SKIN:Bang('!WriteKeyValue', 'Variables', 'Key'..i..'InString', _G["KeyS"..nextIndex], HotkeyFile)
end
SKIN:Bang('!WriteKeyValue', 'Variables', 'Total', (t-1), saveLocation)
SKIN:Bang('!WriteKeyValue', 'Variables', 'Sec.ForceWriteVariables', '1', skinroot..'Core\\General.inc')
SKIN:Bang('!Refresh')
-- local t1 = t - 1
-- local t2 = t + 2
-- local t3 = t + 3

-- Write(t1, t2, t3)
-- SKIN:Bang('!Refresh')
end
end

function Write(t1, t2, t3)
-- -------------------------------------------------------------------------- --
-- Write settings --
-- -------------------------------------------------------------------------- --
local File = io.open(SKIN:GetVariable('SKINSPATH')..'..\\CoreData\\Keylaunch\\Include.inc','w')
for i=1,t1 do
File:write(
'[Option'..i..']\n'
,'Meter=String\n'
,'Text=#'..i..'Name#\n'
,'MeterStyle=Set.String:S | Set.OptionName:S\n'
,'[Set.Div:'..i..']\n'
,'Meter=Shape\n'
,'MeterStyle=Set.Div:S\n'
)
end
File:write(
'[Option'..t2..']\n'
,'Meter=String\n'
,'Text=\n'
,'MeterStyle=Set.String:S | Set.OptionName:S\n'
)
for i=1,t1 do
File:write(
'[EditButton'..i..']\n'
,'Meter=Shape\n'
,'MeterStyle=Set.Button:S | Sec.Edit:S\n'
,'Y=([Option'..i..':Y]-#Set.P#+(-30/2+8)*[Set.S])\n'
,'Group=ActionButtonShape | Actions\n'

,'[EditIcon'..i..']\n'
,'Meter=String\n'
,'FontFace=Segoe MDL2 Assets\n'
,'X=(-15*[Set.S])R\n'
,'Y=(-15*[Set.S])R\n'
,'StringAlign=CenterCenter\n'
,'Text=[\\xE70F]\n'
,'Group=ActionButton | Actions\n'
,'MeterStyle=Set.String:S | Set.Value:S\n'

,'[ButtonString'..i..']\n'
,'Meter=Shape\n'
,'MeterStyle=Set.Button:S\n'
,'X=(#Set.W#-#Set.L#-#Set.P#*2-190*[Set.S])\n'
,'Shape=Rectangle 0,0,150,30,3,3 | StrokeWidth 0 | Extend Fill | Scale [Set.S],[Set.S],0,0\n'
,'Y=([Option'..i..':Y]-#Set.P#+(-30/2+8)*[Set.S])\n'
,'Act=[!CommandMeasure Func "startSide(\'Hotkey\', \''..i..'\')"]\n'

,'[Value'..i..']\n'
,'Meter=String\n'
,'Text=#Key'..i..'InString#\n'
,'MeterStyle=Set.String:S | Set.Value:S\n'
)
end
File:write(
'[Button'..t2..']\n'
,'Meter=Shape\n'
,'MeterStyle=Set.Button:S\n'
,'OverColor=0,255,50,150\n'
,'LeaveColor=0,255,50,100\n'
,'Y=([Option'..t2..':Y]-#Set.P#+(-30/2+8)*[Set.S])\n'
,'Act=[!CommandMeasure Script:M "Add()"]\n'
,'[Value'..t2..']\n'
,'Meter=String\n'
,'Text=Add an action\n'
,'StringAlign=CenterCenter\n'
,'X=(150*[Set.S]/2)r\n'
,'MeterStyle=Set.String:S | Set.Value:S\n'
,'[Button'..t3..']\n'
,'Meter=Shape\n'
,'X=(-235*[Set.S])r\n'
,'MeterStyle=Set.Button:S\n'
,'OverColor=255,0,50,150\n'
,'LeaveColor=255,0,50,100\n'
,'Y=([Option'..t2..':Y]-#Set.P#+(-30/2+8)*[Set.S])\n'
,'Act=[!CommandMeasure Script:M "Remove(1)"]\n'
,'[Value'..t3..']\n'
,'Meter=String\n'
,'Text=Remove...\n'
,'StringAlign=CenterCenter\n'
,'X=(150*[Set.S]/2)r\n'
,'MeterStyle=Set.String:S | Set.Value:S\n'
)
File:close()
-- -------------------------------------------------------------------------- --
-- write variables --
-- -------------------------------------------------------------------------- --
local File1 = io.open(SKIN:GetVariable('SKINSPATH')..'Keylaunch\\@Resources\\Act.inc','w')
File1:write(
'[Variables]\n'
,'Total='..t1..'\n'
)
if t1 > t then l = t else l = t1 end
for i=1,l do
File1:write(
''..i..'Name='.._G["Name"..i]..'\n'
,''..i..'Action='.._G["Action"..i]..'\n'
,''..i..'Icon='.._G["Icon"..i]..'\n'
)
end
if l == t then
File1:write(
''..t1..'Name=Blank\n'
,''..t1..'Action=["!Log Action_is_Blank"]\n'
,''..t1..'Icon=folder_png\n'
)
end
File1:close()
-- -------------------------------------------------------------------------- --
-- write ahk variables --
-- -------------------------------------------------------------------------- --
local File2 = io.open(SKIN:GetVariable('SKINSPATH')..'Keylaunch\\@Resources\\Actions\\Hotkeys.ini','w')
local rmpath = SKIN:GetVariable('RMPATH')
File2:write(
'[Variables]\n'
,'RMPATH='..rmpath..'\n'
)
for i=1,t do
File2:write(
'Key'..i..'='.._G["Key"..i]..'\n'
,'Key'..i..'InString='.._G["KeyS"..i]..'\n'
)
end
File2:write(
'Key'..t1..'=\n'
,'Key'..t1..'InString=Edit...\n'
)
File2:close()
-- -------------------------------------------------------------------------- --
-- write ahk --
-- -------------------------------------------------------------------------- --
local File3 = io.open(SKIN:GetVariable('SKINSPATH')..'..\\CoreData\\Keylaunch\\Keylaunch.ahk','w')
File3:write(
'#SingleInstance Force\n'
,'#NoTrayIcon\n'
)
for i=1,t1 do
File3:write(
'IniRead, Key'..i..', '..SKIN:GetVariable("SKINSPATH")..'Keylaunch\\@Resources\\Actions\\Hotkeys.ini, Variables, Key'..i..'\n'
)
end
for i=1,t1 do
File3:write(
'Try Hotkey, %Key'..i..'%, Action'..i..'\n'
)
end
File3:write(
'Return\n'
)
for i=1,t1 do
File3:write(
'Action'..i..':\n'
,'\tSendToReceiver('..i..')\n'
,'\tReturn\n'
)
end
File3:write(
'SendToReceiver(index)\n'
,'{\n'
,'\tIniRead, RainmeterPath, '..SKIN:GetVariable("SKINSPATH")..'Keylaunch\\@Resources\\Actions\\Hotkeys.ini, Variables, RMPATH\n'
,'\tRun "%RainmeterPath% "!CommandMEasure "Receiver:M" "Launch(%index%)" "Keylaunch\\Main" " "\n'
,'}\n'
)
File3:close()
end
20 changes: 19 additions & 1 deletion Core/General.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
Sec.SaveLocation=#SKINSPATH##Skin.Name#\@Resources\Act.inc
Sec.ForceWriteVariables=0

[DefaultStartActions]
Custom2=[!SetOption AnchorSuppli Y [AnchorSuppli:Y]][!UpdateMeter AnchorSuppli]
[ContentContainer]
MouseScrollDownAction=[!SetVariable Scroll "(Clamp(#Scroll#-50,Clamp(#Set.H#-#Set.P#*2-[AnchorSuppli:Y], -1000, 0),0))"][!UpdateMeter *][!Redraw]
MouseScrollUpAction=[!SetVariable Scroll "(Clamp(#Scroll#+50,Clamp(#Set.H#-#Set.P#*2-[AnchorSuppli:Y], -1000, 0),0))"][!UpdateMeter *][!Redraw]

[HotkeysTitle]
Meter=String
Text=List of actions (#Total#)
Expand All @@ -15,7 +21,7 @@ MeterStyle=Set.String:S | Set.OptionCat:S

[Script:M]
Measure=Script
ScriptFile=#@#Lua\GenKeylaunchKey.lua
ScriptFile="#SKINSPATH##Skin.name#\Core\GenKeylaunchKey.lua"

[CheckForDataFolder]
MEasure=Plugin
Expand Down Expand Up @@ -52,4 +58,16 @@ Act=[!CommandMeasure Script:M "Remove(0, '#CURRENTSECTION#')"]

@includeInclude=#SKINSPATH#..\CoreData\Keylaunch\Include.inc


; ---------------------------------------------------------------------------- ;
; Anchor ;
; ---------------------------------------------------------------------------- ;


[AnchorSuppli]
Meter=String
Container=ContentContainer
x=r
Y=R

@includeKeys=#SKINSPATH##Skin.Name#\@Resources\Actions\HotKeys.ini
6 changes: 3 additions & 3 deletions Launch/Main.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ OnRefreshAction=[!ZPos 2][!ClickThrough 1][!CommandMeasure LoadActions "Execute

[Variables]
@includevars=#@#Vars.inc
Sec.Name=JAXCORE
Sec.Icon=JaxCore_lnk
Sec.Action=["C:\Users\enhan\Desktop\JaxCore.lnk"]
Sec.Name=GITDESK
Sec.Icon=GitHub Desktop_lnk
Sec.Action=["C:\Users\enhan\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\GitHub Desktop.lnk"]

TweenNode1=0
TweenNode2=0
Expand Down
2 changes: 1 addition & 1 deletion Launch/Styles/Bottom.inc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ W=(32)
H=(32)
ImageAlpha=(255*(1-#TweenNode2#))
DynamicVariables=1
ImageName=#@#IconCache\#Sec.Icon#.png
ImageName=#SKINSPATH#..\CoreData\Keylaunch\IconCache\#Sec.Icon#.png

[String]
Meter=String
Expand Down
4 changes: 2 additions & 2 deletions Launch/Styles/Center.inc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ W=(300*#TweenNode1#)
H=(300*#TweenNode1#)
ImageAlpha=(50*(1-#TweenNode2#))
DynamicVariables=1
ImageName=#@#IconCache\#Sec.Icon#.png
ImageName=#SKINSPATH#..\CoreData\Keylaunch\IconCache\#Sec.Icon#.png

[Image]
MEter=Image
Expand All @@ -26,7 +26,7 @@ W=(256*#TweenNode1#)
H=(256*#TweenNode1#)
ImageAlpha=(255*(1-#TweenNode2#))
DynamicVariables=1
ImageName=#@#IconCache\#Sec.Icon#.png
ImageName=#SKINSPATH#..\CoreData\Keylaunch\IconCache\#Sec.Icon#.png

[String]
Meter=String
Expand Down
2 changes: 1 addition & 1 deletion Launch/Styles/Expand.inc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ W=(350*#TweenNode1#)
H=(350*#TweenNode1#)
ImageAlpha=(50*(#TweenNode1#))
DynamicVariables=1
ImageName=#@#IconCache\#Sec.Icon#.png
ImageName=#SKINSPATH#..\CoreData\Keylaunch\IconCache\#Sec.Icon#.png

[String]
Meter=String
Expand Down
Loading

0 comments on commit 579e853

Please sign in to comment.