Code Monkey home page Code Monkey logo

Comments (1)

KarsMulder avatar KarsMulder commented on June 12, 2024

Maybe something like the following can solve your problem?

    --input  /dev/input/by-id/YOUR_KEYBOARD                                               persist=reopen domain=kb grab \
    --input  /dev/input/by-id/usb-SteelSeries_SteelSeries_Aerox_3_Wireless-event-mouse    persist=reopen domain=ms grab \
    --toggle @kb @guest-kb @host-kb @gmac-kb @hmac-kb \
    --toggle @ms @guest-ms @host-ms @gmac-kb @hmac-kb \
    --hook   key:leftalt@host-kb    key:rightalt@host-kb    toggle=:1 exec-shell="sudo ddcutil --display=1 setvcp 60 0x0f" \
    --hook   key:leftshift@host-kb  key:rightshift@host-kb  toggle=:4 exec-shell="barrierctl switchtob" \
    --hook   key:leftalt@guest-kb   key:rightalt@guest-kb   toggle=:2 exec-shell="sudo ddcutil --display=1 setvcp 60 0x13" \
    --hook   key:leftshift@guest-kb key:rightshift@guest-kb toggle=:3 exec-shell="barrierctl switchtob" \
    --hook   key:leftalt@gmac-kb    key:rightalt@gmac-kb    toggle=:4 exec-shell="sudo ddcutil --display=1 setvcp 60 0x13" \
    --hook   key:leftshift@gmac-kb  key:rightshift@gmac-kb  toggle=:1 exec-shell="barrierctl switchtoa" \
    --hook   key:leftalt@hmac-kb    key:rightalt@hmac-kb    toggle=:3 exec-shell="sudo ddcutil --display=1 setvcp 60 0x0f" \
    --hook   key:leftshift@hmac-kb  key:rightshift@hmac-kb  toggle=:2 exec-shell="barrierctl switchtoa" \
    --output @host-kb @hmac-kb @gmac-kb create-link=/dev/input/by-id/host-kbd   \
    --output @host-ms @hmac-ms @gmac-ms create-link=/dev/input/by-id/host-mouse \
    --output @guest-kb create-link=/dev/input/by-id/guest-kbd \
    --output @guest-ms create-link=/dev/input/by-id/guest-mouse

It internally considers four different states: (1) guest screen is active, controlling main pc; (2) host screen active, controlling main pc, (3) guest screen active, controlling mac, (4) host screen active, controlling mac,. For each of those four states, it provides hotkeys to transition between them. Whenever either the host screen is active or the mac is being controlled, the keys are outputted on the host devices.

(Yes, I acknowledge that the above script is a bit unwieldy.)

from evsieve.

Related Issues (20)

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.