Last active
January 15, 2021 22:22
-
-
Save dariusz-wozniak/963915650a827307d7f8eaba3fd46227 to your computer and use it in GitHub Desktop.
Run Slack Minimized (AutoHotkey script)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run, %USERPROFILE%\AppData\Local\slack\Update.exe --processStart "slack.exe", , Normal | |
WinWait, ahk_exe slack.exe | |
Loop, 50 | |
{ | |
WinHide, ahk_exe slack.exe | |
Sleep, 200 | |
} |
For me, Slack was installed at "C:\Program Files (x86)\Slack\Slack.exe"
Hi, I tried
Run, %USERPROFILE%\AppData\Local\Microsoft\WindowsApps\slack.exe, , Hide
But it does not work, despite %USERPROFILE%\AppData\Local\Microsoft\WindowsApps\slack.exe
working via command line.
Any thoughts why this might be?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This pointed me in the right direction for using the Windows 10 Slack App. I modified the script as follows:
Changing Normal on the first line to Hide stops the initial flicker with the loading. You still get a slight flicker when the app itself closes. I modified the WinHide to WinClose in the loop. If you use WinHide, CPU levels remain higher as if the application was displaying. When you close, slack still pushes to the tray, then free's up memory and reduces CPU to near 0. Note for the close to work, the preferences in slack under Advanced, Other Options require the "Leave app running in notification area when the window is closed" option checked off, which I believe it is by default.