{"id":31920314,"url":"https://github.com/3urobeat/display-input-switcher","last_synced_at":"2025-10-13T21:58:33.948Z","repository":{"id":308382900,"uuid":"1031995202","full_name":"3urobeat/display-input-switcher","owner":"3urobeat","description":"🖥️ Script to switch monitor inputs via DDC/CI [Supports Linux \u0026 Windows]","archived":false,"fork":false,"pushed_at":"2025-08-05T17:27:37.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-05T17:40:55.178Z","etag":null,"topics":["bash","batch","ddcci","display","linux","monitor","script","windows"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/3urobeat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-08-04T16:34:44.000Z","updated_at":"2025-08-05T17:21:06.000Z","dependencies_parsed_at":"2025-08-05T17:40:57.175Z","dependency_job_id":"d036b844-ebe6-4562-a4b1-8b256bd71bfb","html_url":"https://github.com/3urobeat/display-input-switcher","commit_stats":null,"previous_names":["3urobeat/display-input-switcher"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/3urobeat/display-input-switcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3urobeat%2Fdisplay-input-switcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3urobeat%2Fdisplay-input-switcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3urobeat%2Fdisplay-input-switcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3urobeat%2Fdisplay-input-switcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3urobeat","download_url":"https://codeload.github.com/3urobeat/display-input-switcher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3urobeat%2Fdisplay-input-switcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017012,"owners_count":26085952,"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-10-13T02:00:06.723Z","response_time":61,"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":["bash","batch","ddcci","display","linux","monitor","script","windows"],"created_at":"2025-10-13T21:58:31.895Z","updated_at":"2025-10-13T21:58:33.940Z","avatar_url":"https://github.com/3urobeat.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# display-input-switcher\nScripts to quickly switch between two inputs of one of your connected displays.\n\nUsing two computers on a display with a built in KVM is awesome!  \n...but it quickly becomes cumbersome when you have to navigate the OSD to switch between them.  \nThe script, optimally bound to a hotkey, does this for you in 1 second!  \n\nSupport for **Linux** (Bash script '.sh') \u0026 **Windows** 10 (Batch script '.bat').\n\n\u0026nbsp;\n\n**Contents:**\n- [Prerequisites](#prerequisites)\n- [Configuration](#configuration)\n- [Optimizing performance (Linux only)](#optimizing-performance)\n- [Setting a hotkey](#hotkey)\n- [Switching multiple monitors](#multiple-monitors)\n\n\u0026nbsp;\n\n\u003ca id=\"prerequisites\"\u003e\u003c/a\u003e\n\n## 🔍 Prerequisites\nYour display needs to support DDC/CI and expose the feature to select an input.  \n*Most* modern monitors do this.\n\n### Linux:  \nYou need to have 'ddcutil' installed. Load the kernel module with `sudo modprobe i2c-dev` or reboot your computer after installing it.  \nRun `ddcutil detect` to check if your monitor is being detected.\n\n### Windows:\nYou need to download [winddcutil.exe](https://github.com/scottaxcell/winddcutil/releases/tag/v2.0.0).  \nIt is sadly a bit more complicated to configure the script with, as it does not provide any descriptions, unlike ddcutil. I recommend using Linux instead ;)  \nOpen a PowerShell in the same folder and run `winddcutil.exe detect` to check if your monitor is being detected.\n\n\u0026nbsp;\n\n\u003ca id=\"configuration\"\u003e\u003c/a\u003e\n\n## 📝 Configuration\n[Download](https://github.com/3urobeat/display-input-switcher/releases/latest) the appropiate script for your operating system and copy it to e.g. your home directory.\n\n### Linux:\n\u003cdetails\u003e\n\u003csummary\u003eClick to unfold\u003c/summary\u003e\n\nMake the script executable: `chmod +x ./display-input-switcher-linux.sh`\n\nOpen the script using a text editor.  \nOpen a terminal and run the command `ddcutil detect`.\nLook out for the display you want to switch the inputs of (the model number is listed for every entry) and take note of '/dev/i2c-MONITOR_ID'.  \nSet that MONITOR_ID in the script at 'MONITOR_ID'.\n\nIn your terminal, run the command `ddcutil capabilities --bus MONITOR_ID` (replace MONITOR_ID with the value from the previous step).  \nYour monitor, including all of its supported features should be printed out.\n\nLocate a feature called 'Input Source' or 'Select Input' or something along those lines.  \nSet the ID, usually 60, in the script at 'INPUT_CODE'.\n\nYour supported inputs are listed right below. Find the two you want to switch between.  \nSet both values (they are in hex) in the script at INPUT_1 \u0026 2.  \nYou may set a description for both inputs to make the script's output more readable.\n\n**Tip:**  \n\u003e If you always only switch away to one input from this system, you can leave INPUT_2 empty.  \n\u003e This will skip getting the currently selected input to determine which input to switch to and directly switch to INPUT_1, saving you some time.\n\nLastly, if you are sometimes using a third input, you can configure the script to switch to a default input instead of failing.  \nUncomment the optional setting 'DEFAULT_INPUT' and set it to one of the configured inputs.\n\n\u003c/details\u003e\n\n### Windows:\n\u003cdetails\u003e\n\u003csummary\u003eClick to unfold\u003c/summary\u003e\n\nOpen the script using a text editor.  \nOpen a PowerShell in the folder where you put winddcutil.exe and run the command `.\\winddcutil.exe detect`.  \nOne or multiple monitors should get printed out, each starting with an ID.  \n\u003e You can find out which display is the correct one by running `.\\winddcutil.exe capabilities MONITOR_ID`, which will output `model(YOUR_MONITOR_MODEL_NAME)` as one of the first parameters.\n\nIn your open text editor, set the variable 'MONITOR_ID' to the ID of the monitor to switch the input of.  \n\nThe tool winddcutil does sadly not list the description of each feature code but '60' *should* be 'Input Source'.  \nYou should find a list of inputs of your display in the output of `.\\winddcutil.exe capabilities MONITOR_ID` inside brackets after the 'Input Source' feature code. In my case it reads `60(1B 0F 11 )`.  \n\nWhich is which? Well, we again don't know. Awesome! Run `.\\winddcutil.exe setvcp MONITOR_ID 0x60 0x1B` and find out. Repeat this \u0026 replace 0x1B with the other inputs (0x0F and 0x11 here) until you found your two inputs to switch between.  \nSet both values (they are in hex) in the script at INPUT_1 \u0026 2.  \nYou may set a description for both inputs to make the script's output more readable.\n\n**Tip:**  \n\u003e If you always only switch away to one input from this system, you can leave INPUT_2 empty.  \n\u003e This will skip getting the currently selected input to determine which input to switch to and directly switch to INPUT_1, saving you some time.\n\nLastly, if you are sometimes using a third input, you can configure the script to switch to a default input instead of failing.  \nUncomment the optional setting 'DEFAULT_INPUT' and set it to one of the configured inputs.\n\n\u003c/details\u003e\n\n\u003c/br\u003e\n\n\u003e [!NOTE]\n\u003e If 'Input Source' 0x60 is not working for you, check out [this resource](https://github.com/rockowitz/ddcutil/wiki) for monitor/manufacturer specific information.\n\n\u0026nbsp;\n\n\u003ca id=\"optimizing-performance\"\u003e\u003c/a\u003e\n\n## 🚀 Optimizing performance (Linux only)\nWith the current configuration ddcutil does a lot of extra checking \u0026 waiting which takes some time.  \nIf your monitor can handle it, you can disable these checks and in my case reduce the time to switch from 3s to just ~500ms. This drastically improves the user experience.\n\nTo disable these checks, uncomment the variable 'DDCUTIL_OPTIONS' in the script.\n\nShould you notice failed switches, for example due to ddcutil failing to read/write, disable this option again.  \nYou can also attempt to diagnose issues by adding '--stats' to the 'DDCUTIL_OPTIONS' variable. This will tell ddcutil to print execution details for each request.\n\n\u0026nbsp;\n\n\u003ca id=\"hotkey\"\u003e\u003c/a\u003e\n\n## ⌨ Setting a hotkey\n\n### Linux:\nThis is obviously dependent on your Desktop Environment/Window Manager, but here are my two configs:\n\n**KDE Plasma:**  \nFor KDE, open the Hotkeys menu in your system settings.  \nClick + and add a script/command. Select the location of the script in the file picker that'll open up, confirm, configure a hotkey and save.  \nWhenever you now hit the hotkey, KDE will launch the script in the background, which will switch your inputs around.\n\n**Hyprland:**  \nFor Hyprland, open your configuration file at '~/.config/hypr/hyprland' in a text editor.  \nAdd a bind: In this case I chose \u003ckbd\u003eALT\u003c/kbd\u003e+\u003ckbd\u003eG\u003c/kbd\u003e and the script is in my home directory:\n```\nbind = ALT, G, exec, ~/display-input-switcher-linux.sh\n```\nUpon pressing the hotkey, hyprland will launch the script in the background.\n\n\u003e [!NOTE]\n\u003e Be warned that this will hide any logs. Should nothing happen when pressing the hotkey, run the script manually in a terminal to verify where the issue is coming from.\n\n### Windows:\n**Method 1 (PowerToys, better):**  \nIf you have [Microsoft PowerToys](https://learn.microsoft.com/en-us/windows/powertoys/) installed, you can set global hotkeys just like in Linux :D  \n\nOpen the PowerToys settings and go to the Keyboard Manager menu.  \nClick on \"Remap a shortcut\" and in the popup on \"Add key remapping\".  \nInput your desired hotkey and select \"Start App\" in the \"To send:\" column drop down.  \nSelect the bat script, then save.\n\n**Method 2 (native, worse):**  \nIf you don't have access to PowerToys, you can try the native approach.  \nThis is sadly slower, limited to \u003ckbd\u003eCTRL\u003c/kbd\u003e+\u003ckbd\u003eALT\u003c/kbd\u003e+... keybinds \u0026 buggier sometimes.\n\nRight click the script in your file explorer, and click on 'Create shortcut'.  \nRight click the created shortcut, select Properties.  \nSet a hotkey in the 'Shortcut key' field. You may set it to run as minimized as well.  \nSave.\n\nWhen pressing the hotkey, a command window should now pop up (or show up minimized) and switch your input after ~1 second.  \n\u003e When pressing the hotkey for the first time, you may see a \"Run this script?\" popup. Uncheck the checkbox \"Always ask\" and hit run.\n\n\u0026nbsp;\n\n\u003ca id=\"multiple-monitors\"\u003e\u003c/a\u003e\n\n## 🖥️-🖥️ Switching multiple monitors\nSwitching multiple monitors at the same time is not supported by the scripts directly but we can use a little workaround.  \nMake sure you have followed the 'Setting a hotkey' section above.\n\nDuplicate the script and rename them to 'display-input-switcher-linux-display1' and 'display-input-switcher-linux-display2' for example.\n\n### Linux:\nAgain, DE/WM dependent.  \nSimply change the path in your hotkey configuration to run both scripts at the same time:  \n`/path/to/display-input-switcher-linux-display1.sh \u0026 /path/to/display-input-switcher-linux-display2.sh`\n\nOn KDE you can click the pen symbol in the list beside the entry you have created. A popup will appear, allowing you to edit the command.  \nOn Hyprland, simply edit the command being executed in your config file.\n\n### Windows:\nSince Windows is a little *special*, you need a workaround for the workaround:\n- Create another text file, call it 'display-input-switcher-windows.bat'. Make sure it does not end with .txt anymore.\n- Right click it, Edit\n- Paste (after editing '\\path\\to\\'): `start C:\\path\\to\\display-input-switcher-windows-display1.bat \u0026\u0026 C:\\path\\to\\display-input-switcher-windows-display2.bat`\n- Save\n- Delete your old shortcut and create a new one for this file as described in the step above\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3urobeat%2Fdisplay-input-switcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3urobeat%2Fdisplay-input-switcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3urobeat%2Fdisplay-input-switcher/lists"}