• Stars
    star
    2,728
  • Rank 16,698 (Top 0.4 %)
  • Language
    C
  • License
    Other
  • Created almost 14 years ago
  • Updated over 1 year ago

Reviews

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

Repository Details

fake keyboard/mouse input, window management, and more

xdotool - x11 automation tool

xdotool lets you simulate keyboard input and mouse activity, move and resize windows, etc. It does this using X11’s XTEST extension and other Xlib functions.

⚠ Note: If you are using Wayland, please be aware this software will not work correctly. See the 'Wayland' section below for more detail.

With xdotool, you can search for windows and move, resize, hide, and modify window properties like the title. If your window manager supports it, you can use xdotool to switch desktops, move windows between desktops, and change the number of desktops.

Also in this repository is libxdo, a C library for doing the same.

You may view the user documentation in xdotool.pod

Installation

You may find xdotool in your distribution packaging:

  • Debian and Ubuntu: apt-get install xdotool
  • Fedora: dnf install xdotool
  • FreeBSD: pkg install xdotool
  • macOS: brew install xdotool or sudo port install xdotool
  • OpenSUSE: zypper install xdotool

Basic Usage

Typing

From your terminal, run:

xdotool type "Hello world"

Sending keys

xdotool key ctrl+l

The above will simulate the keystrokes as if you pressed the control key, then the "L" key, and then released both. This is useful for simulating hotkeys.

Closing a window

xdotool selectwindow windowclose

This will close the first window you click on.

Cool Tricks

Bring up Firefox and focus the URL bar

xdotool search "Mozilla Firefox" windowactivate --sync key --clearmodifiers ctrl+l

Resize all visible gnome-terminal windows

xdotool search --onlyvisible --classname "gnome-terminal" windowsize %@ 500
500

Wayland

Wayland is a very different graphics system than X11 (which you might know as Xorg or X). Wayland has some X11 compatibility, but for the purposes of xdotool, many things do not work correctly. Typing, window searching, and many other functions of xdotool do not work, and it is unclear if they could ever work.

Some other tools that might help you if you use Wayland are:

  • ydotool - a tool for sending mouse and keyboard events using Linux's uinput sytem
  • dotool - a tool for sending mouse and keyboard events using Linux's uinput sytem

Building / Compiling

Prerequisites:

  • X11 libraries: xlib, xtst, xi, xkbcommon, xinerama

How to compile and install:

  • Compile: make
  • Install: make install
  • Remove: make uninstall

You may have to set 'PREFIX' to the location you want to install to. The default PREFIX is /usr/local

For packagers, there's also support for DESTDIR for staged install.

Also, see the manpage, which you can generate by running:

  make showman

Note: the manpage will be installed during 'make install'

More Repositories

1

fpm

Effing package management! Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.
Ruby
10,867
star
2

pleaserun

An attempt to abstract this "init" script madness.
Ruby
1,168
star
3

heroku-buildpack-meteor

a heroku buildpack for meteor (meteor.com)
Shell
588
star
4

keynav

retire your mouse.
C
539
star
5

puppet-examples

A collection of advanced puppet examples (uses older versions of puppet v3/v2)
Puppet
392
star
6

grok

DRY and RAD for regular expressions and then some.
C
238
star
7

ruby-cabin

Structured+contextual logging experiments in Ruby
Ruby
154
star
8

eventmachine-tail

Ruby EventMachine file tailing and friends. 'gem install eventmachine-tail' to install.
Ruby
127
star
9

experiments

random experiments
JavaScript
126
star
10

ruby-filewatch

ruby api for file watching and tailing.
Ruby
90
star
11

software-patterns

Ruby
71
star
12

fex

fex - flexible field/token extraction
Shell
57
star
13

ruby-grok

Pure-ruby implementation of grok.
Ruby
54
star
14

rvm-packaging

Automatic packaging (rpm/deb) for rvm and its rubies
Shell
51
star
15

ruby-netty-eventmachine

EventMachine-compatible API on top of Netty - for JRuby
Ruby
45
star
16

fingerpoken

Use your browser as a remote and touchpad (iphone/ipad/laptop, etc)
Ruby
44
star
17

s3cleaner

Amazon S3 file cleaner - delete things older than a certain age, matching a pattern, etc.
Python
41
star
18

ruby-stud

Common software patterns I use frequently.
Ruby
36
star
19

ruby-sshkeyauth

Use SSH keys for signing and verifying data (outside of ssh servers)
Ruby
36
star
20

syslog-shipper

UNMAINTAINED - Ship logs from files to a syslog server
Ruby
35
star
21

ruby-minstrel

A ruby instrumentation tool
Ruby
32
star
22

ruby-ftw

Ruby FTW - For The Web. Experimentation in web clients and servers.
Ruby
31
star
23

dotfiles

dotfiles and friends.
Ruby
28
star
24

jruby-elasticsearch

Native Java ElasticSearch for JRuby
Ruby
28
star
25

shatty

share tty (record, play, share)
Ruby
25
star
26

vagrant-port

Vagrant 'port' plugin (for querying forwarded ports)
Ruby
22
star
27

shebang

A better #! runner than /usr/bin/env
C
21
star
28

fosl

Ruby API using lsof(1)
Ruby
20
star
29

sysadvent

Systems Administrator Advent Calendar
Perl
18
star
30

ruby-arr-pm

Ruby RPM library (pure ruby, no librpm)
Ruby
18
star
31

procnanny

Process Nanny. It's like daemontools or supervisord, but fun.
C++
15
star
32

eventmachine-vnc

EventMachine VNC/RFB protocol support
Ruby
14
star
33

gem-packaging

gem packaging tools
Shell
12
star
34

pam_captcha

Make ssh more fun with a figlet captcha.
C
11
star
35

batcave

An attempt to make a digital batcave.
Ruby
11
star
36

vxin

Visualization (v11n, v XI n) experiments
JavaScript
11
star
37

elasticsearch-on-heroku

ElasticSearch run on Heroku
Java
11
star
38

python-rightscale

An object-oriented interface to RightScale's API.
Python
10
star
39

vagrant-tricks

A collection of vagrant tricks
Ruby
10
star
40

ruby-flores

Exploration in randomized testing (fuzzing, stress testing, etc)
Ruby
10
star
41

vim-ackmore

My vim stuff.
Vim Script
9
star
42

parasite

parasite? live on another process.
C
8
star
43

ruby-grok-ui

UNMAINTAINED - A grok ui.
JavaScript
7
star
44

python-packaging

DEPRECATED. Use: http://github.com/jordansissel/fpm
Shell
6
star
45

extlookup.rb

puppet's extlookup from the commandline
6
star
46

puppet-pleaserun

A custom type for puppet that allows you to use pleaserun to create init, launchd, upstart, systemd, and may more 'init' script thingies.
Ruby
6
star
47

grok-cpp

Grok written in C++, this is no longer maintained. Let it serve as a warning to others. ;)
C++
5
star
48

presentation-an-implementation-of-puppet

Presentation of puppet use at loggly (masterless, nodeless, exported resources, style recommendations, etc)
JavaScript
5
star
49

djbdnsplus

Fork of djbdns 1.05
C
5
star
50

message-passing

experiments in message passing
Ruby
4
star
51

demo.logstash.net

config management for the demo.logstash.net machine(s)
Ruby
4
star
52

ruby-O_o

raise O_o
Ruby
4
star
53

websocket-log-demo

UNMAINTAINED
Ruby
4
star
54

ruby-backport-bij

Backporting ruby features so shit keeps working on systems people actually have in production.
Ruby
4
star
55

firefox-tabsearch

Find-as-you-type tab searching for Firefox.
Shell
4
star
56

ruby-insist

I insist. (a testing tool for ruby)
Ruby
4
star
57

zmqexec

zmq exec
C
4
star
58

tmux

svn-git mirrored tmux for me to play with.
C
4
star
59

puppet-workstation

Puppet manifests for my workstation(s)
Puppet
4
star
60

semicomplete.com

semicomplete.com projects
HTML
3
star
61

ruby-lsof

You really want 'fosl'
3
star
62

node-packaging

npm -> another format, like .deb
Ruby
3
star
63

go-cabin

go logging and stuff.
Go
3
star
64

fastest_sites

Sort FreeBSD Ports MASTER_SITE_* things by speed to you.
Python
3
star
65

heroku-buildpack-varnish

Shell
3
star
66

xboxproxy

xboxproxy, resurrected.
Python
3
star
67

rubygems-regression

regression tests for rubygems
2
star
68

packer

UNMAINTAINED - an example tool for packing up ruby apps into a tarball including all dependencies. This was for an interview a while ago.
Ruby
2
star
69

ruby-rplot

Experimenting with SVG and graphint
Ruby
2
star
70

twitter-spamwatch

Maybe pick out some spam from the twitters.
2
star
71

perl-Term-Shelly

Term::Shelly is a readline-ish terminal interface for perl.
Perl
2
star
72

freebsd-newmoused

An old effort to improve moused on freebsd. Needs new owner.
C
2
star
73

python-pimp

Web-based self-managed mp3 radio. This project is not maintained.
JavaScript
2
star
74

heumon

Experiments in clicking.
JavaScript
2
star
75

sample-rpms

RPMs for testing ruby-arr-pm
2
star
76

go-lumberjack

Moves logs... and stuff.
2
star
77

slashport

An experiment in exported metrics and monitoring
Ruby
2
star
78

ruby-cabin-web

UNMAINTAINED - A web interface to data flowing into cabin
Ruby
2
star
79

tic

A terminal-based AIM client for Perl. Uses Net::OSCAR. Written in 2004, still seems to work :)
Perl
2
star
80

ifwm

A window manager project. Perhaps I'll finish it some day.
C
2
star
81

chef-lumberjack-cookbook

chef cookbook for lumberjack
Ruby
2
star
82

firefox-urledit

A url editor extension for Firefox
JavaScript
2
star
83

ruby-acme-tlap

Ruby Acme::TLAP (Talk Like A Pirate)
2
star
84

windows-winmgr

An attempt to add type-to-find to Windows.
C++
2
star
85

slideshow-template-jls

slideshow template 'jls'
JavaScript
2
star
86

googlemaps-traffic-sms

Email gateway for getting google maps traffic snapshots to your phone.
Python
2
star
87

semicomplete-googlecode-archive

An archive of my old semicomplete.googlecode.com svn repo. Hasn't been touched really since 2012.
C
1
star
88

react-boilerplate-fun

JavaScript
1
star
89

veewee-jenkins

Ruby
1
star
90

keymux

1
star
91

button-game

A toy I made.
Python
1
star
92

example

1
star
93

this-is-only-a-test

This is only a test. I promise!
1
star
94

ipmi

C++
1
star
95

omnibus-fpm

UNMAINTAINED
1
star