Skip to content

Commit

Permalink
add new features, most noteably edge redirect
Browse files Browse the repository at this point in the history
Co-authored-by: Yummy_Bacon5 <[email protected]>
  • Loading branch information
Zoobdude and YummyBacon5 committed Apr 25, 2024
1 parent 27405ae commit 39b508c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 21 deletions.
19 changes: 19 additions & 0 deletions edge_redirect.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[Config]
Managed=False
Mode=Service

[Settings]
Edges=Stable,Beta,Dev,Canary
NoApps=True
NoBing=True
NoImgs=True
NoMSN=True
NoPDFs=False
NoTray=False
NoUpdates=True
Images=Google
News=DuckDuckGo
Search=Google
StartMenu=AppOnly
Startup=False
Weather=Darksky
47 changes: 26 additions & 21 deletions main.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#functions
function UnPin-App { param(
[string]$appname
)
((New-Object -Com Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name.replace("&","") -match "Unpin from taskbar"} | %{$_.DoIt()}
[string]$appname
)
try {
((New-Object -Com Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name.replace("&", "") -match "Unpin from taskbar"} | %{$_.DoIt()}
return "App '$appname' unpinned from Taskbar"
} catch {
Write-Error "Error Unpinning App! (App-Name correct?)"
}
}

UnPin-App "Microsoft Edge"
Expand All @@ -13,34 +19,33 @@ Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Pe
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -Value 0 -Type Dword -Force

# Remove task view
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowTaskViewButton -Value 0 -Force
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Value 0 -Force

# Hide desktop icons
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideIcons" -Value 1 -Force
Stop-Process -processName: Explorer # Restart explorer to apply above two changes

# Enable the clipboard history
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Clipboard -Name EnableClipboardHistory -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Clipboard" -Name EnableClipboardHistory -Value 1

# Set print screen to open snipping tool
Set-ItemProperty -Path HKCU:\Control Panel\Keyboard -Name PrintScreenKeyForSnippingEnabled -Value 1 -Type Dword
Set-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name PrintScreenKeyForSnippingEnabled -Value 1 -Type Dword

# Change default browser to Chrome
$originalFile = "C:\Windows\System32\OEMDefaultAssociations.xml"
$content = Get-Content $originalFile
# Setup edge redirect - https://github.com/rcmaehl/MSEdgeRedirect/wiki/Deploying-MSEdgeRedirect
Invoke-WebRequest https://github.com/rcmaehl/MSEdgeRedirect/releases/latest/download/MSEdgeRedirect.exe -OutFile .\MSEdgeRedirect.exe
Start-Process MSEdgeRedirect.exe -ArgumentList "/silentinstall",".\edge_redirect.ini" -PassThru
Remove-Item -Path ".\MSEdgeRedirect.exe"

# Replace the Microsoft Edge associations with Google Chrome
$content = $content.Replace('<Association Identifier="http" ProgId="AppXq0fevzme2pys62n3e0fbqa7peapykr8v" ApplicationName="Microsoft Edge" />', '<Association Identifier="http" ProgId="ChromeHTML" ApplicationName="Google Chrome" />')
$content = $content.Replace('<Association Identifier="https" ProgId="AppX90nv6nhay5n6a98fnetv7tpk64pp35es" ApplicationName="Microsoft Edge" />', '<Association Identifier="https" ProgId="ChromeHTML" ApplicationName="Google Chrome" />')
$content = $content.Replace('<Association Identifier=".htm" ProgId="AppX4hxtad77fbk3jkkeerkrm0ze94wjf3s9" ApplicationName="Microsoft Edge" />', '<Association Identifier=".htm" ProgId="ChromeHTML" ApplicationName="Google Chrome" />')
$content = $content.Replace('<Association Identifier=".html" ProgId="AppX4hxtad77fbk3jkkeerkrm0ze94wjf3s9" ApplicationName="Microsoft Edge" />', '<Association Identifier=".html" ProgId="ChromeHTML" ApplicationName="Google Chrome" />')
# Close the trash browser :(
Stop-Process -Name msedge -Force

Set-Content -Path $originalFile -Value $content

# Open useful tabs
Start-Process "chrome.exe" "https://www.bbc.co.uk/news","--profile-directory="Default""
Start-Process "chrome.exe" "https://github.com/login","--profile-directory="Default""
Start-Process "chrome.exe" "https://teams.microsoft.com/","--profile-directory="Default""
Start-Process "chrome.exe" "https://office.com","--profile-directory="Default""

# Close the trash browser
Stop-Process -Name msedge -Force
Start-Process "chrome.exe" "https://www.bbc.co.uk/news"
Start-Process "chrome.exe" "https://github.com/login"
Start-Process "chrome.exe" "https://teams.microsoft.com/"
Start-Process "chrome.exe" "https://office.com"


# Easter egg ;)
Expand Down

0 comments on commit 39b508c

Please sign in to comment.