Last active
December 19, 2015 09:19
-
-
Save 0x4a/5932482 to your computer and use it in GitHub Desktop.
delay start of #dropbox, autohotkey and keepass until #truecrypt volume X:\ is mounted - compile this script and put in autostart, change paths accordingly #ahk #tool #system
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; truecrypt / dropbox delayed startup script | |
#Persistent | |
#include y:\0x4a\Code\AHK\lib\notify.ahk | |
#include y:\0x4a\Code\AHK\lib\Array.ahk | |
SetTimer, checkDrive, 5000 | |
return | |
checkDrive: | |
DriveGet, status, Status, y:\ | |
if (status = "Ready") | |
{ | |
toolDir = f: | |
notify_delay := 5000 | |
global runningFiles := Array() | |
global startedFiles := Array() | |
checkRun("c:\Users\Jekyll\AppData\Roaming\Dropbox\bin\Dropbox.exe", "/home") | |
checkRun("c:\Program Files\AutoHotkey\AutoHotkey.exe") | |
checkRun(toolDir . "\tools\control\KeePass\KeePass.exe") | |
checkRun("c:\Program Files\BitTorrent Sync\BTSync.exe") | |
; mount dropbox tc image?! | |
showStatus("started:", startedFiles, notify_delay) | |
showStatus("running:", runningFiles, notify_delay) | |
sleep %notify_delay%+50 | |
ExitApp | |
} | |
return | |
showStatus(text, array, delay) | |
{ | |
if array.MaxIndex() | |
{ | |
list := array.join("`n") | |
Notify(text, list, delay, "GC=D4D0C8 GR=0 BR=0 BW=2 TS=8 TF=segoe ui BK=005555 MC=000000 BC=000000") | |
} | |
} | |
checkRun(toolPath, param = "") | |
{ | |
SplitPath, toolPath, toolFile | |
Process, Exist, %toolFile% | |
If ErrorLevel > 0 | |
global runningFiles | |
runningFiles.append(toolFile) | |
Else | |
{ | |
Run, %toolPath% %param% | |
global startedFiles | |
startedFiles.append(toolFile) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment