.\" Generated by scdoc 1.11.2 .\" Complete documentation for this program is not available as a GNU info page .ie \n(.g .ds Aq \(aq .el .ds Aq ' .nh .ad l .\" Begin generated content: .TH "keyd-application-mapper" "1" "2024-07-27" .P .SH NAME .P keyd-application-mapper - remap keys when window focus changes .P .SH SYNOPSIS .P \fBkeyd-application-mapper\fR [\fB-d\fR] .P .SH DESCRIPTION .P A script which reads \fI~/.\&config/keyd/app.\&conf\fR and applies the supplied bindings whenever a window with a matching class comes into focus.\& .P You can think of each section as a set of application specific masks applied over the global rules defined in \fI/etc/keyd/*.\&conf\fR.\& .P The config file has the following form: .P .nf .RS 4 [] \&.\&.\&. .fi .RE .P Where \fI\fR has one of the following forms: .P .RS 4 [] # Match by window class [|] # Match by class and title .P .RE and each \fI<expression>\fR is a valid argument to \fIkeyd bind\fR (see \fBBindings\fR).\& .P \fI<class exp>\fR and \fI<title exp>\fR are strings which describe window class and title names to be matched, and may optionally contain unix style wildcards (*).\& For example, \fI[gnome|*find*]\fR will match any window with a class of \fIgnome\fR and a title containing the substring \fIfind\fR.\& .P E.\&G: .P .nf .RS 4 [kitty] alt\&.] = C-tab alt\&.[ = C-S-tab alt\&.t = C-S-t [st-*] alt\&.1 = macro(Inside space st) [chromium] control\&.1 = macro(Inside space chrome!) alt\&.] = C-tab alt\&.[ = C-S-tab alt\&.t = C-t .fi .RE .P Will remap \fIA-1\fR to the the string '\&Inside st'\& when a window with a class that begins with '\&st-'\& (e.\&g st-256color) is active.\& .P Window class and title names can be obtained by inspecting the log output while the daemon is running (e.\&g \fItail -f ~/.\&config/keyd/app.\&log\fR).\& A reload may be triggered by sending the script a USR1 signal.\& .P At the moment X, Sway and Gnome are supported.\& .P .SH INSTALLATION .P Installation is a simple matter of running the command \fIkeyd-application-mapper -d\fR somewhere in your display server initialization logic (e.\&g \fI~/.\&xinitrc\fR or \fI~/.\&xsession\fR).\& If you are running Gnome, running \fIkeyd-application-mapper\fR for the first time will install an extension which manages the script lifecycle.\& .P In order for this to work, keyd must be running and the user must have access to \fB/var/run/keyd.\&socket\fR (i.\&e be a member of the \fBkeyd\fR group).\& .P .SH ENVIRONMENT VARIABLES .P \fBKEYD_DEBUG\fR .RS 4 Debug log level.\& \fI0\fR,\fI1\fR can be specified (default: 0).\& .P .RE .SH A note on security .P \fBAny user which can interact with a program that directly controls input devices should be assumed to have full access to the system.\&\fR .P While keyd offers slightly better isolation compared to other remappers by dint of mediating access through an IPC mechanism (rather than granting users blanket access to /dev/input/* and /dev/uinput), it still provides an opportunity for abuse and should be treated with due deference.\& .P Specifically, access to \fB/var/run/keyd.\&socket\fR should only be granted to trusted users and the group \fIkeyd\fR should be regarded with the same reverence as \fIwheel\fR.\& .P