Skip to content

Commit 9390a5e

Browse files
committed
feat: provide install script
1 parent 04f367d commit 9390a5e

19 files changed

+207
-153
lines changed

.vscode/tasks.json

-26
This file was deleted.

README.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Shortcuts
2+
3+
## Complete Installation
4+
5+
If you just came here to install the Shortcuts, open a PowerShell terminal (version 5.1 or later) and run:
6+
7+
```powershell
8+
irm https://raw.githubusercontent.com/xxthunder/shortcuts/refs/heads/develop/bin/install.ps1 | iex
9+
```
10+
11+
The most important tool of Shortcuts is Keypirinha.
12+
It provides a fast and configurable way to open your favorite tools, links and URLs.
13+
It was started automatically after installation (you can see a *k*-icon in your taskbar's icon area).
14+
15+
> **Note:** Keyprinha can be used by hitting **Win+Alt+Space**.
16+
17+
In the small window that pops up you can search for any tool installed on your PC (e.g. type *word*) and some shortcuts we provide (e.g., type *SPL*).
18+
19+
> **Note:** A very important command is 'Refresh catalog', that commands Keypirinha to rescan your PC for new tools and shortcuts.
20+
21+
## Optional Installations
22+
23+
### PowerShell Core
24+
25+
PowerShell Core is the latest stable release of PowerShell maintained by its own community.
26+
It can be easily installed via scoop. Again open a PowerShell terminal and run:
27+
28+
```powershell
29+
scoop install pwsh
30+
```
31+
32+
## Update
33+
34+
When you already installed Shortcuts and you want to update to the latest version, you can just hit **Win+Alt+Space** and search for update.bat.
35+
36+
Another possibility for updating Shortcuts is to open a PowerShell terminal and run the install command again:
37+
38+
```powershell
39+
irm https://raw.githubusercontent.com/xxthunder/shortcuts/refs/heads/develop/bin/install.ps1 | iex
40+
```
41+
42+
After the update, hit **Win+Alt+Space** and search for 'Refresh catalog'.
43+
Execute this to update Keypirinha's catalog database.
44+
After a short time the new shortcuts are available.

bin/install.ps1

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<#
2+
.DESCRIPTION
3+
Installation of Shortcuts
4+
#>
5+
6+
param (
7+
[switch]$InPlace
8+
)
9+
10+
Function Copy-Config {
11+
param (
12+
[Parameter(Mandatory = $true, Position = 0)]
13+
[string]$target,
14+
[Parameter(Mandatory = $true, Position = 1)]
15+
[string]$source
16+
)
17+
robocopy $target $source /E /IS /IT
18+
if ($LASTEXITCODE -ge 8) {
19+
Write-Error "Copying '$source' failed"
20+
}
21+
}
22+
23+
# Initial bootstrapping (scoop and other dependencies)
24+
function Invoke-Bootstrap {
25+
# Download bootstrap scripts from external repository
26+
Invoke-RestMethod https://raw.githubusercontent.com/avengineers/bootstrap-installer/refs/tags/$bootstrap_git_tag/install.ps1 | Invoke-Expression
27+
# Execute bootstrap script
28+
. .\.bootstrap\bootstrap.ps1
29+
}
30+
31+
## start of script
32+
# Always set the $InformationPreference variable to "Continue" globally,
33+
# this way it gets printed on execution and continues execution afterwards.
34+
$InformationPreference = "Continue"
35+
36+
# Stop on first error
37+
$ErrorActionPreference = "Stop"
38+
39+
$repoUrl = "https://github.com/xxthunder/shortcuts.git"
40+
$shortcutsDir = "$Env:USERPROFILE\shortcuts"
41+
$branch = "develop"
42+
43+
$bootstrap_git_tag = "v1.14.0"
44+
45+
if (-not $InPlace) {
46+
# Load utility methods
47+
Invoke-RestMethod -Uri https://raw.githubusercontent.com/avengineers/bootstrap/refs/tags/$bootstrap_git_tag/utils.ps1 | Invoke-Expression
48+
49+
# Get the latest commit of this repository
50+
CloneOrPullGitRepo -RepoUrl $repoUrl -TargetDirectory $shortcutsDir -Branch $branch
51+
52+
Push-Location $shortcutsDir
53+
} else {
54+
# Run in place, no cloning
55+
Push-Location $PSScriptRoot.TrimEnd("\bin")
56+
}
57+
58+
try {
59+
Invoke-Bootstrap
60+
61+
# Create Keypirinha default settings
62+
Copy-Config "config\keypirinha\portable\Profile" "$Env:USERPROFILE\scoop\apps\keypirinha\current\portable\Profile"
63+
64+
# Create directory for private shortcuts
65+
$shortcutsPrivateDir = "$Env:USERPROFILE\shortcuts_private"
66+
New-Item -Path $shortcutsPrivateDir -ItemType Directory -Force
67+
68+
# Start Keypirinha
69+
& "$Env:USERPROFILE\scoop\apps\keypirinha\current\keypirinha.exe"
70+
71+
Write-Output "Installation/Update of Shortcuts was successful."
72+
}
73+
finally {
74+
Pop-Location
75+
Read-Host -Prompt "Press Enter to continue ..."
76+
}
77+
## end of script

bin/update.bat

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
powershell -ExecutionPolicy Bypass -File %~dp0install.ps1 %* || exit /b 1

build.bat

-3
This file was deleted.

build.ps1

-87
This file was deleted.

config/AutoHotKey/_hotKeys.ahk

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#SingleInstance force
2+
3+
#n::
4+
EnvGet, userName, USERNAME
5+
FormatTime, YearWeek, L0x0409, YWeek
6+
FormatTime, WeekDay, L0x0409, WDay
7+
YearWeek := SubStr(YearWeek, 5)
8+
FormatTime, CurrentYearAndTime, L0x0409, yyyy___-HH:mm
9+
MyDateString := StrReplace(CurrentYearAndTime, "___", "CW" . YearWeek . "." . (WeekDay-1))
10+
SendInput %MyDateString% (%userName%)
11+
return
12+
13+
#c::
14+
ClipWait
15+
If InStr(Clipboard, "/")
16+
StringReplace, Clipboard, Clipboard, /, \, A
17+
Else
18+
StringReplace, Clipboard, Clipboard, \, /, A
19+
return
20+
21+
#b::
22+
Send, !{space}
23+
Sleep 100
24+
Send, Switch{tab}
25+
return
26+
27+
SC122::
28+
Send ^+m
29+
return
30+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[app]
2+
launch_at_startup = yes
3+
hotkey_run = Win+Alt+Space
4+
5+
[gui]
6+
theme = AnthraciteFull
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[main]
2+
scan_start_menu = yes
3+
scan_desktop = yes
4+
scan_env_path = yes
5+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[profile/Shortcuts]
2+
activate = yes
3+
paths =
4+
${env:USERPROFILE}\shortcuts\**
5+
filters = + ext: .url .lnk .cmd .bat .exe
6+
file_item_label = {profile}: {clean_name}
7+
8+
[profile/Private]
9+
activate = yes
10+
paths =
11+
${env:USERPROFILE}\shortcuts_private\**
12+
filters = + ext: .url .lnk .cmd .bat .exe
13+
file_item_label = {profile}: {clean_name}

links/AI - Bing Chat.url

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

links/AI - chatgpt.url

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

links/Agile Manifesto.url

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

links/SPL - Core.url

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[InternetShortcut]
2+
URL=https://github.com/avengineers/spl-core

scoopfile.json

+18-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"buckets": [
3-
{
4-
"Name": "extras",
5-
"Source": "https://github.com/ScoopInstaller/Extras"
6-
},
73
{
84
"Name": "main",
95
"Source": "https://github.com/ScoopInstaller/Main"
106
},
117
{
128
"Name": "versions",
139
"Source": "https://github.com/ScoopInstaller/Versions"
10+
},
11+
{
12+
"Name": "extras",
13+
"Source": "https://github.com/ScoopInstaller/Extras"
1414
}
1515
],
1616
"apps": [
@@ -19,8 +19,20 @@
1919
"Source": "main"
2020
},
2121
{
22-
"Name": "keypirinha",
23-
"Source": "extras"
22+
"Source": "extras",
23+
"Name": "windows-terminal"
24+
},
25+
{
26+
"Source": "extras",
27+
"Name": "ditto"
28+
},
29+
{
30+
"Source": "extras",
31+
"Name": "keypirinha"
32+
},
33+
{
34+
"Source": "extras",
35+
"Name": "vscode"
2436
}
2537
]
2638
}

src/cmd/shortcut.cmd

-25
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
@echo on
2-
set "THIS_ROOT=%~dp0"
3-
set "THIS_BASE_NAME=%~n0"
4-
5-
regedit /S %THIS_ROOT%%THIS_BASE_NAME%.reg
6-
pause
1+
@echo off
2+
set "THIS_ROOT=%~dp0"
3+
set "THIS_BASE_NAME=%~n0"
4+
5+
regedit /S %THIS_ROOT%%THIS_BASE_NAME%.reg
File renamed without changes.

0 commit comments

Comments
 (0)