Use the Logitech MX Master 3S Smart Shift button, also known as the scroll-wheel mode shift button, to open the GNOME screenshot interface on Ubuntu 24.04.
This setup uses:
- Solaar
- A custom Solaar rule
- A small wrapper script that calls the GNOME screenshot portal
Ubuntu 24.04 LTS
Logitech MX Master 3S
Solaar
GNOME / Wayland
Ubuntu 24.04 may not reliably use the older gnome-screenshot -i flow. The GNOME portal screenshot command works better.
Run:
mkdir -p ~/.local/bin
cat > ~/.local/bin/screenshot-portal <<'EOF'
#!/usr/bin/env bash
gdbus call --session \
--dest org.freedesktop.portal.Desktop \
--object-path /org/freedesktop/portal/desktop \
--method org.freedesktop.portal.Screenshot.Screenshot \
"" \
"{'interactive': <true>}"
EOF
chmod +x ~/.local/bin/screenshot-portalTest the script:
~/.local/bin/screenshot-portalIf the GNOME screenshot interface opens, the script is working.
Start Solaar:
solaarSelect your MX Master 3S device.
In the main Solaar window:
- Find Key/Button Diversion.
- Unlock the setting if needed.
- In the left dropdown, select:
Smart Shift
- In the right dropdown, select:
Diverted
The required setting is:
Key/Button Diversion → Smart Shift → Diverted
Do not select Mouse Gesture Button unless your rule also listens for Mouse Gesture Button.
Open:
Rule Editor
Create a new user-defined rule.
The final rule should look like this:
User-defined rules
└─ Rule
├─ Key Smart Shift (00C4) (pressed)
└─ Execute /home/YOUR_USERNAME/.local/bin/screenshot-portal
Replace YOUR_USERNAME with your Linux username.
Example:
/home/awg/.local/bin/screenshot-portal
In the Rule Editor:
- Right-click inside the new rule.
- Choose:
Insert here → Condition → Key
- Press the physical Smart Shift button on the mouse.
This is the small button behind the scroll wheel.
It should appear as something like:
Smart Shift (00C4) (pressed)
Right-click inside the same rule and choose:
Insert here → Action → Execute
Set the command to the wrapper script path:
/home/YOUR_USERNAME/.local/bin/screenshot-portal
Do not add extra arguments.
Click:
Save changes
Press the MX Master 3S Smart Shift button.
The GNOME screenshot UI should open.
Make sure the diverted button and the rule condition match.
Correct:
Rule condition: Smart Shift (00C4) (pressed)
Key/Button Diversion: Smart Shift → Diverted
Incorrect:
Rule condition: Smart Shift (00C4) (pressed)
Key/Button Diversion: Mouse Gesture Button → Diverted
If these do not match, Solaar will not trigger the rule.
Run:
~/.local/bin/screenshot-portalIf the screenshot UI does not open, fix the script first.
Close Solaar, then run:
solaar -ddPress the mouse button and watch the terminal output.
If you see messages like:
WHEEL: ratchet: 0
then the Smart Shift button is still acting as a wheel-mode toggle and is probably not diverted correctly.
On Wayland, Solaar may show messages like:
rules cannot access modifier keys in Wayland
cannot create uinput device: "/dev/uinput" cannot be opened for writing
Using the Execute action with the GNOME portal command avoids relying on simulated key presses such as Print or Super + Print.
Key/Button Diversion:
Smart Shift → Diverted
Solaar Rule:
Rule
├─ Key Smart Shift (00C4) (pressed)
└─ Execute /home/YOUR_USERNAME/.local/bin/screenshot-portal
Add this section to your Gist.
## 8. Start Solaar automatically from Ubuntu Startup Applications
<img width="611" height="503" alt="image" src="https://gist.github.com/user-attachments/assets/b963687b-4832-47cd-a92f-8af64361a113" />
Solaar must keep running for the custom Smart Shift button mapping to work. If Solaar is closed completely, the mapping stops working.
Ubuntu provides a **Startup Applications** tool for running apps or commands automatically when you log in. You can open it from the Activities overview, or by running `gnome-session-properties`. In the tool, click **Add** and enter the command to run at login. :contentReference[oaicite:0]{index=0}
### Open Startup Applications
Run:
```bash
gnome-session-properties
Or open it from the Ubuntu UI:
- Press the Super key.
- Search for Startup Applications.
- Open Startup Applications Preferences.
Click Add.
Enter:
Name: Solaar
Command: solaar --window=hide
Comment: Start Solaar in background for Logitech mouse mappings
Click Add.
Make sure the new Solaar entry is checked/enabled in the Startup Applications list.
Run:
solaar --window=hide &If Solaar is already running, you may see:
Another Solaar process is already running so just expose its window
That is fine. It means a Solaar process is already active.
Verify with:
pgrep -a solaarIf this prints a Solaar process, Solaar is running and the Smart Shift mapping should work.
- Log out.
- Log back in.
- Press the MX Master 3S Smart Shift button.
The GNOME screenshot UI should open.
Check Solaar’s available options:
solaar --helpIf your Solaar version does not support --window=hide, edit the Startup Applications entry and use:
Command: solaar
This may show the Solaar window at login, but the mapping will still work as long as Solaar is running.
On Wayland, Solaar may print warnings such as:
rules cannot access modifier keys in Wayland
cannot create uinput device: "/dev/uinput" cannot be opened for writing
For this setup, those warnings are usually not a blocker because the Solaar rule uses an Execute action:
Execute /home/YOUR_USERNAME/.local/bin/screenshot-portal
It does not rely on simulated key presses such as Print or Super + Print.
The key UI values are:
```text
Name: Solaar
Command: solaar --window=hide
Comment: Start Solaar in background for Logitech mouse mappings