Skip to content

kui/active_window_x

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ActiveWindowX

ActiveWindowX is a gem to observe an active window on Linux (X Window System).

Installation

Add this line to your application's Gemfile:

gem 'active_window_x'

And then execute:

$ apt-get install libx11-dev
$ bundle

Or install it yourself as:

$ gem install active_window_x

Usage

The following script observe the active window and it's title changing.

require 'active_window_x'

ActiveWindowX::EventListener.new do |e|
  puts "#{e.type}:\t#{e.window}"
end

execute:

$ ruby simple.rb
 # switch the active window or the browser tab!!
active_window:	#<ActiveWindowX::Window:0x7fd47d391e18>
title:	#<ActiveWindowX::Window:0x7fd47d391850>
title:	#<ActiveWindowX::Window:0x7fd47d391030>
active_window:	#<ActiveWindowX::Window:0x7fd47d390540>
active_window:	#<ActiveWindowX::Window:0x7fd47d38fc30>
...

and see other samples

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

ToDo

  • See git grep TODO
  • Accessor API for the window icons
  • Setter to select event types for listening
  • @continue setter to terminate graceful

About

a rubygem package to observe an active window on X window system

Resources

License

Stars

Watchers

Forks

Packages

No packages published