• Stars
    star
    19
  • Rank 1,126,058 (Top 23 %)
  • Language
    Crystal
  • License
    MIT License
  • Created over 6 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Crystal bindings for libxdo (xdotool)

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:

dependencies:
  x_do:
    github: woodruffw/x_do.cr

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

$ sudo apt install libxdo-dev

Usage

require "x_do"

XDo.act do
  active_window do |win|
    win.type "hello from Crystal!"
  end
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):

$ crystal spec

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

# 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:

$ ./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

More Repositories

1

ff2mpv

A Firefox/Chrome add-on for playing URLs in mpv.
PowerShell
454
star
2

steg86

Hiding messages in x86 programs using semantic duals
Rust
269
star
3

kbs2

A secret manager backed by age
Rust
100
star
4

shaq

A CLI client for Shazam
Python
95
star
5

screenfetch-c

A rewrite of screenFetch in C.
C
71
star
6

mollusc

Pure-Rust libraries for parsing, interpreting, and analyzing LLVM
Rust
65
star
7

toml2json

A very small CLI for converting TOML to JSON
Rust
54
star
8

pyrage

Python bindings for rage (age in Rust)
Rust
38
star
9

bindef

A DSL and command-line tool for generating binary files.
Ruby
37
star
10

procmaps.py

Python bindings for procmaps.rs
Rust
36
star
11

snippets

Short (but useful) scripts and programs.
Ruby
32
star
12

yossarian-bot

An IRC bot with a bunch of features.
Ruby
30
star
13

qrencode.cr

Crystal bindings for libqrencode (qrencode), a library for QR code generation
Crystal
30
star
14

llvm-passgen

A small tool for quickly generating LLVM passes
Rust
26
star
15

ordered_enum

Totally ordered enums for Python.
Python
26
star
16

usb-ids.rs

Cross-platform Rust wrappers for the USB ID Repository
Rust
22
star
17

notify.cr

A Crystal library for desktop notifications.
Crystal
15
star
18

ruby-mpv

A Ruby library for controlling mpv processes.
Ruby
15
star
19

upgrayedd

Ergonomic function interposition in Rust
Rust
14
star
20

dotfiles

Configuration files, with some information removed.
Shell
12
star
21

libbdiff

A library for creating and patching binary diffs. Based on bsdiff.
C
11
star
22

procmaps.rs

A small Rust library for reading process maps from procfs
Rust
11
star
23

skipjack.rs

A straight-line implementation of the Skipjack cipher in Rust
Rust
10
star
24

libmsr

A library for reading, writing and analysis of magnetic stripe information.
C
10
star
25

SimpleSession

A window-oriented session manager for Sublime Text.
Python
6
star
26

lzfse.rb

Ruby bindings for Apple's LZFSE, including LZVN
C
6
star
27

cazart

Flask + schema = cazart!
Python
6
star
28

ruby-inih

A Ruby wrapper for inih (a simple C INI parser)
C
6
star
29

pledger

A small personal expense ledger.
Rust
6
star
30

abi3info

Programmatic access to Python's limited API and abi3 information
Python
5
star
31

nicer-bash

Things to make bash scripting nicer.
Shell
5
star
32

pgpkeydump

A tool for dumping PGP keys as JSON
Rust
5
star
33

msr-utils

Utilities split off from libmsr.
C
4
star
34

ruby-eval-in

A Ruby interface to https://eval.in/
Ruby
4
star
35

et

ET - the extraterrestrial botnet
C
3
star
36

i3.cr

A Crystal interface to the i3 window manager.
Crystal
3
star
37

MediaKeys

Media keys on Windows, without actual media keys.
C
3
star
38

pypi-pgp-statistics

Scripts and data from analyzing PGP signatures uploaded to PyPI
Python
3
star
39

abbrev.cr

A straightforward port of Ruby's Abbrev to Crystal.
Crystal
3
star
40

baseperm

A small tool for generating valid permutations of strings in baseN alphabets.
Rust
3
star
41

nvis

A very simple input visualizer
Rust
2
star
42

documerica

Data and a Twitter bot for the EPA's DOCUMERICA (1972-1977) program.
Python
2
star
43

bupkis

A small static album generator
Rust
2
star
44

tum

[WIP] A tiny useless machine.
C
2
star
45

pgp-wordlist.cr

A Crystal library for generating PGP word lists.
Crystal
2
star
46

autopost

Auto-posts social media updates
Python
2
star
47

sunxdcc.rs

A small, unofficial Rust wrapper for the SunXDCC search engine
Rust
2
star
48

sxbiff

xbiff with signals
C
1
star
49

git-contrib

MIGRATED. Contributors file generator for git repositories.
Ruby
1
star
50

eman

Utilities for embedded manpages.
Shell
1
star
51

rsus

A really simple upload service.
Crystal
1
star
52

website

An old git mirror of woodruffw.us. NO LONGER USED.
HTML
1
star
53

xnelson

Nelson, for X.
C
1
star
54

SimpleMail

A very simple Java program for sending (not receiving) emails via SMTP. Utilizes javax.mail.
Java
1
star
55

NIST-Beacon

A perl module for interacting with NIST's randomness beacon.
Perl
1
star
56

CGoL

Conway's Game of Life, in Java.
Java
1
star
57

ruby-upworthy

A Ruby gem for generating clickbait titles. Based on http://upworthygenerator.com.
Ruby
1
star
58

ruby-macho-utils

Command-line utilities for ruby-macho.
Ruby
1
star
59

xroach

A maintained copy of `xroach`
C
1
star
60

SublimeLinter-contrib-git-lint-commit

A SublimeLinter plugin for linting Git commit messages with git-lint-commit
Python
1
star
61

tepm

A tiny executable package manager.
Shell
1
star
62

netstring.cr

A library for parsing netstrings in Crystal
Crystal
1
star
63

cbor.cr

Crystal bindings for libcbor
Crystal
1
star