Skip to content

Instantly share code, notes, and snippets.

@bGZo
Last active June 22, 2023 04:09
Show Gist options
  • Save bGZo/cef075c8d2c7e666c7995122c3b2e482 to your computer and use it in GitHub Desktop.
Save bGZo/cef075c8d2c7e666c7995122c3b2e482 to your computer and use it in GitHub Desktop.
Run with PowerShell 7. Update proxies depends on the scripts.
@ECHO OFF
SET MYPATH=%cd%
SET MYSCRIPT=%MYPATH%\start_here.ps1
pwsh-preview %MYSCRIPT%
pause
Set-PSDebug -Trace 0
function Open-Applications{
Param($data)
$Applications=$data | sort-object -Property priority
foreach($Application in $Applications){
if($Application.isUWP -eq 'y'){
$name=$Application.name
start "shell:AppsFolder\$(Get-StartApps $name | select -ExpandProperty AppId | sort -Unique)"
## start -FilePath $i
# via https://stackoverflow.com/questions/46893260/how-to-start-a-universal-windows-app-uwp-from-powershell-in-windows-10
}else{
$path=$Application.path
start $path
}
}
}
function Open-Web{
Param($browser, $pages)
foreach($page in $pages){
start $browser $page
}
}
function Open-Proxies{
pwsh-preview $clash_path\update_rss.ps1
clash -d $clash_path
}
function Main{
$browser='C:\Program Files (x86)\Microsoft\Edge Dev\Application\msedge.exe';
$clash_path='E:\OneDrive\workspace\proxy'
$apps=@(
@{name='Traffic Monitor';isUWP='n';priority=1;path='C:\Users\15517\bin\TrafficMonitor\TrafficMonitor.exe'},
@{name='Logseq';isUWP='n';priority=1;path='C:\Users\15517\scoop\apps\logseq\current\Logseq.exe'},
@{name='Billfish';isUWP='n';priority=1;path='C:\Program Files\Billfish\Billfish\Billfish.exe'},
@{name='白描桌面版';isUWP='n';priority=1;path='C:\Program Files\白描桌面版\白描桌面版.exe'},
@{name='Spotify';isUWP='y';priority=0;}
)
$pages=@(
'"https://aclash.bgzo.cc/"',
'"https://oi-wiki.org"',
'"https://leetcode.cn/problemset/all/"',
'"https://duolingo.com/"'
)
# Open app
Open-Applications $apps
# Open web page
Open-Web $browser $pages
#Open proxies
Open-Proxies
}
Main
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment