Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logid service fails to start properly after boot and a config for MX master 3S #481

Open
MatinEbrahimkhani opened this issue Nov 25, 2024 · 1 comment

Comments

@MatinEbrahimkhani
Copy link

Hey everyone, I just finished customizing the LogiOps configuration for MX Master 3S. I think you can use the configuration and change it to meet your needs. Anyway, here is my config file. If you have any questions, please comment.

devices: (
  {
    name: "MX Master 3S";
    smartshift: {
      on: true;
      threshold: 20;
    };
    hiresscroll: {
      hires: true;
      invert: false;
      target: false;
    };
    dpi: 1300; // max=4000
    buttons: (
      {
        cid: 0x56; // Forward button
        action = {
          type: "Gestures";
          gestures: (
              {
                direction: "None",
                mode: "OnRelease",
                
                action: {
                  type: "Keypress",
                  keys: ["KEY_LEFTCTRL", "KEY_C"]
                }
              },
              {
                direction: "Left",
                mode: "OnRelease",
                threshold: 20;
                action: {
                  type: "Keypress",
                  keys: ["KEY_BACK"]
                }
              },
              {
                direction: "Right",
                mode: "OnRelease",
                threshold: 20;
                action: {
                  type: "Keypress",
                  keys: ["KEY_FORWARD"]
                }
              }
         )
        }  
      },
      {
        cid: 0x53; // Back button
        action = {
          type: "Gestures";
          gestures: (
              {
                direction: "None",
                mode: "OnRelease",
                
                action: {
                  type: "Keypress",
                  keys: ["KEY_LEFTCTRL", "KEY_V"]  // This sends Ctrl+V for paste
                }
              },
              {
                direction: "Left",
                mode: "OnRelease",
                threshold: 20;
                action: {
                  type: "Keypress",
                  keys: ["KEY_BACK"]
                }
              },
              {
                direction: "Right",
                mode: "OnRelease",
                threshold: 20;
                action: {
                  type: "Keypress",
                  keys: ["KEY_FORWARD"]
                }
              }
         )
        } 
      },
      {
        cid: 0xc3; // Thumb button
        action = {
          type: "Gestures";
          gestures: (
            {
              direction: "Up";
             mode: "OnInterval";
            threshold: 20;
            interval: 50;
            action = {
              type: "Keypress";
              keys: [ "KEY_VOLUMEUP" ]; // Volume up
              };
            },
            {
              direction: "Down";
             mode: "OnInterval";
            threshold: 20;
            interval: 50;
            action = {
              type: "Keypress";
              keys: [ "KEY_VOLUMEDOWN" ]; // Volume Down
              };
            },
            {
              direction: "Left";
              mode: "OnRelease";
              action = {
                type: "Keypress";
                keys: ["KEY_PREVIOUSSONG"];
              };
            },
            {
              direction: "Right";
              mode: "OnRelease";
              action = {
                type: "Keypress";
                keys: ["KEY_NEXTSONG"];
              };
            },
            {
              direction: "None";
              mode: "OnRelease";
              action = {
                type: "Keypress";
                keys: ["KEY_PLAYPAUSE"];
              };
            }
          );
        };
      },
      {
    # Button behind the scroll
    cid: 0xc4;
    action =
    {
      type = "ToggleSmartshift";
    };
  }
    );
  }
);
@MatinEbrahimkhani
Copy link
Author

hello again i encountered a problem and here I am sharing my solution

Issue: logid service fails to start properly after boot

System Details

  • OS: Manjaro Linux
  • Architecture: x86_64
  • Kernel: 6.10.13-3-MANJARO
  • Desktop Environment: GNOME
  • systemd version: 256 (256.6-1-manjaro)

Package Information

  • logid version: v0.3.5

Device Information

  • Device: Logitech MX Master 3S
    Note: Device appears to be connected via a Logitech Unifying receiver, but not showing in lsusb output at the moment of running the command.

Problem Description

The logid service was failing to start properly after system boot, although it worked fine when manually restarted using systemctl restart logid. The service was enabled but inactive after boot.

Solution

The issue was resolved by modifying the systemd service file to include a small delay and proper service dependencies.

Original service file at /usr/lib/systemd/system/logid.service:

[Unit]
Description=Logitech Configuration Daemon
StartLimitIntervalSec=0
After=multi-user.target
Wants=multi-user.target

[Service]
Type=simple
ExecStart=/usr/bin/logid
User=root

[Install]
WantedBy=graphical.target

Modified service file that fixes the issue:

[Unit]
Description=Logitech Configuration Daemon
StartLimitIntervalSec=0
After=multi-user.target bluetooth.service
Wants=multi-user.target

[Service]
Type=simple
ExecStart=/usr/bin/logid
User=root
Restart=on-failure
RestartSec=3
ExecStartPre=/bin/sleep 2

[Install]
WantedBy=graphical.target

Key Changes

  1. Added ExecStartPre=/bin/sleep 2 to give USB devices time to initialize
  2. Added bluetooth.service dependency
  3. Added Restart configuration for better reliability
  4. Added RestartSec to prevent rapid restart cycles

Steps to Apply Fix

  1. Edit the service file:
sudo nano /usr/lib/systemd/system/logid.service
  1. Reload systemd configuration:
sudo systemctl daemon-reload
  1. Restart the service
sudo systemctl restart logid
  1. Enable the service if not already enabled:
sudo systemctl enable logid

Configuration File

For reference, here's my working /etc/logid.cfg:

devices: (
  {
    name: "MX Master 3S";
    smartshift: {
      on: true;
      threshold: 20;
    };
    hiresscroll: {
      hires: true;
      invert: false;
      target: false;
    };
    dpi: 1300;
    buttons: (
      {
        cid: 0x56;
        action: {
          type: "Gestures";
          gestures: (
            {
              direction: "None";
              mode: "OnRelease";
              action: {
                type: "Keypress";
                keys: ["KEY_LEFTCTRL", "KEY_C"];
              };
            },
            {
              direction: "Left";
              mode: "OnRelease";
              threshold: 20;
              action: {
                type: "Keypress";
                keys: ["KEY_BACK"];
              };
            },
            {
              direction: "Right";
              mode: "OnRelease";
              threshold: 20;
              action: {
                type: "Keypress";
                keys: ["KEY_FORWARD"];
              };
            }
          );
        };
      },
      {
        cid: 0x53;
        action: {
          type: "Gestures";
          gestures: (
            {
              direction: "None";
              mode: "OnRelease";
              action: {
                type: "Keypress";
                keys: ["KEY_LEFTCTRL", "KEY_V"];
              };
            },
            {
              direction: "Left";
              mode: "OnRelease";
              threshold: 20;
              action: {
                type: "Keypress";
                keys: ["KEY_BACK"];
              };
            },
            {
              direction: "Right";
              mode: "OnRelease";
              threshold: 20;
              action: {
                type: "Keypress";
                keys: ["KEY_FORWARD"];
              };
            }
          );
        };
      },
      {
        cid: 0xc3;
        action: {
          type: "Gestures";
          gestures: (
            {
              direction: "Up";
              mode: "OnInterval";
              threshold: 20;
              interval: 50;
              action: {
                type: "Keypress";
                keys: ["KEY_VOLUMEUP"];
              };
            },
            {
              direction: "Down";
              mode: "OnInterval";
              threshold: 20;
              interval: 50;
              action: {
                type: "Keypress";
                keys: ["KEY_VOLUMEDOWN"];
              };
            },
            {
              direction: "Left";
              mode: "OnRelease";
              action: {
                type: "Keypress";
                keys: ["KEY_PREVIOUSSONG"];
              };
            },
            {
              direction: "Right";
              mode: "OnRelease";
              action: {
                type: "Keypress";
                keys: ["KEY_NEXTSONG"];
              };
            },
            {
              direction: "None";
              mode: "OnRelease";
              action: {
                type: "Keypress";
                keys: ["KEY_PLAYPAUSE"];
              };
            }
          );
        };
      },
      {
        cid: 0xc4;
        action: {
          type: "ToggleSmartshift";
        };
      }
    );
  }
);

Verification

After applying these changes and rebooting, the service starts properly and the device is detected immediately:

● logid.service - Logitech Configuration Daemon
     Loaded: loaded (/usr/lib/systemd/system/logid.service; enabled; preset: disabled)
     Active: active (running) since Tue 2024-12-03 16:26:19 +0330; 1min 9s ago
     Main PID: 2445 (logid)
Dec 03 16:26:19 asus systemd[1]: Started Logitech Configuration Daemon.
Dec 03 16:26:19 asus logid[2445]: [INFO] Device found: MX Master 3S on /dev/hidraw5:255

I hope this helps others experiencing similar issues

@MatinEbrahimkhani MatinEbrahimkhani changed the title Custom config for MX Master 3S logid service fails to start properly after boot and a config for MX master 3S Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant