Skip to content

Commit

Permalink
style improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
SunsetTechuila committed Feb 14, 2023
1 parent 2a00d55 commit 53cca48
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
16 changes: 8 additions & 8 deletions CCS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Remove-Module -Name Functions -ErrorAction SilentlyContinue
Clear-Variable -Name Localization, windowsTheme, cursorSize, useClassicWheel, useAlternatePrecision, originalCursorFolder, customCursorFolder, byteDiffFolder, useListener, input -ErrorAction SilentlyContinue
Import-LocalizedData -BindingVariable Localization -BaseDirectory $PSScriptRoot\Localizations -FileName Strings
Import-Module -Name $PSScriptRoot\Functions.ps1
#endregion
#endregion Preparation

#region Dialogs
do {
Expand Down Expand Up @@ -72,15 +72,15 @@ switch ($input) {
1 {$useListener = $true}
2 {$useListener = $false}
}
#endregion
#endregion Dialogs


#region Variables
$windowsTheme = Get-WindowsTheme
$originalCursorFolder = "$PSScriptRoot\Resources\Original Cursors\$windowsTheme\$cursorSize"
$byteDiffFolder = "$PSScriptRoot\Resources\Byte Diff\$cursorSize"
$customCursorFolder = "$PSScriptRoot\Resources\Custom Cursor"
#endregion
#endregion Variables

#region Cursor
Copy-Item -Path $originalCursorFolder\default\* -Destination $customCursorFolder -Recurse -Force
Expand All @@ -101,13 +101,13 @@ if ($useAlternatePrecision) {
}
Install-CursorFromFolder -Path $customCursorFolder
Apply-Changes
#endregion
#endregion Cursor

#region Parameters
Set-Content -Path $PSScriptRoot\Resources\Preferences -Value $cursorSize
Add-Content -Path $PSScriptRoot\Resources\Preferences -Value $useClassicWheel
Add-Content -Path $PSScriptRoot\Resources\Preferences -Value $useAlternatePrecision
#endregion
#endregion Parameters

#region Listener
if ($useListener) {
Expand All @@ -119,10 +119,10 @@ if ($useListener) {
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -StartWhenAvailable -DontStopIfGoingOnBatteries -ExecutionTimeLimit '00:00:00'
Stop-ScheduledTask -TaskName $name -ErrorAction SilentlyContinue
Register-ScheduledTask -TaskName $name -Description $description -Action $action -Trigger $trigger -Settings $settings -RunLevel Highest -Force | Out-Null
Start-Sleep 1
Start-Sleep -Seconds 1
Start-ScheduledTask -TaskName $name
}
#endregion
#endregion Listener

#region Final Messages
Clear-Host
Expand All @@ -133,4 +133,4 @@ Write-Host -Object $Localization.GitHubReminderMessage
Write-Host
Pause
exit
#endregion
#endregion Final Messages
4 changes: 2 additions & 2 deletions Functions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ function Patch-Cursor {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[array]$Diff,
[array]$Diff,

[Parameter(Mandatory)]
[byte[]]$Cursor
[byte[]]$Cursor
)
$color = Get-WindowsAccentColor
$counter = 0
Expand Down
18 changes: 9 additions & 9 deletions Listener.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ $ErrorActionPreference = 'Stop'
Remove-Module -Name Functions -ErrorAction SilentlyContinue
Clear-Variable -Name lastTheme, currentTheme, lastAccentColor, currentAccentColor, useClassicWheel, useAlternatePrecision, originalCursorFolder, customCursorFolder -ErrorAction SilentlyContinue
Import-Module -Name $PSScriptRoot\Functions.ps1
#endregion
#endregion Preparation

#region Variables
$cursorSize = Get-Content -Path $PSScriptRoot\Resources\Preferences -First 1
$useClassicWheel = Get-Content -Path $PSScriptRoot\Resources\Preferences -First 2 | Select-Object -Skip 1
$useAlternatePrecision = [System.Convert]::ToBoolean( $(Get-Content -Path $PSScriptRoot\Resources\Preferences -Last 1) )
$byteDiffFolder = "$PSScriptRoot\Resources\Byte Diff\$cursorSize"
$customCursorFolder = "$PSScriptRoot\Resources\Custom Cursor"
$lastTheme = Get-WindowsTheme
$lastAccentColor = Get-WindowsAccentColor
#endregion
$byteDiffFolder = "$PSScriptRoot\Resources\Byte Diff\$cursorSize"
$customCursorFolder = "$PSScriptRoot\Resources\Custom Cursor"
$lastTheme = Get-WindowsTheme
$lastAccentColor = Get-WindowsAccentColor
#endregion Variables

while (1) {
#region Theme
Expand All @@ -43,7 +43,7 @@ while (1) {
Apply-Changes
$lastTheme = $currentTheme
}
#endregion
#endregion Theme

#region Accent Color
$currentAccentColor = Get-WindowsAccentColor
Expand All @@ -60,7 +60,7 @@ while (1) {
}
$lastAccentColor = $currentAccentColor
}
#endregion
#endregion Accent Color

Start-Sleep 1
Start-Sleep -Seconds 1
}

0 comments on commit 53cca48

Please sign in to comment.