forked from reisir/progress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Context.ps1
55 lines (48 loc) · 1.35 KB
/
Context.ps1
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
$SkinName = "Progress"
$ROOTCONFIG = $SkinName
$editVariablesFile = "#@#settings.inc"
$useLanguage = $False
$out = "@Resources\ContextMenu.inc"
$spacer = @{
Title = '-'
Action = ''
}
$current = @{
Title = '#CURRENTCONFIG#'
Action = '["#CURRENTPATH#"]'
}
$skinmenu = @{
Title = if ($useLanguage) { '#__SkinMenu#' } else { 'Open skin menu' }
Action = '[!SkinMenu]'
}
$centerHorizontal = @{
Title = if ($useLanguage) { '#__CenterHorizontal#' } else { 'Center horizontally' }
Action = '[!SetWindowPosition "50%" "[#CURRENTCONFIGY]" "50%" "0%"]'
}
$centerVertical = @{
Title = if ($useLanguage) { '#__CenterVertical#' } else { 'Center vertically' }
Action = '[!SetWindowPosition "([#CURRENTCONFIGX] + ([#CURRENTCONFIGWIDTH] / 2))" "50%" "50%" "50%"]'
}
$unloadSelf = @{
Title = "Unload $SkinName"
Action = "[!DeactivateConfigGroup `"$SkinName`"]"
}
$menu = @(
$current, $spacer,
$centerHorizontal, $centerVertical, $spacer,
$skinmenu, $unloadSelf
)
function Write-Menu {
$output = "[Rainmeter]`nRightMouseUpAction=[!SkinCustomMenu]`nGroup=$SkinName`n"
$count = ""
$menu | % {
$output += @"
ContextTitle$($count)=$($_.Title)
ContextAction$($count)=$($_.Action)
"@
$count = 1 + $count
if ($count -eq 1) { $count++ }
}
$output | Out-File -FilePath $out
}
Write-Menu