Project

kasten

0.0
No commit activity in last 3 years
No release in over 3 years
Let users draw a Kasten (German for box) in an X environment and get it's dimensions
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 10.0
 Project Readme

Kasten Installs Codeclimate

Let users draw a Kasten (German for box) in an X environment and get its dimensions

Usage

run gem install kasten or add it to your Gemfile and run bundle install, then:

require 'kasten'

dimensions = Kasten.kasten
p dimensions
#  => {"x"=>532, "y"=>484, "w"=>265, "h"=>187}

This gives you the raw hash.

There's also a convenience class that makes things slightly more comfortable:

box = Kasten::Box.new
# => #<Kasten::Box:0x000000015840c0 @x=265, @y=701, @w=235, @h=162>
box.x
# => 265
box.to_s
# "x: 265, y: 701, w: 235, h: 162"

Yes, it's that simple.

Here, look at a demo recorded with the screen_recorder example.

demo gif

Troubleshooting

If the Gem doesn't compile for you, you might need to install libx11-dev. So on Debian based systems do sudo apt-get install libx11-dev first.