Restore HID++ for Nobara->Mac, keep Mac->Nobara monitor-only

This commit is contained in:
2026-02-01 18:31:49 +02:00
parent 663542ff17
commit 546adad373
2 changed files with 79 additions and 43 deletions

View File

@@ -1,7 +1,5 @@
# KVM Switch: Mac ↔ Nobara # KVM Switch: Mac ↔ Nobara
Simple monitor switching via DDC/CI. Peripherals switched manually via Easy-Switch button.
## Hardware ## Hardware
- **Monitor:** Dell U3821DW (USB-C to Mac, HDMI 2 to Nobara) - **Monitor:** Dell U3821DW (USB-C to Mac, HDMI 2 to Nobara)
@@ -10,6 +8,13 @@ Simple monitor switching via DDC/CI. Peripherals switched manually via Easy-Swit
- **Bolt #1:** Connected to Nobara (Channel 2) - **Bolt #1:** Connected to Nobara (Channel 2)
- **Bolt #2:** Connected to Mac via monitor USB hub (Channel 3) - **Bolt #2:** Connected to Mac via monitor USB hub (Channel 3)
## Switching Behavior
| Direction | Monitor | Peripherals |
|-----------|---------|-------------|
| Nobara → Mac | Auto (DDC) | Auto (HID++) |
| Mac → Nobara | Auto (DDC) | Manual Easy-Switch |
## Channel Setup ## Channel Setup
| Channel | Connection | Computer | | Channel | Connection | Computer |
@@ -17,66 +22,71 @@ Simple monitor switching via DDC/CI. Peripherals switched manually via Easy-Swit
| 2 | Bolt #1 | Nobara | | 2 | Bolt #1 | Nobara |
| 3 | Bolt #2 | Mac | | 3 | Bolt #2 | Mac |
## Mac Setup ---
### Install m1ddc
```bash
brew install m1ddc
```
### Copy script
```bash
mkdir -p ~/scripts
cp to_nobara.sh ~/scripts/
chmod +x ~/scripts/to_nobara.sh
```
### Usage
```bash
~/scripts/to_nobara.sh
# Then press Easy-Switch on keyboard/mouse to Channel 2
```
## Nobara Setup ## Nobara Setup
### Install ddcutil ### 1. Install dependencies
```bash ```bash
sudo dnf install ddcutil sudo dnf install ddcutil
sudo usermod -aG i2c $USER sudo usermod -aG i2c $USER
# Reboot required # Reboot required for i2c group
``` ```
### Copy script ### 2. Install hidapitester
```bash
mkdir -p ~/bin
curl -sL https://github.com/todbot/hidapitester/releases/latest/download/hidapitester-linux-amd64.zip -o /tmp/hidapitester.zip
unzip -o /tmp/hidapitester.zip -d ~/bin/
chmod +x ~/bin/hidapitester
```
### 3. Udev rule for Bolt
```bash
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c548", MODE="0666"' | sudo tee /etc/udev/rules.d/99-logitech-bolt.rules
sudo udevadm control --reload-rules && sudo udevadm trigger
```
### 4. Copy script
```bash ```bash
mkdir -p ~/scripts mkdir -p ~/scripts
cp to_mac.sh ~/scripts/ cp to_mac.sh ~/scripts/
chmod +x ~/scripts/to_mac.sh chmod +x ~/scripts/to_mac.sh
``` ```
### Set keyboard shortcut (GNOME) ### 5. Keyboard shortcut (Ctrl+Shift+Up)
Settings → Keyboard → Custom Shortcuts:
- Name: KVM to Mac
- Command: /home/USER/scripts/to_mac.sh
- Shortcut: Ctrl+Shift+Up
---
## Mac Setup
### 1. Install m1ddc
```bash ```bash
# Add custom shortcut for Ctrl+Shift+Up brew install m1ddc
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/kvm/']"
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/kvm/ name 'KVM to Mac'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/kvm/ command '/home/$USER/scripts/to_mac.sh'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/kvm/ binding '<Shift><Control>Up'
``` ```
### Usage ### 2. Copy script
```bash ```bash
~/scripts/to_mac.sh mkdir -p ~/scripts
# Then press Easy-Switch on keyboard/mouse to Channel 3 cp to_nobara.sh ~/scripts/
chmod +x ~/scripts/to_nobara.sh
``` ```
### 3. Usage
```bash
~/scripts/to_nobara.sh
# Then press Easy-Switch on keyboard/mouse to Channel 2
```
---
## DDC Input Codes (Dell U3821DW) ## DDC Input Codes (Dell U3821DW)
| Input | Code | | Input | Code |
|-------|------| |-------|------|
| HDMI 2 | 18 | | HDMI 2 | 18 |
| USB-C | 27 | | USB-C | 27 |
## Troubleshooting
### Monitor doesn't switch
- Enable DDC/CI: Monitor Menu → Others → DDC/CI → On
- Linux: Ensure user in i2c group, reboot after adding

View File

@@ -1,12 +1,38 @@
#!/bin/bash #!/bin/bash
# KVM Switch: Nobara → Mac # KVM Switch: Nobara → Mac
# Switches monitor to USB-C # Switches monitor to USB-C and peripherals to Host 3 (Mac)
# Peripherals: manually press Easy-Switch to Channel 3 #
# Device mapping:
# Keyboard: device 0x02, feature 0x0A
# Mouse: device 0x03, feature 0x0E
#
# Host mapping:
# Host 2 (0x01): Nobara
# Host 3 (0x02): Mac
HIDAPITESTER="$HOME/bin/hidapitester"
echo "Switching to Mac..." echo "Switching to Mac..."
# 1. Switch Mouse to Host 3 (Mac)
echo " Mouse -> Mac..."
"$HIDAPITESTER" --vidpid 046d/c548 --usage 0x0001 --usagePage 0xff00 \
--open --length 7 --send-output 0x10,0x03,0x0E,0x10,0x02,0x00,0x00 2>/dev/null || \
echo " [WARN] Mouse switch failed"
# 2. Switch Keyboard to Host 3 (Mac)
echo " Keyboard -> Mac..."
"$HIDAPITESTER" --vidpid 046d/c548 --usage 0x0001 --usagePage 0xff00 \
--open --length 7 --send-output 0x10,0x02,0x0A,0x10,0x02,0x00,0x00 2>/dev/null || \
echo " [WARN] Keyboard switch failed"
# 3. Switch Monitor to USB-C
echo " Monitor -> USB-C..." echo " Monitor -> USB-C..."
if command -v ddcutil &>/dev/null; then if command -v ddcutil &>/dev/null; then
ddcutil setvcp 60 27 2>/dev/null && echo "Done! Press Easy-Switch for Channel 3" || echo "Monitor switch failed" ddcutil setvcp 60 27 2>/dev/null || \
echo " [WARN] Monitor switch failed"
else else
echo "ddcutil not installed: sudo dnf install ddcutil" echo " [WARN] ddcutil not installed"
fi fi
echo "Done!"