Class: Barr::Blocks::HDD
- Inherits:
-
Barr::Block
- Object
- Barr::Block
- Barr::Blocks::HDD
- Defined in:
- lib/barr/blocks/hdd.rb
Instance Attribute Summary
Attributes inherited from Barr::Block
#align, #bgcolor, #fgcolor, #icon, #interval, #output
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ HDD
constructor
A new instance of HDD.
- #update! ⇒ Object
Methods inherited from Barr::Block
#<<, #colors, #destroy, #destroy!, #draw, #reassign_deprecated_option, #update
Constructor Details
#initialize(opts = {}) ⇒ HDD
Returns a new instance of HDD.
7 8 9 10 11 |
# File 'lib/barr/blocks/hdd.rb', line 7 def initialize(opts = {}) super @device = opts[:device] end |
Instance Method Details
#update! ⇒ Object
13 14 15 16 17 |
# File 'lib/barr/blocks/hdd.rb', line 13 def update! total, used, perc = sys_cmd.split(' ') @output = "#{used} / #{total} (#{perc})" end |