Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mostlygeek/9304cddddcfeb59985d19cc72b2c2f91 to your computer and use it in GitHub Desktop.
Save mostlygeek/9304cddddcfeb59985d19cc72b2c2f91 to your computer and use it in GitHub Desktop.

Revisions

  1. mostlygeek revised this gist May 16, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions customize-mx-master-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -36,11 +36,11 @@ Here is an exemple of this file that map the Back and Forward buttons to BackSpa
    # thumb wheel up => increase volume and unmute
    # using xdotool pops up the Ubuntu OSD for volume
    "xdotool key XF86AudioRaiseVolume"
    b:6
    b:7

    # thumb wheel down => lower volume
    "xdotool key XF86AudioLowerVolume"
    b:7
    b:6

    # backward button => previous song
    "xte 'key XF86AudioPrev'"
  2. mostlygeek revised this gist May 16, 2021. 1 changed file with 10 additions and 4 deletions.
    14 changes: 10 additions & 4 deletions customize-mx-master-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,8 @@
    Notes for Ubuntu 21.04, getting the MX Master mouse to work.

    1. Ubuntu 21.04 uses Wayland by default. These instructions only work for x.org
    2. Getting Wayland to rebind mouse keys was confusing. Much easier to just use x.org and these instructions I found.

    First, install Solaar to see the battery level on the taskbar

    ```sh
    @@ -7,7 +12,7 @@ sudo apt-get install solaar
    To remap the keys, install

    ```sh
    sudo apt-get install xbindkeys xautomation
    sudo apt-get install xbindkeys xautomation xdotool
    ```

    Then, launch xev to get the keyboard or mouse event to bind
    @@ -28,12 +33,13 @@ nano ~/.xbindkeysrc
    Here is an exemple of this file that map the Back and Forward buttons to BackSpace and Return respectively

    ```sh
    # thumb wheel up => increase volume and unmute
    "amixer -D pulse set Master 4000+ unmute"
    # thumb wheel up => increase volume and unmute
    # using xdotool pops up the Ubuntu OSD for volume
    "xdotool key XF86AudioRaiseVolume"
    b:6

    # thumb wheel down => lower volume
    "amixer -D pulse set Master 4000-"
    "xdotool key XF86AudioLowerVolume"
    b:7

    # backward button => previous song
  3. @vukhanhtruong vukhanhtruong revised this gist Apr 17, 2020. 1 changed file with 7 additions and 3 deletions.
    10 changes: 7 additions & 3 deletions customize-mx-master-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -44,12 +44,16 @@ Here is an exemple of this file that map the Back and Forward buttons to BackSpa
    "xte 'key XF86AudioNext'"
    b:9

    # Example backspace
    #"xte 'keydown BackSpace'"
    #b:8
    # Example backspace
    #"xte 'keydown BackSpace'"
    #b:8

    #"xte 'keyup BackSpace'"
    # b:8 + Release

    # Alt tab to previous app
    "xte 'keydown Alt_L' 'key Tab' 'keyup Alt_L'"
    b:9
    ```

    To test your binding
  4. @vukhanhtruong vukhanhtruong revised this gist Apr 17, 2020. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions customize-mx-master-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -43,6 +43,13 @@ Here is an exemple of this file that map the Back and Forward buttons to BackSpa
    # forward button => next song
    "xte 'key XF86AudioNext'"
    b:9

    # Example backspace
    #"xte 'keydown BackSpace'"
    #b:8

    #"xte 'keyup BackSpace'"
    # b:8 + Release
    ```

    To test your binding
  5. @vukhanhtruong vukhanhtruong revised this gist Apr 17, 2020. 1 changed file with 13 additions and 11 deletions.
    24 changes: 13 additions & 11 deletions customize-mx-master-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -28,19 +28,21 @@ nano ~/.xbindkeysrc
    Here is an exemple of this file that map the Back and Forward buttons to BackSpace and Return respectively

    ```sh
    # Back button => BackSpace
    "xte 'keydown BackSpace'"
    # thumb wheel up => increase volume and unmute
    "amixer -D pulse set Master 4000+ unmute"
    b:6

    # thumb wheel down => lower volume
    "amixer -D pulse set Master 4000-"
    b:7

    # backward button => previous song
    "xte 'key XF86AudioPrev'"
    b:8

    "xte 'keyup BackSpace'"
    b:8 + Release

    # Forward button => Enter
    "xte 'keydown Return'"

    # forward button => next song
    "xte 'key XF86AudioNext'"
    b:9

    "xte 'keyup Return'"
    b:9 + Release
    ```

    To test your binding
  6. @vukhanhtruong vukhanhtruong revised this gist Apr 17, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion customize-mx-master-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -65,7 +65,7 @@ xbindkeys --key
    xbindkeys --multikey
    ```

    To restart xbindkeys
    If you change the key map, you have to restart xbindkeys by following command

    ```sh
    killall xbindkeys && xbindkeys
  7. @vukhanhtruong vukhanhtruong renamed this gist Apr 17, 2020. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions install.md → customize-mx-master-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -64,3 +64,9 @@ xbindkeys --key
    xbindkeys --multikey
    ```

    To restart xbindkeys

    ```sh
    killall xbindkeys && xbindkeys
    ```
  8. @vukhanhtruong vukhanhtruong revised this gist Apr 17, 2020. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion install.md
    Original file line number Diff line number Diff line change
    @@ -55,4 +55,12 @@ To start xbindkeys
    xbindkeys
    ```

    it should autostart automatically
    To find key code

    ```
    xbindkeys --key
    // or
    xbindkeys --multikey
    ```
  9. @vukhanhtruong vukhanhtruong renamed this gist Apr 17, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  10. @vukhanhtruong vukhanhtruong created this gist Apr 17, 2020.
    58 changes: 58 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,58 @@
    First, install Solaar to see the battery level on the taskbar

    ```sh
    sudo apt-get install solaar
    ```

    To remap the keys, install

    ```sh
    sudo apt-get install xbindkeys xautomation
    ```

    Then, launch xev to get the keyboard or mouse event to bind

    ```sh
    xev

    # grep button
    xev | grep -i button
    ```

    Create the configuration file for xbindkeys

    ```
    nano ~/.xbindkeysrc
    ```

    Here is an exemple of this file that map the Back and Forward buttons to BackSpace and Return respectively

    ```sh
    # Back button => BackSpace
    "xte 'keydown BackSpace'"
    b:8

    "xte 'keyup BackSpace'"
    b:8 + Release

    # Forward button => Enter
    "xte 'keydown Return'"
    b:9

    "xte 'keyup Return'"
    b:9 + Release
    ```

    To test your binding

    ```
    xbindkeys -v
    ```

    To start xbindkeys

    ```
    xbindkeys
    ```

    it should autostart automatically