Skip to content

Commit

Permalink
feat: use run-hidden to hide console window
Browse files Browse the repository at this point in the history
  • Loading branch information
SunsetTechuila committed May 7, 2024
1 parent ce51c9f commit 7099065
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ jobs:
- name: Create archive
run: |
mkdir -p CCS
cp -r Resources CCS/
cp CCS.ps1 Functions.psm1 Listener.ps1 CCS/
cp -r Resources CCS.ps1 Functions.psm1 Listener.ps1 CCS/
zip -r Cursor-Colors-Synchronizer.zip CCS
- name: Publish release
Expand Down
4 changes: 2 additions & 2 deletions CCS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ if ($installListener) {
$Parameters = @{
TaskName = 'CCS Listener'
Description = $Localization.ListenerTaskDescription
Action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument "-ExecutionPolicy Bypass -NoExit -WindowStyle Hidden -File `"$($PathsProvider::Listener)`""
Trigger = New-ScheduledTaskTrigger -AtLogOn -User (whoami)
Action = New-ScheduledTaskAction -Execute $PathsProvider::RunHidden -Argument "powershell -ExecutionPolicy Bypass -NoExit -File `"$($PathsProvider::Listener)`""
Trigger = New-ScheduledTaskTrigger -AtLogOn -User $env:USERNAME
Settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -StartWhenAvailable -DontStopIfGoingOnBatteries -ExecutionTimeLimit '00:00:00'
RunLevel = 'Highest'
Force = $true
Expand Down
4 changes: 4 additions & 0 deletions Functions.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ class PathsProvider {
static [string] $EditedCursorsFolder
static Hidden [string] $OriginalCursorsRootFolder
static Hidden [string] $DiffsRootFolder
static [string] $BinFolder
static [string] $RunHidden

PathsProvider([string]$Root) {
if (-not (Test-Folder -Path $Root)) {
Expand All @@ -100,6 +102,8 @@ class PathsProvider {
[PathsProvider]::EditedCursorsFolder = "$([PathsProvider]::CursorsFolder)\Edited"
[PathsProvider]::OriginalCursorsRootFolder = "$([PathsProvider]::CursorsFolder)\Original"
[PathsProvider]::DiffsRootFolder = "$([PathsProvider]::RecourcesFolder)\Diffs"
[PathsProvider]::BinFolder = "$([PathsProvider]::RecourcesFolder)\Bin"
[PathsProvider]::RunHidden = "$([PathsProvider]::BinFolder)\run-hidden.exe"
}

static [hashtable] GetDynamicPaths() {
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ iwr 'https://raw.githubusercontent.com/SunsetTechuila/Cursor-Colors-Synchronizer
## Credits

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

## Legal

Expand Down
Binary file added Resources/Bin/run-hidden.exe
Binary file not shown.

0 comments on commit 7099065

Please sign in to comment.