Sha256: cd694d6b5771b41fcf75a452e1675cac5ef0964b1215651f627e2088fa50d51c
Contents?: true
Size: 577 Bytes
Versions: 1
Compression:
Stored size: 577 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 puts record.create_display_text total += 1 end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
geektool_kit-0.2.0 | bin/gk_cpu_meter |