2020-03-31 23:27:28 -04:00
|
|
|
# XMan
|
2020-03-31 23:32:04 -04:00
|
|
|
A daemon to manage [xcape](https://github.com/alols/xcape) instances based on
|
2020-03-31 23:27:28 -04:00
|
|
|
which app is in focus.
|
|
|
|
|
2020-04-01 16:01:16 -04:00
|
|
|
Xcape allows one to configure any key to send an arbitrary key upon release (for
|
|
|
|
instance, the Control key can function as itself on keypress and an Escape key
|
|
|
|
on key release).
|
2020-03-31 23:27:28 -04:00
|
|
|
|
|
|
|
This works beautifully except when one tries to switch to a virtual machine
|
|
|
|
(VM), particularly a windows machine with an Autohotkey script to replicate the
|
|
|
|
keymap in the host machine. In this case, any xcape'd keys will be sent twice.
|
|
|
|
The obvious (and somewhat crude solution) is to start and stop xcape depending
|
|
|
|
on which apps have focus.
|
|
|
|
|
|
|
|
# Usage
|
|
|
|
|
|
|
|
```
|
2020-04-01 16:01:16 -04:00
|
|
|
xcape-hs BINDINGS REGEXP [[REGEXP] ...]
|
2020-03-31 23:27:28 -04:00
|
|
|
```
|
|
|
|
|
2020-04-01 16:01:16 -04:00
|
|
|
Where `BINDINGS` are the keys supplied to the `-e` argument of `xcape` and
|
|
|
|
`REGEXP` is a POSIX-style regular expression matching a window title for which
|
|
|
|
xcape will not be running when it is in focus. To find a window title, use the
|
|
|
|
`xprop` program and look for the `WM_NAME` and `_NET_WM_NAME` atoms in the
|
|
|
|
output.
|
2020-03-31 23:27:28 -04:00
|
|
|
|
|
|
|
# Dependencies
|
|
|
|
|
|
|
|
* xcape
|
|
|
|
|
|
|
|
# Installation
|
|
|
|
|
|
|
|
Clone this repo and run `stack install`.
|