Skip to content

Commit 7099065

Browse files
feat: use run-hidden to hide console window
1 parent ce51c9f commit 7099065

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

.github/workflows/create_release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ jobs:
1919
- name: Create archive
2020
run: |
2121
mkdir -p CCS
22-
cp -r Resources CCS/
23-
cp CCS.ps1 Functions.psm1 Listener.ps1 CCS/
22+
cp -r Resources CCS.ps1 Functions.psm1 Listener.ps1 CCS/
2423
zip -r Cursor-Colors-Synchronizer.zip CCS
2524
2625
- name: Publish release

CCS.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ if ($installListener) {
7777
$Parameters = @{
7878
TaskName = 'CCS Listener'
7979
Description = $Localization.ListenerTaskDescription
80-
Action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument "-ExecutionPolicy Bypass -NoExit -WindowStyle Hidden -File `"$($PathsProvider::Listener)`""
81-
Trigger = New-ScheduledTaskTrigger -AtLogOn -User (whoami)
80+
Action = New-ScheduledTaskAction -Execute $PathsProvider::RunHidden -Argument "powershell -ExecutionPolicy Bypass -NoExit -File `"$($PathsProvider::Listener)`""
81+
Trigger = New-ScheduledTaskTrigger -AtLogOn -User $env:USERNAME
8282
Settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -StartWhenAvailable -DontStopIfGoingOnBatteries -ExecutionTimeLimit '00:00:00'
8383
RunLevel = 'Highest'
8484
Force = $true

Functions.psm1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ class PathsProvider {
8686
static [string] $EditedCursorsFolder
8787
static Hidden [string] $OriginalCursorsRootFolder
8888
static Hidden [string] $DiffsRootFolder
89+
static [string] $BinFolder
90+
static [string] $RunHidden
8991

9092
PathsProvider([string]$Root) {
9193
if (-not (Test-Folder -Path $Root)) {
@@ -100,6 +102,8 @@ class PathsProvider {
100102
[PathsProvider]::EditedCursorsFolder = "$([PathsProvider]::CursorsFolder)\Edited"
101103
[PathsProvider]::OriginalCursorsRootFolder = "$([PathsProvider]::CursorsFolder)\Original"
102104
[PathsProvider]::DiffsRootFolder = "$([PathsProvider]::RecourcesFolder)\Diffs"
105+
[PathsProvider]::BinFolder = "$([PathsProvider]::RecourcesFolder)\Bin"
106+
[PathsProvider]::RunHidden = "$([PathsProvider]::BinFolder)\run-hidden.exe"
103107
}
104108

105109
static [hashtable] GetDynamicPaths() {

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ iwr 'https://raw.githubusercontent.com/SunsetTechuila/Cursor-Colors-Synchronizer
4848
## Credits
4949

5050
- [Jepri Creations](https://jepricreations.com) for the cursors
51+
- [stax76](https://github.com/stax76) for [run-hidden](https://github.com/stax76/run-hidden)
5152

5253
## Legal
5354

Resources/Bin/run-hidden.exe

26.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)