mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-16 01:40:35 -06:00
Compare commits
No commits in common. "f50845078e5c223b8b838d63cc37477b555f672d" and "e7e742044b5808090255b7f794d487849dea0f67" have entirely different histories.
f50845078e
...
e7e742044b
@ -20,13 +20,11 @@ function Set-WinUtilTaskbaritem {
|
||||
- Set-WinUtilTaskbaritem -state "Paused"
|
||||
|
||||
.PARAMETER overlay
|
||||
Overlay icon to display on the taskbar item, there are the presets 'None', 'logo' and 'checkmark' or you can specify a path/link to an image file.
|
||||
Overlay icon to display on the taskbar item, there are the presets 'logo' and 'checkmark' or you can specify a path/link to an image file.
|
||||
CTT logo preset:
|
||||
- Set-WinUtilTaskbaritem -overlay "logo"
|
||||
Checkmark preset:
|
||||
- Set-WinUtilTaskbaritem -overlay "checkmark"
|
||||
No overlay:
|
||||
- Set-WinUtilTaskbaritem -overlay "None"
|
||||
Custom icon:
|
||||
- Set-WinUtilTaskbaritem -overlay "C:\path\to\icon.png"
|
||||
|
||||
@ -59,13 +57,10 @@ function Set-WinUtilTaskbaritem {
|
||||
if ($overlay) {
|
||||
switch ($overlay) {
|
||||
'logo' {
|
||||
$sync["Form"].taskbarItemInfo.Overlay = (ConvertTo-Bitmap -image $winutildir["logo.png"])
|
||||
$sync["Form"].taskbarItemInfo.Overlay = (ConvertTo-Bitmap -image "$env:LOCALAPPDATA\winutil\cttlogo.png")
|
||||
}
|
||||
'checkmark' {
|
||||
$sync["Form"].taskbarItemInfo.Overlay = (ConvertTo-Bitmap -image $winutildir["checkmark.png"])
|
||||
}
|
||||
'None' {
|
||||
$sync["Form"].taskbarItemInfo.Overlay = $null
|
||||
$sync["Form"].taskbarItemInfo.Overlay = (ConvertTo-Bitmap -image "$env:LOCALAPPDATA\winutil\cttcheckmark.png")
|
||||
}
|
||||
default {
|
||||
if (Test-Path $overlay) {
|
||||
|
@ -17,7 +17,8 @@ function Invoke-WPFShortcut {
|
||||
[bool]$RunAsAdmin = $false
|
||||
)
|
||||
|
||||
# Preper the Shortcut Fields and add an a Custom Icon if it's available, else don't add a Custom Icon.
|
||||
# Preper the Shortcut Fields and add an a Custom Icon if it's available at "$env:TEMP\cttlogo.png", else don't add a Custom Icon.
|
||||
$iconPath = $null
|
||||
Switch ($ShortcutToAdd) {
|
||||
"WinUtil" {
|
||||
$SourceExe = "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe"
|
||||
@ -47,8 +48,8 @@ function Invoke-WPFShortcut {
|
||||
$Shortcut = $WshShell.CreateShortcut($FileBrowser.FileName)
|
||||
$Shortcut.TargetPath = $SourceExe
|
||||
$Shortcut.Arguments = $ArgumentsToSourceExe
|
||||
if (Test-Path -Path $winutildir["logo.ico"]) {
|
||||
$shortcut.IconLocation = $winutildir["logo.ico"]
|
||||
if (Test-Path -Path $ctticologo) {
|
||||
$shortcut.IconLocation = $ctticologo
|
||||
}
|
||||
|
||||
# Save the Shortcut to disk
|
||||
|
@ -430,34 +430,22 @@ $sync["SearchBar"].Add_TextChanged({
|
||||
$label.Visibility = "Collapsed"}
|
||||
})
|
||||
|
||||
# Initialize the hashtable
|
||||
$winutildir = @{}
|
||||
|
||||
# Set the path for the winutil directory
|
||||
$winutildir["path"] = "$env:LOCALAPPDATA\winutil\"
|
||||
if (-NOT (Test-Path -Path $winutildir["path"])) {
|
||||
New-Item -Path $winutildir["path"] -ItemType Directory
|
||||
$cttpnglogo = "$env:LOCALAPPDATA\winutil\cttlogo.png"
|
||||
$ctticologo = "$env:LOCALAPPDATA\winutil\cttlogo.ico"
|
||||
if (-NOT (Test-Path -Path $cttpnglogo) -or -NOT (Test-Path -Path $ctticologo)) {
|
||||
Invoke-WebRequest -Uri "https://christitus.com/images/logo-full.png" -OutFile $cttpnglogo
|
||||
}
|
||||
|
||||
# Set the path for the logo and checkmark images
|
||||
$winutildir["logo.png"] = $winutildir["path"] + "cttlogo.png"
|
||||
$winutildir["logo.ico"] = $winutildir["path"] + "cttlogo.ico"
|
||||
if (-NOT (Test-Path -Path $winutildir["logo.png"])) {
|
||||
Invoke-WebRequest -Uri "https://christitus.com/images/logo-full.png" -OutFile $winutildir["logo.png"]
|
||||
$cttpngcheckmark = "$env:LOCALAPPDATA\winutil\cttcheckmark.png"
|
||||
$ctticocheckmark = "$env:LOCALAPPDATA\winutil\cttcheckmark.ico"
|
||||
if (-NOT (Test-Path -Path $cttpngcheckmark) -or -NOT (Test-Path -Path $ctticocheckmark)) {
|
||||
Invoke-WebRequest -Uri "https://christitus.com/images/checkmark.png" -OutFile $cttpngcheckmark
|
||||
}
|
||||
|
||||
if (-NOT (Test-Path -Path $winutildir["logo.ico"])) {
|
||||
ConvertTo-Icon -bitmapPath $winutildir["logo.png"] -iconPath $winutildir["logo.ico"]
|
||||
}
|
||||
|
||||
$winutildir["checkmark.png"] = "$env:LOCALAPPDATA\winutil\cttcheckmark.png"
|
||||
if (-NOT (Test-Path -Path $winutildir["checkmark.png"])) {
|
||||
Invoke-WebRequest -Uri "https://christitus.com/images/checkmark.png" -OutFile $winutildir["checkmark.png"]
|
||||
}
|
||||
ConvertTo-Icon -bitmapPath $cttpnglogo -iconPath $ctticologo
|
||||
|
||||
Set-WinUtilTaskbaritem -overlay "logo" | Out-Null
|
||||
|
||||
$sync["Form"].icon = $winutildir["logo.png"]
|
||||
$sync["Form"].icon = $cttpnglogo
|
||||
|
||||
$sync["Form"].Add_Activated({
|
||||
Set-WinUtilTaskbaritem -overlay "logo"
|
||||
|
Loading…
Reference in New Issue
Block a user