Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Lorenzo501/2123c3e42b8e995ea654321d3eb4c518 to your computer and use it in GitHub Desktop.
Save Lorenzo501/2123c3e42b8e995ea654321d3eb4c518 to your computer and use it in GitHub Desktop.
/*
Simply go to properties of the web app icon in the taskbar for example and set these values:
Target: "%UserProfile%\Downloads\AutoHotkey\Open VSCode Web Editor With Recent Folder.ahk"
Start in: %UserProfile%\Downloads\AutoHotkey
*/
#Requires AutoHotkey 2.0
#NoTrayIcon
Persistent()
A_WinDelay := -1
EVENT_OBJECT_NAMECHANGE := 0x800C
if (ProcessExist("chrome.exe") || !(hasTabsOutlinerExtension := DirExist(EnvGet("LocalAppData") "\Google\Chrome\User Data\Default\Extensions\eggkanocgddhmamlbiijnphhppkpkmkl")))
{
Run("chrome.exe --app-id=jhdpafkbedbgckdnecbbppbpboebapeb --start-maximized --disable-features=GlobalMediaControls")
if (WinWaitActive("Visual Studio Code - Welcome",, 15))
Send("^r{Enter}")
ExitApp()
}
else
{
DllCall("SetWinEventHook",
"UInt", EVENT_OBJECT_NAMECHANGE,
"UInt", EVENT_OBJECT_NAMECHANGE,
"Ptr", 0,
"Ptr", CallbackCreate(HandleTabsOutlinerEvent),
"UInt", 0,
"UInt", 0,
"UInt", 0)
Run("chrome.exe --app-id=jhdpafkbedbgckdnecbbppbpboebapeb --start-maximized --disable-features=GlobalMediaControls")
}
;********** LIBRARY **********
HandleTabsOutlinerEvent(hWinEventHook, event, hWnd, *)
{
static isBeingClosed := false
try
if (WinGetTitle(hWnd) = "_crx_eggkanocgddhmamlbiijnphhppkpkmkl" && !isBeingClosed)
{
isBeingClosed := true
WinSetTransparent(0, hWnd) ; Gets rid of the close animation
WinClose(hWnd)
WinWaitActive("Visual Studio Code - Welcome",, 15)
Send("^r{Enter}")
ExitApp()
}
}
@Lorenzo501
Copy link
Author

I wrote this Tampermonkey script to make it even better:

// @name         Override the bottom-left icon style of both VSCode’s and GitHub’s web editors
// @version      25-04-2024
// @description  Removes the vibrant color of an icon
// @match        https://vscode.dev/*
// @match        https://github.dev/*
// @grant        GM_addStyle
// @run-at       document-end
// ==/UserScript==

GM_addStyle ( `
    .monaco-workbench .part.statusbar>.items-container>.statusbar-item.remote-kind {
        background-color: unset;
    }
` );

@Lorenzo501
Copy link
Author

To prevent pictograms from moving on W10 desktop when saving files in VSCode, as well as being able to see the collection of scripts; You should put unfinished scripts in the "Downloads\AutoHotkey\Experimental" folder, and then any script that you need easy-access to, you can just make a shortcut of to put on the desktop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment