Package: logitech-flow-kvm
Quickly switch between paired devices when using a Logitech mouse and keyboard that supports connecting to multiple devices.Do you use Logitech devices that support multiple hosts and find it a little frustrating how tedious it is to switch between hosts when you're using Linux due to Logitech's "Flow" features being unsupported there?  Good news: you can have "Flow"-like features on Linux now, too.This utility works by monitoring one of your attached Logitech devices to see what host it is currently connected to, and then, if that host changes, instructing other connected devices to switch to the same host.FeaturesAutomatically switches all devices from one host to another when just one of your devices switches hosts.  This is particularly useful if you are using a a device like the MX Keys Mini which includes buttons that can be used for switching hosts with a single keypress.Securely keeps clipboards in sync when switching between hosts. Now you can copy/paste from one host to another without thinking anything about it.Installationpip install logitech-flow-kvmYou can also install the in-development version with:pip install https://github.com/coddingtonbear/logitech-flow-kvm/archive/master.zipBasic UseOne of your computers will serve as the "server" for managing this, and all others will be "clients".ServerOn the computer you've decided to use as your server, get the ID of the device you'd like to serve as your "leader", and the IDs of other devices you'd like to use as "followers".  The leader device -- I recommend using your keyboard -- will be the one we watch.  The followers will just be told which host to connect to if your leader device's host changes.> logitech-flow-kvm list-devices

┏━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ ID             ┃ Product ┃ Name                       ┃ Serial   ┃
┡━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ /dev/hidraw4:1 │ B369    │ MX Keys Mini               │ 08F5F681 │
│ /dev/hidraw5:1 │ 4082    │ MX Master 3 Wireless Mouse │ 0F591C09 │
└────────────────┴─────────┴────────────────────────────┴──────────┘In this example, I'll be using my keyboard (/dev/hidraw4:1) as my "leader", and my mouse (/dev/hidraw5:1) as a follower.You can run a command like this:> logitech-flow-kvm flow-server 1 /dev/hidraw4:1 /dev/hidraw5:1Note that the1in the above command immediately afterflow-serverindicates that the host number of your server is1.  This should match the host number you've paired your mouse and keyboard with your device as (i.e. when your mouse or keyboard is connected to this computer, the light for1is lit on the keyboard or mouse's device selector).After running the above command, you'll receive some output indicating what hostnames the server was bound to; on my computer, this looks like this:...
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:24801
 * Running on http://10.224.224.120:24801
...From the above lines, you'll want to select an IP address that can be reached from your clients.  In my case, I'll be using10.224.224.120for connections from the clients to the server.ClientOn the other computers you'd like to use this feature with, you can run the following command:> logitech-flow-kvm flow-client 2 10.224.224.120If this is your first time connecting to this server, you will be walked through a brief pairing process for establishing a secure connection between your server and client instances.  Afterward, the client will connect, gather some configuration options from the server, and will instruct your "follower" devices to change their hosts as necessary in the future.Note that the2above afterflow-clientindicates the host number your devices have paired with your computer under.  See "Server" above for details.How toFinding available devicesYou can get a list of available devices using thelist-devicessubcommand:> logitech-flow-kvm list-devices

Finding devices... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
┏━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ ID             ┃ Product ┃ Name                       ┃ Serial   ┃
┡━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ /dev/hidraw4:1 │ B369    │ MX Keys Mini               │ 08F5F681 │
│ /dev/hidraw5:1 │ 4082    │ MX Master 3 Wireless Mouse │ 0F591C09 │
└────────────────┴─────────┴────────────────────────────┴──────────┘Switching which host a device is connected toYou can change the relevant device to your desired host number using theswitch-to-hostcommand:> logitech-flow-kvm switch-to-host /dev/hidraw4:1 2The above command will tell the device having the id/dev/hidraw4:1to connect to whichever device is paired as its #2device.Running a command when a device connects or disconnectsYou can see when a device connects or disconnects from the receiver using the following example:> logitech-flow-kvm watch /dev/hidraw4:1If you'd like to run a command when a device connects or disconnects, use the--on-disconnect-executeor--on-connect-executearguments.  See the "Automatically switch your mouse to a different host when your keyboard disconnects" section below for a concrete example of how you might use this.Automatically switch your mouse to a different host when your keyboard disconnectsNote: this isn't the recommended way of handling this sort of thing -- you probably want to follow the instructions above under "Basic Use" above.If you have two devices:> logitech-flow-kvm list-devices

┏━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ ID             ┃ Product ┃ Name                       ┃ Serial   ┃
┡━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ /dev/hidraw4:1 │ B369    │ MX Keys Mini               │ 08F5F681 │
│ /dev/hidraw5:1 │ 4082    │ MX Master 3 Wireless Mouse │ 0F591C09 │
└────────────────┴─────────┴────────────────────────────┴──────────┘You can respond run a command that will listen to when the "MX Keys Mini" device above disconnects, and when it does, ask the "MX Master 3 Wireless Mouse" to connect to a specific host:> logitech-flow-kvm watch --on-disconnect-execute="logitech-flow-kvm switch-to-host /dev/hidraw5:1 2" /dev/hidraw4:1CreditsMuch of what this tool does is dependent upon the work put together by the folks working onSolaar.