Sha256: eda708f260eb733bdc5f9ba6c2283ab93c6519d36126666e728cdbee2c288a95

Contents?: true

Size: 558 Bytes

Versions: 3

Compression:

Stored size: 558 Bytes

Contents

#!/usr/bin/env ruby

require 'geektool_kit'

title = "Top CPU processes"
max_lines = 10
args = ARGV

while !args.first.nil? do
  case args.first.downcase
  when "-t"
    title = args[1] unless args[1].nil?

  when "-l"
    max_lines = args[1].to_i unless args[1].nil?

  else
    puts "arg '#{args.first}' not recognized (value: '#{args[1]}')"
  end
  
  args = args.drop 2

end


puts "#{title}\n"
counter = 0
total = 0
GeektoolKit::CpuRecord.get_records.sort.each do |record|

  break if counter == 5 || total == max_lines

  record.print
  total += 1
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
geektool_kit-0.3.1 bin/gk_cpu_meter
geektool_kit-0.3.0 bin/gk_cpu_meter
geektool_kit-0.2.1 bin/gk_cpu_meter