Skip to content

A lightweight but powerful workspace launcher that uses folders. Launch and manage your apps easily by placing shortcuts inside a workspace folder and renaming them.

License

Notifications You must be signed in to change notification settings

zaxx-q/WorkspaceLauncher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

38 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Smart Workspace Launcher

Smart Workspace Launcher Screenshot

A powerful, directory-based workspace manager for Windows. It treats a folder as a configuration file, allowing you to organize, sort, and launch groups of applications with complex rules just by renaming files and folders.


πŸš€ Features

  • Zero Config: No JSON/XML files. Just drag, drop, and rename shortcuts.
  • Smart Tracking: Tracks PIDs, Window Handles, or Process Names to ensure clean shutdowns.
  • Safety First: Includes Session ID validation to prevent using stale logs after a reboot, and System Process Protection to prevent accidental termination of critical Windows components.
  • Idempotent: Automatically skips apps that are already running (unless overridden).
  • Session Management: Tracks every window launched. Press Shift on launch to close only the apps from that specific session.
  • Dependency Chaining: Launch App B only after App A is fully loaded ([Wait]).
  • Magic Folders: Subfolders act as rules (e.g., everything in \minimized launches minimized).

πŸ“¦ Installation & Setup

Note: This script is designed to run as a compiled executable (.exe) for maximum stability and process tracking.

Automatic Build (Recommended)

  1. Install AutoHotkey v2.
  2. Open a terminal (Command Prompt or PowerShell) in the script's folder.
  3. Run the script with the build flag:
    AutoHotkey.exe WorkspaceLauncher.ahk --build
  4. The script will automatically locate your compiler (Ahk2Exe) and produce WorkspaceLauncher.exe.
    • If it can't find the compiler, a file dialog will open asking you to locate Ahk2Exe.exe manually.

Manual Build

Right-click WorkspaceLauncher.ahk > Compile Script.


βš™οΈ Usage & Modes

Once you have WorkspaceLauncher.exe, simply double-click it to start. By default, it creates and looks for a folder named Workspace next to itself.

Modifier Key Mode Description
None Launch Launches apps in the workspace. Skips apps already running (Single Instance default).
Hold Shift Cleanup Closes only the apps tracked in the current session (plus specific "Cleanup" folders).
Hold Ctrl Selective Launch Shows a checklist GUI to choose which apps to launch.
Hold Alt Toggle Visibility Hides or Shows background apps (only those launched with [Hide]).
Hold Ctrl+Alt Selective Toggle Shows a checklist GUI to Show/Hide any app in the session.

Command Line Arguments

You can manage multiple workspaces by passing the folder path or flags as arguments.

; Launch a specific gaming workspace
WorkspaceLauncher.exe "D:\Workspaces\Gaming"

; Trigger cleanup for the default workspace
WorkspaceLauncher.exe --close

; Trigger visibility toggle
WorkspaceLauncher.exe --toggle

🏷️ Filename Tags

Rename your files/shortcuts to apply rules. Tags are case-insensitive and support [], {}, or <>.

Note on Aliases: Some tags support multiple names (Aliases) for convenience. You can use either the Short or Long version.

Primary Tag Aliases Function Example
[N] (None) Sets launch order (Natural Sort). [1] Chrome.lnk
[Multi] [Dup], [AllowDup] Allow Duplicates. Forces a new instance even if one is already running. [2] Notepad [Multi].lnk
[Wait] (None) Waits for this app's window to appear before launching the next item. [1] Server [Wait].bat
[Wait=N] (None) Waits for the item with Order N to finish launching. [5] Client [Wait=1].exe
[Delay=T] (None) Sleeps after launching. Supports ms, s, m. [3] DB [Delay=5s].lnk
[Admin] (None) Runs the file as Administrator. CMD [Admin].lnk
[Min] [Minimized] Launches minimized. Spotify [Min].lnk
[Max] [Maximized] Launches maximized. Code [Max].lnk
[Hide] [Hidden] Launches hidden (background processes). Script [Hide].ahk
[ForceKill] [Kill], [KillForce] Forces killing the app instead of graceful closing. Required if you want to forcefully terminate apps in cleanup folders or in cleanup mode. Steam [ForceKill].lnk
[WaitWindow] [WaitWin] Crucial fix for modern apps. Waits for the app to fully load its UI before applying Min/Max/Hide. OneNote [Max] [WaitWin].lnk
[WaitWin=T] (None) Same as above, but specifying a custom wait duration. [WaitWindow=500ms]

🧩 Advanced Tracking

Different apps behave differently. Use these tags to ensure the script tracks the correct window/process for cleanup.

Tag Behavior & Use Case Cleanup Action
Standard (Default) Tracks the Process ID (PID) returned by Windows. Good for standard apps (Notepad, Paint). Closes specific PID.
[Match=Name] Wrapper Scripts. If you launch a .bat, use this to track the actual app it starts.
[Match=wt.exe] ignores the .bat PID and waits for wt.exe.
Closes specific window/PID of the matched app.
[HWND] Specific Windows. Forces tracking by Window Handle instead of PID. Useful if an app changes PIDs rapidly but keeps the window open. Closes specific Window Handle.
[TrackExe] Electron / Multi-Process Apps. Tracks by Executable Name.
Use this for Discord, Slack, VS Code.
Kills ALL instances of that executable name found on the system.

Tag Aliases:

  • [HWND] can also be written as [Win] or [Window].
  • [TrackExe] can also be written as [Exe] or [ByExe].

πŸ“‚ Magic Folders

Create subfolders inside your workspace to apply rules to everything inside them. Note: Folder names are Strict (no aliases allowed) but Case-Insensitive.

Folder Name Launch Behavior Cleanup Behavior Use Case
Minimized Launch Minimized. Standard Close. Background music/chats.
Maximized Launch Maximized. Standard Close. Main work tools.
Hidden Launch Hidden. Standard Close. Servers/Scripts.
Monitor2 Move to Monitor 2. Standard Close. Secondary screen apps.
CloseOnLaunch Gracefully Close these apps. Ignored. "Close Steam when I start Work".
AlwaysClose Gracefully Close app. Gracefully Close app. Ensure app is closed on Start AND Stop.
CloseOnCleanup Ignored. Gracefully Close app. Close apps only when finishing session.
Ignore Ignored. Ignored. Storage / Assets.

Pro Tip: To Kill (Force Terminate) an app in a Close folder instead of gracefully closing it, add the [ForceKill] tag to the shortcut filename.

  1. If you place a Folder Shortcut inside a Close magic folder, the script will attempt to close the specific Explorer window matching that folder's name. It will not kill explorer.exe.

πŸ”§ Technical Details & Safety

Session Log (%Temp%\Workspace_Session.log)

The script creates a session log to track what it launched.

  • Session ID: The log is stamped with the computer's Boot Time. If you restart your PC, the script detects the timestamp mismatch and discards the old log to prevent killing incorrect PIDs (BSOD prevention).
  • Format: TYPE | ID | TARGET | FORCE_FLAG | HIDDEN_FLAG

Cleanup Logic

  • Interactive (Ctrl+Shift): Reads the log and presents a GUI to uncheck apps you want to save.
  • Standard: Reads the log in reverse order (LIFO).
    • PID/HWND: Sends WinClose. If [ForceKill] is used, sends ProcessClose.
    • EXE: Kills all processes matching that name.
  • Safety: Critical system processes (e.g., svchost.exe, csrss.exe) are blacklisted and cannot be killed by this script.

πŸ›  Troubleshooting & Tips

1. App launches but Min/Max/Hide doesn't work?

  • Cause: The app takes too long to initialize its window, or the script acted too fast on a splash screen/helper window.
  • Fix: Add [WaitWindow] tag. This forces the script to wait until the app is "Input Idle" (ready) before sending window commands.

2. Script tracks the wrong thing (e.g., a Batch file instead of the App)?

  • Cause: You are launching a wrapper script/launcher.
  • Fix: Add [Match=RealApp.exe]. The script will ignore the Batch file PID and wait for RealApp.exe to appear.

3. Electron Apps (Discord, VS Code, Slack) behaving weirdly?

  • Cause: These apps spawn multiple processes and invisible utility windows.
  • Fix: Use [TrackExe]. This tells the script to stop worrying about specific PIDs and just manage the "Application" as a whole.
  • Example: [TrackExe] [Match=Discord.exe] Discord.lnk

4. Background/Tray Apps not closing?

  • Cause: Apps that minimize to tray often ignore standard "Close" commands.
  • Fix: Add [ForceKill]. This uses ProcessClose which terminates them instantly.

5. Some Modern Apps showing "Phantom Windows" or blocked inputs?

  • Cause: The script grabbed a hidden 1x1 pixel helper window instead of the main UI.
  • Fix: Add [WaitWindow]. The script uses intelligent logic to filter out invisible windows, but it needs the main window to actually exist first.

6. General Stability

  • If your PC is slow or apps launch heavily, use [Delay=1s] between heavy items to prevent CPU choking.

About

A lightweight but powerful workspace launcher that uses folders. Launch and manage your apps easily by placing shortcuts inside a workspace folder and renaming them.

Resources

License

Stars

Watchers

Forks

Packages

No packages published