LinuxAlternative

Linux · Accessories

xbindkeys

A lightweight utility to bind keyboard shortcuts and mouse buttons to arbitrary commands or key sequences.

Open sourceFree
Be the first to rate
License
GPL-2.0
Latest version
1.8.7

What is xbindkeys?

xbindkeys is a small, mature X11 utility that allows you to assign keyboard shortcuts and mouse buttons to execute shell commands or simulate key presses. It has been part of the Linux ecosystem for over two decades, making it a stable, no-frills tool that rarely changes. Unlike modern Wayland compositors, it relies on X11's input handling, which means it works predictably in traditional desktop environments but requires specific configuration for newer systems.

This tool is aimed at power users, window managers, and those who want fine-grained control over their input devices without relying on heavyweight configuration managers. If you use a tiling window manager like i3 or bspwm, or simply want to bind a media key to a specific script, xbindkeys is the standard solution. It is not intended for casual users who prefer graphical settings panels.

Compared to Windows PowerToys, xbindkeys is far more minimal. PowerToys offers a suite of visual tools like color picker and keyboard manager, while xbindkeys is a single-purpose command-line utility. You will not find a GUI; you edit a text file. However, for pure shortcut binding, xbindkeys is often faster and more transparent, allowing you to see exactly what command is being triggered by a specific key combination.

Best for: X11 users who need precise, scriptable keyboard and mouse bindings without a GUI.

Key features of xbindkeys

  • Bind any key or mouse button to a shell command
  • Simulate key sequences and key presses
  • Supports modifiers like Ctrl, Alt, Shift, and Super
  • Configurable via a simple text file
  • Works with X11 display servers
  • Low resource consumption
  • Can trigger scripts or applications instantly

Pros

  • Extremely lightweight and fast
  • Highly flexible for custom scripting
  • Stable and well-documented
  • No bloat or unnecessary features

Cons

  • No graphical user interface
  • Does not work natively on Wayland sessions
  • Configuration can be intimidating for beginners
  • Requires X11 environment

Windows programs xbindkeys replaces

How to install xbindkeys on Linux

Ubuntu / Mintsudo apt install xbindkeys
Debiansudo apt install xbindkeys
Fedorasudo dnf install xbindkeys
Arch / Manjarosudo pacman -S xbindkeys
openSUSEsudo zypper install xbindkeys

Tips for Windows users

Coming from PowerToys, you will need to shift from a GUI-based approach to editing the ~/.xbindkeysrc file. Use the xbindkeys-show command to identify the hex codes for your desired keys. Note that xbindkeys only works on X11; if you are on Wayland, you will need to use your compositor's native keybinding configuration (like sway or hyprland) instead. There is no direct file format conversion; you must manually map your PowerToys shortcuts to xbindkeys syntax.

xbindkeys: frequently asked questions

Does xbindkeys work on Wayland?

No, xbindkeys is designed for X11. On Wayland, input handling is restricted for security reasons, so you must use your specific compositor's configuration file to bind keys.

How do I find the key code for a specific button?

Run xbindkeys-show in a terminal, then press the key or mouse button you want to bind. The terminal will display the corresponding hex code and modifiers.

Can I bind a key to open a specific application?

Yes, you can assign a command like 'firefox' or 'nautilus' to a key combination in the configuration file. Ensure the application is in your PATH.

Why are my shortcuts not working?

Check if you are using an X11 session. Also, ensure there are no conflicting bindings in your window manager or desktop environment settings, and verify the syntax in your .xbindkeysrc file.

Updated