osm

command module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2021 License: MIT Imports: 7 Imported by: 0

README

osm

Alternative to xcape for Wayland.

Installation

Pre-built binaries are available. See releases.

Or install it yourself as:

$ GO111MODULE=on
$ go build
$ go install

Usage

Since osm creates a virtual keyboard device to write key events, it must be run as root (or set the permissions of /dev/uinput appropriately).

$ sudo ./osm -device /dev/input/event42 -keymap LeftCtrl=Esc,LeftShift=Home,RightShift=End

Refer to the golang-evdev source code for the key names that can be used. Case is not distinguished.

Hint: You can see the device path of the keyboard by looking at /proc/bus/input/devices.

Autostart

Use udev and systemd to recognize the connected keyboards and automatically start osm.

# /etc/udev/rules.d/99-osm.rules
ACTION=="add", KERNEL=="event*", ENV{ID_INPUT_KEYBOARD}=="1", ENV{DEVPATH}!="/devices/virtual/input/*", TAG+="systemd", ENV{SYSTEMD_ALIAS}+="/sys/devices/virtual/input/%k", ENV{SYSTEMD_WANTS}+="osm@%k.service"
# /etc/systemd/system/osm@.service
[Unit]
BindsTo=sys-devices-virtual-input-%i.device
After=sys-devices-virtual-input-%i.device

[Service]
ExecStart=/path/to/osm -device /dev/input/%I -keymap LeftCtrl=Esc,LeftShift=Home,RightShift=End
$ systemctl daemon-reload
$ udevadm control --reload
$ udevadm trigger --action=add

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL