From 56c0edfedb4223f3d036e4c1081f823bbe80c4d4 Mon Sep 17 00:00:00 2001 From: CronyAkatsuki Date: Sun, 5 Dec 2021 16:12:47 +0100 Subject: [PATCH] Update. --- checkup_system.ps1 | 8 +-- clean_system.ps1 | 14 ++++- profile.ps1 | 106 ++++++++++++++++++++++++++++++++++ ryzenadj/cemu.cmd | 2 +- ryzenadj/dead-by-daylight.cmd | 2 + ryzenadj/far-cry-3.cmd | 2 - ryzenadj/genshin-impact.cmd | 2 +- ryzenadj/osu.cmd | 2 +- ryzenadj/shadow-warrior.cmd | 2 - ryzenadj/valorant.cmd | 2 - 10 files changed, 123 insertions(+), 19 deletions(-) create mode 100644 profile.ps1 create mode 100644 ryzenadj/dead-by-daylight.cmd delete mode 100644 ryzenadj/far-cry-3.cmd delete mode 100644 ryzenadj/shadow-warrior.cmd delete mode 100644 ryzenadj/valorant.cmd diff --git a/checkup_system.ps1 b/checkup_system.ps1 index 7545234..e952f35 100644 --- a/checkup_system.ps1 +++ b/checkup_system.ps1 @@ -1,9 +1,3 @@ -Write-Host "" -Write-Host -ForegroundColor Green "Malware scan using adwcleaner" -Write-Host "" - -adwcleaner.exe - Write-Host "" Write-Host -ForegroundColor Green "Check windows image component store state" Write-Host "" @@ -78,4 +72,4 @@ while ($true) { Write-Host -ForegroundColor Green "Skipping restarting." break } -} \ No newline at end of file +} diff --git a/clean_system.ps1 b/clean_system.ps1 index 5f45e9e..e075b2d 100644 --- a/clean_system.ps1 +++ b/clean_system.ps1 @@ -4,6 +4,12 @@ Write-Host "" scoop cleanup * +Write-Host "" +Write-Host -ForegroundColor Green "Cleanup scoop cache" +Write-Host "" + +scoop cache rm * + Write-Host "" Write-Host -ForegroundColor Green "Cleaning chocolatey packages" Write-Host "" @@ -44,8 +50,10 @@ Write-Host "" Remove-Item -Path "C:\Users\*\AppData\Local\Microsoft\Windows\IEDownloadHistory\*" -Force -Recurse Remove-Item -Path "C:\Users\*\AppData\Local\Microsoft\Windows\INetCache\*" -Force -Recurse Remove-Item -Path "C:\Users\*\AppData\Local\Microsoft\Windows\INetCookies\*" -Force -Recurse - Remove-Item -Path "C:\Users\*\AppData\Local\Microsoft\Terminal Server Client\Cache\*" -Force -Recurse - sudo Remove-Item -Path "C:\Temp\*" -Force -Recurse + Remove-Item -Path "C:\Users\*\AppData\Local\Microsoft\Terminal Server Client\Cache\*" -Force -Recurse + Write-Host -ForegroundColor Yellow "Removing temp files" + sudo Remove-Item -Path "C:\Users\*\AppData\Local\Temp" -Force -Recurse + sudo Remove-Item -Path "$env:windir\Temp\*" -Force -Recurse Write-Host "" Write-Host -ForegroundColor Green "Checking Component store size" @@ -65,4 +73,4 @@ while ($true) { Write-Host -ForegroundColor Green "Skipping cleanup of component store" break } -} \ No newline at end of file +} diff --git a/profile.ps1 b/profile.ps1 new file mode 100644 index 0000000..55ec39b --- /dev/null +++ b/profile.ps1 @@ -0,0 +1,106 @@ +using namespace System.Management.Automation + +Import-Module PSReadLine + +$versionMinimum = [Version]'7.1.999' + +if (($Host.Name -eq 'ConsoleHost') -and ($PSVersionTable.PSVersion -ge $versionMinimum)) +{ + Set-PSReadLineOption -PredictionSource HistoryAndPlugin +} +else +{ + Set-PSReadLineOption -PredictionSource History +} + +Set-PSReadLineOption -HistorySearchCursorMovesToEnd +Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward +Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward +Set-PSReadLineOption -PredictionViewStyle ListView +Set-PSReadlineOption -Color @{ + "Command" = [ConsoleColor]::Green + "Parameter" = [ConsoleColor]::Gray + "Operator" = [ConsoleColor]::Magenta + "Variable" = [ConsoleColor]::White + "String" = [ConsoleColor]::Yellow + "Number" = [ConsoleColor]::Blue + "Type" = [ConsoleColor]::Cyan + "Comment" = [ConsoleColor]::DarkCyan +} + +Import-Module posh-git +$GitPromptSettings.DefaultPromptPrefix.Text = "$([char]0x2192) " # arrow unicode symbol +$GitPromptSettings.DefaultPromptPrefix.ForegroundColor = [ConsoleColor]::Green +$GitPromptSettings.DefaultPromptPath.ForegroundColor =[ConsoleColor]::Cyan +$GitPromptSettings.DefaultPromptSuffix.Text = "$([char]0x203A) " # chevron unicode symbol +$GitPromptSettings.DefaultPromptSuffix.ForegroundColor = [ConsoleColor]::Magenta + +$GitPromptSettings.BeforeStatus.ForegroundColor = [ConsoleColor]::Blue +$GitPromptSettings.BranchColor.ForegroundColor = [ConsoleColor]::Blue +$GitPromptSettings.AfterStatus.ForegroundColor = [ConsoleColor]::Blue +$GitPromptSettings.DefaultPromptAbbreviateHomeDirectory = $true +$GitPromptSettings.DefaultPromptBeforeSuffix.Text = '`n' +$GitPromptSettings.DefaultPromptWriteStatusFirst = $true +$GitPromptSettings.BeforePath = '{' +$GitPromptSettings.AfterPath = '}' +$GitPromptSettings.BeforePath.ForegroundColor = 'Red' +$GitPromptSettings.AfterPath.ForegroundColor = 'Red' + +function global:PromptWriteErrorInfo() { + if ($global:GitPromptValues.DollarQuestion) { return } + + if ($global:GitPromptValues.LastExitCode) { + "`e[31m(" + $global:GitPromptValues.LastExitCode + ") `e[0m" + } + else { + "`e[31m! `e[0m" + } +} + +$global:GitPromptSettings.DefaultPromptBeforeSuffix.Text = '`n$(PromptWriteErrorInfo)' + +# Chocolatey profile +$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" +if (Test-Path($ChocolateyProfile)) { + Import-Module "$ChocolateyProfile" +} + +function lsPretty +{ + lsd -A -L -l $args[0] +} + +function mklink +{ + [string] $original = $args[0] + [string] $target = $args[1] + sudo New-Item -ItemType SymbolicLink -Path "$target" -Target "$original" +} + +function yta { + youtube-dl -x -f bestaudio --external-downloader aria2c --external-downloader-args "-j 16 -s 16 -x 16 -k 5M" --audio-format mp3 -o "%(title)s.%(ext)s" $args[0] +} + +function ytvb { + youtube-dl --merge-output-format mp4 -f "bestvideo+bestaudio[ext=m4a]/best" --embed-thumbnail --external-downloader aria2c --external-downloader-args "-j 16 -s 16 -x 16 -k 5M" --add-metadata -o "%(title)s.%(ext)s" $args[0] +} + +function ytvf { + youtube-dl --merge-output-format mp4 --format best --embed-thumbnail --external-downloader aria2c --external-downloader-args "-j 16 -s 16 -x 16 -k 5M" --add-metadata -o "%(title)s.%(ext)s" $args[0] +} + +function download { + cd ~\Downloads + aria2c -j 16 -s 16 -x 16 -k 5M --file-allocation=none $args[0] +} + +function BlockTheSpot { + Invoke-WebRequest -UseBasicParsing 'https://raw.githubusercontent.com/mrpond/BlockTheSpot/master/install.ps1' | Invoke-Expression +} + +Set-Alias -Name ls -Value lsPretty +Set-Alias -Name grep -Value rg +Set-Alias -Name ln -Value mklink +Set-Alias -Name vi -Value nvim-qt + +powerfetch.ps1 diff --git a/ryzenadj/cemu.cmd b/ryzenadj/cemu.cmd index f60524f..9e0bbe1 100644 --- a/ryzenadj/cemu.cmd +++ b/ryzenadj/cemu.cmd @@ -1,2 +1,2 @@ @echo off -ryzenadj --slow-time=60 --vrmmax-current=70000 --tctl-temp=80 --stapm-limit=25000 --stapm-time=1000 --fast-limit=35000 --slow-limit=30000 --max-performance \ No newline at end of file +ryzenadj --slow-time=60 --vrmmax-current=55000 --tctl-temp=90 --stapm-limit=30000 --stapm-time=1000 --fast-limit=35000 --slow-limit=33000 --max-performance \ No newline at end of file diff --git a/ryzenadj/dead-by-daylight.cmd b/ryzenadj/dead-by-daylight.cmd new file mode 100644 index 0000000..11a9f1e --- /dev/null +++ b/ryzenadj/dead-by-daylight.cmd @@ -0,0 +1,2 @@ +@echo off +ryzenadj --slow-time=60 --vrmmax-current=40000 --tctl-temp=80 --stapm-limit=13000 --stapm-time=1000 --fast-limit=15000 --slow-limit=14000 --max-performance \ No newline at end of file diff --git a/ryzenadj/far-cry-3.cmd b/ryzenadj/far-cry-3.cmd deleted file mode 100644 index 67baf40..0000000 --- a/ryzenadj/far-cry-3.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -ryzenadj --slow-time=60 --vrmmax-current=50000 --tctl-temp=85 --stapm-limit=14000 --stapm-time=1000 --fast-limit=17000 --slow-limit=15000 --max-performance \ No newline at end of file diff --git a/ryzenadj/genshin-impact.cmd b/ryzenadj/genshin-impact.cmd index ad4ce59..9eeab7a 100644 --- a/ryzenadj/genshin-impact.cmd +++ b/ryzenadj/genshin-impact.cmd @@ -1,2 +1,2 @@ @echo off -ryzenadj --slow-time=60 --vrmmax-current=55000 --tctl-temp=80 --stapm-limit=16000 --stapm-time=1000 --fast-limit=20000 --slow-limit=17000 --max-performance \ No newline at end of file +ryzenadj --slow-time=60 --vrmmax-current=42000 --tctl-temp=70 --stapm-limit=16000 --stapm-time=1000 --fast-limit=16000 --slow-limit=16000 --max-performance \ No newline at end of file diff --git a/ryzenadj/osu.cmd b/ryzenadj/osu.cmd index 1349e2f..f079d28 100644 --- a/ryzenadj/osu.cmd +++ b/ryzenadj/osu.cmd @@ -1,2 +1,2 @@ @echo off -ryzenadj --slow-time=30 --vrmmax-current=45000 --tctl-temp=75 --stapm-limit=12000 --stapm-time=300 --fast-limit=15000 --slow-limit=13000 --power-saving \ No newline at end of file +ryzenadj --slow-time=30 --vrmmax-current=45000 --tctl-temp=75 --stapm-limit=12000 --stapm-time=300 --fast-limit=15000 --slow-limit=13000 --max-performance \ No newline at end of file diff --git a/ryzenadj/shadow-warrior.cmd b/ryzenadj/shadow-warrior.cmd deleted file mode 100644 index bbdea02..0000000 --- a/ryzenadj/shadow-warrior.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -ryzenadj --slow-time=60 --vrmmax-current=40000 --tctl-temp=85 --stapm-limit=10000 --stapm-time=1000 --fast-limit=13000 --slow-limit=11000 --max-performance \ No newline at end of file diff --git a/ryzenadj/valorant.cmd b/ryzenadj/valorant.cmd deleted file mode 100644 index 529dbf7..0000000 --- a/ryzenadj/valorant.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -ryzenadj --slow-time=60 --vrmmax-current=55000 --tctl-temp=80 --stapm-limit=18000 --stapm-time=1000 --fast-limit=21000 --slow-limit=19000 --max-performance \ No newline at end of file