0.01
No commit activity in last 3 years
No release in over 3 years
ActiveWindowX is a gem to observe an active window on Linux (X Window System).
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
 Project Readme

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