How to Set Up Desktop Gestures with Cinnamon Desktop on Linux Mint

Learn how to set up desktop gestures with Cinnamon Desktop on Linux Mint.

How to Set Up Desktop Gestures with Cinnamon Desktop on Linux Mint

Touchpad and touch screen gestures can significantly enhance your Linux Mint experience by providing intuitive ways to navigate and control your desktop environment. This comprehensive guide will walk you through setting up and customizing gestures in Cinnamon Desktop.

Understanding Desktop Gestures

Gesture support in Cinnamon includes:

  • Touchpad gestures
  • Touch screen gestures
  • Edge swipes
  • Multi-finger gestures
  • Pinch-to-zoom
  • Custom gesture configurations

Basic Gesture Setup

Enabling Gesture Support

  1. Install required packages:
sudo apt install xdotool wmctrl libinput-tools
sudo apt install python3-pip
pip3 install gestures
  1. Configure libinput:
sudo gpasswd -a $USER input

Basic Touchpad Configuration

  1. Access touchpad settings:

    • Open System Settings
    • Navigate to “Mouse and Touchpad”
    • Select “Touchpad” tab
  2. Enable basic gestures:

    • Two-finger scrolling
    • Tap-to-click
    • Natural scrolling
    • Edge scrolling

Advanced Gesture Configuration

Installing Gesture Management Tools

  1. Install Fusuma:
sudo gem install fusuma
  1. Create configuration directory:
mkdir -p ~/.config/fusuma
  1. Basic configuration file:
# ~/.config/fusuma/config.yml
swipe:
  3:
    left:
      command: 'xdotool key alt+Right'
    right:
      command: 'xdotool key alt+Left'
    up:
      command: 'xdotool key super'
    down:
      command: 'xdotool key super'
  4:
    left:
      command: 'xdotool key ctrl+alt+Right'
    right:
      command: 'xdotool key ctrl+alt+Left'
    up:
      command: 'xdotool key ctrl+alt+Up'
    down:
      command: 'xdotool key ctrl+alt+Down'

Custom Gesture Creation

  1. Configure gesture recognition:
threshold:
  swipe: 0.4
  pinch: 0.4

interval:
  swipe: 0.8
  pinch: 0.8

swipe:
  3:
    begin:
      command: 'notify-send "Gesture Started"'
    update:
      command: 'notify-send "Gesture Updated"'
    end:
      command: 'notify-send "Gesture Ended"'
  1. Create custom commands:
#!/bin/bash
# Custom gesture script
case $1 in
    "workspace-next")
        wmctrl -s $(($(wmctrl -d | grep '*' | cut -d ' ' -f1) + 1))
        ;;
    "workspace-prev")
        wmctrl -s $(($(wmctrl -d | grep '*' | cut -d ' ' -f1) - 1))
        ;;
esac

Touch Screen Configuration

Enable Touch Screen Support

  1. Check touch screen detection:
xinput list
  1. Configure touch screen:
# Create touch screen configuration
sudo nano /etc/X11/xorg.conf.d/90-touchscreen.conf

Section "InputClass"
    Identifier "Touch Screen"
    MatchIsTouchscreen "on"
    Option "Tapping" "on"
    Option "NaturalScrolling" "on"
EndSection

Touch Screen Gestures

  1. Configure touch actions:

    • Single tap
    • Long press
    • Edge swipes
    • Multi-touch gestures
  2. Create touch profiles:

touch:
  1:
    tap:
      command: 'xdotool click 1'
    hold:
      command: 'xdotool click 3'
  2:
    tap:
      command: 'xdotool click 2'

Gesture Debugging and Testing

Testing Tools

  1. Install gesture debugging tools:
sudo apt install evtest libinput-tools
  1. Monitor gesture events:
# Watch gesture events
libinput-debug-events

Troubleshooting

  1. Check device recognition:
# List input devices
libinput list-devices
  1. Verify gesture support:
# Check gesture capabilities
libinput debug-events --show-keycodes

Performance Optimization

Resource Management

  1. Monitor system impact:
# Check gesture daemon resource usage
top -p $(pgrep -d',' fusuma)
  1. Optimize settings:
    • Adjust gesture threshold
    • Configure update intervals
    • Optimize command execution

System Integration

  1. Autostart configuration:
# Create autostart entry
mkdir -p ~/.config/autostart
cat > ~/.config/autostart/fusuma.desktop << EOF
[Desktop Entry]
Type=Application
Name=Fusuma
Exec=fusuma
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
EOF

Best Practices

Gesture Organization

  1. Create gesture profiles:

    • Work profile
    • Gaming profile
    • Presentation mode
  2. Profile management:

# Create profile switching script
#!/bin/bash
cp ~/.config/fusuma/profiles/$1.yml ~/.config/fusuma/config.yml
pkill fusuma
fusuma -d

Backup and Recovery

  1. Save configurations:
# Backup gesture settings
tar -czf gesture-backup.tar.gz ~/.config/fusuma
  1. Restore settings:
# Restore from backup
tar -xzf gesture-backup.tar.gz -C ~/

Advanced Features

Multi-Monitor Support

  1. Configure per-monitor gestures:
monitor:
  HDMI-1:
    swipe:
      3:
        left:
          command: 'custom-monitor-command.sh left'
  1. Create monitor profiles:
    • Different gestures per display
    • Context-aware actions
    • Display-specific shortcuts

Application-Specific Gestures

  1. Configure per-application settings:
application:
  firefox:
    swipe:
      2:
        left:
          command: 'xdotool key alt+Left'

Conclusion

Setting up desktop gestures in Cinnamon requires understanding various components and their interactions. Key points to remember:

  • Start with basic gestures
  • Test thoroughly
  • Create backup configurations
  • Monitor system impact
  • Regular maintenance

By following this guide, you can create an intuitive gesture-based interface that enhances your desktop experience while maintaining system stability. Remember to:

  • Document changes
  • Test incrementally
  • Keep backups
  • Monitor performance
  • Regular updates

With proper configuration and maintenance, your gesture setup can provide an efficient and natural way to interact with your desktop environment while maintaining system stability and performance.


Last modified 20.02.2025: new kotlin and mint content (93a1000)