Volumerb 🔊
Gem to manage the volume on GNU/Linux and Mac OS X operating systems.
Installation
Add this line to your application's Gemfile:
gem 'volumerb'
And then execute:
$ bundle
Or install it yourself as:
$ gem install volumerb
Usage
The available methods are:
vol- Returns the current volume state (on/off if unmuted/muted and a value)up- Increases volume.down- Decreases volume.mute- Mutes/unmutes.value- Sets/gets the volume valuestate- Returns the volume state (muted/unmuted)
Example:
$ irb
2.1.2 :001 > require 'volumerb'
=> true
2.1.2 :002 > Volumerb.vol
=> {:value=>100, :state=>"on"}
2.1.2 :003 > 10.times { Volumerb.down }
=> 10
2.1.2 :004 > Volumerb.value
=> 70
2.1.2 :005 > Volumerb.mute
=> {:value=>70, :state=>"off"}
2.1.2 :006 > Volumerb.mute
=> {:value=>70, :state=>"on"}
2.1.2 :007 > Volumerb.state
=> "on"
2.1.2 :008 > Volumerb.value = 30
=> 30
2.1.2 :009 > Volumerb.value = 100
=> 100
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
TODO
- Customize volume increase/decrease percentage