Git Product home page Git Product logo

screen-switch's Introduction

screen-switch

An example of an HTTP server that switches screen inputs by calling a DDC utility.

IMG_2850.mov

Problem

It's difficult or cumbersome to switch inputs using the controls on the monitors. An example might be where you have a multi-monitor setup and want to quickly and easily switch between a Mac and another computer.

Solution

A web server runs on one of the machines with an interface allowing you to select a computer. This script is a really basic example of how this could be accomplished.

It could be adapted to work on any operating system, but in this case it expects the server to run on an M1 Mac.

Installation

  • Install m1ddc (Homebrew makes it easy) if using an Apple Silicon Mac as the server.
  • Python 3 is required, and Flask should be installed by running pip install -r requirements.txt in the repo root.

Setup

  • The switch_to_mac.sh and switch_to_pc.sh shell scripts need to be updated to the appropriate number of displays and the input values.
    • If running on a machine that's not macOS or not Apple Silicon, this is where you'd substitute the m1ddc utility with something else.
    • If using m1ddc:
      • See Commands section
      • Keep in mind that this utility expects addresses to be decimal, not hex.
  • switcher.py
    • Update or remove the filter_ips() hook.
    • Optionally update the port (defaults to 9000).

Running

  • python3 switcher.py
  • Load the utility in a browser: http://hostname:9000

screen-switch's People

Contributors

twstokes avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.