项目作者: woodruffw

项目描述 :
Crystal bindings for libxdo (xdotool)
高级语言: Crystal
项目地址: git://github.com/woodruffw/x_do.cr.git
创建时间: 2017-12-27T05:51:48Z
项目社区:https://github.com/woodruffw/x_do.cr

开源协议:Other

下载


x_do

License: MIT
CI

XDo is a Crystal interface for libxdo,
the C library that backs 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:

  1. dependencies:
  2. x_do:
  3. github: woodruffw/x_do.cr

libxdo is required. On Debian-based systems, it can be installed via:

  1. $ sudo apt install libxdo-dev

Usage

  1. require "x_do"
  2. XDo.act do
  3. active_window do |win|
  4. win.type "hello from Crystal!"
  5. end
  6. end

Check out the 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 installed

To run the unit tests on the default X11 display (DISPLAY, falling back on :0):

  1. $ crystal spec

Alternatively, the tests can be run on another X11 display, like a Xephyr or Xvfb instance:

  1. # replace "99" with your display number
  2. $ DISPLAY=:99 crystal spec

The util/xvfb-spec script can be used to run the tests inside a temporary Xvfb instance running
Openbox:

  1. $ ./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 William Woodruff - creator, maintainer