Skip to content

Commit db76e59

Browse files
committed
feat: add autohotkey to startup
1 parent 0392703 commit db76e59

12 files changed

+71
-35
lines changed

.vscode/extensions.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"johnpapa.vscode-peacock",
4+
"ms-vscode.powershell",
5+
"thqby.vscode-autohotkey2-lsp"
6+
]
7+
}

.vscode/settings.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@
1818
"titleBar.inactiveBackground": "#ff3d0099",
1919
"titleBar.inactiveForeground": "#e7e7e799"
2020
},
21-
"peacock.color": "#ff3d00"
22-
}
21+
"peacock.color": "#ff3d00",
22+
"files.insertFinalNewline": true,
23+
"files.trimFinalNewlines": true,
24+
"AutoHotkey2.InterpreterPath": "AutoHotkey.exe"
25+
}

bin/install.ps1

+27
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,30 @@ Function Copy-Config {
2121
}
2222
}
2323

24+
Function New-Shortcut {
25+
param (
26+
[Parameter(Mandatory = $true, Position = 0)]
27+
[string]$target,
28+
[Parameter(Mandatory = $true, Position = 1)]
29+
[string]$path
30+
)
31+
$WshShell = New-Object -ComObject WScript.Shell
32+
$Shortcut = $WshShell.CreateShortcut($target)
33+
$Shortcut.TargetPath = $path
34+
$Shortcut.Save()
35+
}
36+
37+
Function New-Startup-Shortcut {
38+
param (
39+
[Parameter(Mandatory = $true, Position = 0)]
40+
[string]$name,
41+
[Parameter(Mandatory = $true, Position = 1)]
42+
[string]$path
43+
)
44+
$startupPath = Join-Path -Path $env:APPDATA -ChildPath "Microsoft\Windows\Start Menu\Programs\Startup"
45+
New-Shortcut -target (Join-Path -Path $startupPath -ChildPath "$name.lnk") -path $path
46+
}
47+
2448
# Initial bootstrapping (scoop and other dependencies)
2549
function Invoke-Bootstrap {
2650
# Download bootstrap scripts from external repository
@@ -60,6 +84,9 @@ else {
6084
try {
6185
Invoke-Bootstrap
6286

87+
# automatically start AutoHotkey
88+
New-Startup-Shortcut -name "shortcuts_hotkeys" -path "$shortcutsDir\tools\AutoHotKey\hotkeys.cmd"
89+
6390
# Create Keypirinha default settings
6491
Copy-Config "config\keypirinha\portable\Profile" "$Env:USERPROFILE\scoop\apps\keypirinha\current\portable\Profile"
6592

config/AutoHotKey/_hotKeys.ahk

-30
This file was deleted.

links/AI - gemini.google.com.url

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[InternetShortcut]
2+
URL=https://gemini.google.com/

scoopfile.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"Source": "main"
2020
},
2121
{
22-
"Source": "extras",
23-
"Name": "windows-terminal"
22+
"Name": "windows-terminal",
23+
"Source": "extras"
2424
},
2525
{
2626
"Source": "extras",
@@ -33,6 +33,10 @@
3333
{
3434
"Source": "extras",
3535
"Name": "vscode"
36+
},
37+
{
38+
"Name": "autohotkey",
39+
"Source": "extras"
3640
}
3741
]
38-
}
42+
}

tools/AutoHotKey/hotKeys.ahk

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#Requires AutoHotkey v2.0
2+
3+
#c:: ; Hotkey Win + C to convert path to Windows or Unix
4+
{
5+
ClipWait(0.5)
6+
7+
; Convert anything to plain text
8+
A_Clipboard := A_Clipboard
9+
10+
if InStr(A_Clipboard, "\")
11+
{
12+
A_Clipboard := StrReplace(A_Clipboard, "\", "/")
13+
}
14+
else
15+
{
16+
A_Clipboard := StrReplace(A_Clipboard, "/", "\")
17+
}
18+
}

tools/AutoHotKey/hotkeys.cmd

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@echo off
2+
3+
set "THIS_DIR=%~dp0"
4+
AutoHotkey.exe "%THIS_DIR%hotkeys.ahk" || pause
5+
exit /b %ERRORLEVEL%
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)