Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/woodruffw/x_do.cr
Crystal bindings for libxdo (xdotool)
https://github.com/woodruffw/x_do.cr
crystal libxdo x11
Last synced: about 2 months ago
JSON representation
Crystal bindings for libxdo (xdotool)
- Host: GitHub
- URL: https://github.com/woodruffw/x_do.cr
- Owner: woodruffw
- License: mit
- Created: 2017-12-27T05:51:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-05T02:50:01.000Z (12 months ago)
- Last Synced: 2024-02-01T15:50:17.861Z (5 months ago)
- Topics: crystal, libxdo, x11
- Language: Crystal
- Homepage: https://woodruffw.github.io/x_do.cr/
- Size: 494 KB
- Stars: 19
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-crystal - x_do.cr - Bindings for libxdo ([`xdotool`](https://github.com/jordansissel/xdotool)) (C bindings)
- awesome-crystal - x_do.cr - Bindings for libxdo ([`xdotool`](https://github.com/jordansissel/xdotool)) (C bindings)
- awesome-crystal - x_do.cr - Bindings for libxdo ([`xdotool`](https://github.com/jordansissel/xdotool)) (C bindings)
README
x_do
====[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![CI](https://github.com/woodruffw/x_do.cr/actions/workflows/ci.yml/badge.svg)](https://github.com/woodruffw/x_do.cr/actions/workflows/ci.yml)`XDo` is a Crystal interface for `libxdo`,
the C library that backs [`xdotool`](https://github.com/jordansissel/xdotool).It exposes most of the functionality of `xdotool`, allowing
users to write Crystal programs that manage windows in an X11 instance.## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
x_do:
github: woodruffw/x_do.cr
````libxdo` is required. On Debian-based systems, it can be installed via:
```bash
$ sudo apt install libxdo-dev
```## Usage
```crystal
require "x_do"XDo.act do
active_window do |win|
win.type "hello from Crystal!"
end
end
```Check out the [examples](./examples) folder for some practical examples.
## Testing
The unit tests make the following assumptions:
* You're running an instance of X11
* You're running a window manager that's (mostly) ICCCM and EWMH compliant
* You have `xlogo` installedTo run the unit tests on the default X11 display (`DISPLAY`, falling back on `:0`):
```bash
$ crystal spec
```Alternatively, the tests can be run on another X11 display, like a Xephyr or Xvfb instance:
```bash
# replace "99" with your display number
$ DISPLAY=:99 crystal spec
```The `util/xvfb-spec` script can be used to run the tests inside a temporary Xvfb instance running
Openbox:```bash
$ ./util/xvfb-spec
```## TODO
* Complete bindings (`grep "implement me!"`)
* Add error conditions (check return value of libxdo calls)## Contributing
1. Fork it ( https://github.com/woodruffw/x_do/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request## Contributors
- [woodruffw](https://github.com/woodruffw) William Woodruff - creator, maintainer