{"id":24905923,"url":"https://github.com/code-jl/windows-display-switcher-nircmd-","last_synced_at":"2025-09-02T15:05:30.449Z","repository":{"id":275343418,"uuid":"925809205","full_name":"Code-JL/Windows-Display-Switcher-NirCMD-","owner":"Code-JL","description":"A simple Windows batch script for toggling your primary display using NirCMD. Perfect for multi-monitor setups!","archived":false,"fork":false,"pushed_at":"2025-02-01T20:02:58.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T21:48:09.735Z","etag":null,"topics":["automation","batch-script","desktop-management","display-switch","multi-monitor","nircmd","productivity","script","toggle-display","windows"],"latest_commit_sha":null,"homepage":"","language":"Batchfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Code-JL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-01T19:52:16.000Z","updated_at":"2025-02-01T20:03:23.000Z","dependencies_parsed_at":"2025-02-01T20:30:29.742Z","dependency_job_id":"67c38ad0-67c8-4d19-b2ac-2523f831097a","html_url":"https://github.com/Code-JL/Windows-Display-Switcher-NirCMD-","commit_stats":null,"previous_names":["code-jl/windows-display-switcher-nircmd-"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Code-JL/Windows-Display-Switcher-NirCMD-","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-JL%2FWindows-Display-Switcher-NirCMD-","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-JL%2FWindows-Display-Switcher-NirCMD-/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-JL%2FWindows-Display-Switcher-NirCMD-/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-JL%2FWindows-Display-Switcher-NirCMD-/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Code-JL","download_url":"https://codeload.github.com/Code-JL/Windows-Display-Switcher-NirCMD-/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-JL%2FWindows-Display-Switcher-NirCMD-/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273301876,"owners_count":25081105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","batch-script","desktop-management","display-switch","multi-monitor","nircmd","productivity","script","toggle-display","windows"],"created_at":"2025-02-02T00:26:02.829Z","updated_at":"2025-09-02T15:05:30.397Z","avatar_url":"https://github.com/Code-JL.png","language":"Batchfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Windows Display Switcher (NirCMD)\n\n## Overview\nThis is a simple Windows batch script that toggles the primary display using [NirCMD](https://www.nirsoft.net/utils/nircmd.html). It maintains a record of the last active display and switches between two predefined monitors.\n\n## Prerequisites\n- [NirCMD](https://www.nirsoft.net/utils/nircmd.html) must be downloaded and placed in a directory accessible via the system `PATH`, or stored in the same folder as this script.\n\n### **Typical System Path for NirCMD**\nBy default, you can place `nircmd.exe` in one of the following locations:\n- `C:\\Windows\\System32\\`\n- `C:\\Windows\\`\n- A custom folder added to the system `PATH`\n\nIf NirCMD is not found when running the script, ensure that it is correctly placed in one of these directories or explicitly specify its full path in the batch script.\n\n## Usage\n1. Ensure NirCMD is installed and accessible.\n2. Run `switch_display.bat` to toggle between displays.\n3. The script stores the last active display in `active.txt` and switches accordingly.\n\n## How It Works\n- If `active.txt` exists, the script reads the last used display.\n- Based on the stored value, it switches to the alternate display.\n- If `active.txt` does not exist, it defaults to display `1`.\n\n## Creating a Shortcut for Easy Access\nIf you want to quickly run this script without navigating to its location, you can create a desktop shortcut:\n\n1. **Right-click** on `switch_display.bat` and select **Create Shortcut**.\n2. **Move** the shortcut to your desktop or any convenient location.\n3. **(Optional)** Right-click the shortcut, go to **Properties**, and:\n   - Under **Shortcut** → **Run**, select **Minimized** to prevent a visible command prompt window.\n   - Click **Advanced** and check **Run as administrator** (if needed).\n4. **Double-click** the shortcut to switch displays instantly.\n\nAlternatively, you can assign a keyboard shortcut:\n1. Open **Properties** of the shortcut.\n2. Click inside the **Shortcut key** field.\n3. Press a combination like `Ctrl + Alt + D` (or another preferred combination).\n4. Click **OK** to save.\n\nNow, you can switch displays with a single shortcut key!\n\n## Example\nIf the current primary display is `1`, running the script will switch to display `2`, and vice versa.\n\n## Notes\n- This script assumes you have exactly two displays (`1` and `2`). If your setup is different, modify the script accordingly.\n- Ensure the script has permission to modify `active.txt` in its directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-jl%2Fwindows-display-switcher-nircmd-","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode-jl%2Fwindows-display-switcher-nircmd-","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-jl%2Fwindows-display-switcher-nircmd-/lists"}