public
Description: my config files
Homepage:
Clone URL: git://github.com/bradx3/dotfiles.git
dotfiles / .gatelyrc
100644 67 lines (53 sloc) 1.434 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# TODO
# Graph some swim.rb
#
 
###
# Excecutes the given df command and returns the free space for the first
# device returned.
###
def df_free_space(cmd)
  output = `#{ cmd }`.split("\n")
  output = output[1].split
  return output[3].strip
end
 
# ###
# # Executes the given bwm-ng command and returns the total value.
# ###
# def bmg_value(cmd)
# output = `#{ cmd }`
# output = output.split(" ")
# return output.last.strip
# end
 
# panel(:left => 15,
# :bottom => 15,
# :refresh => 5) do
 
# load = "uptime | awk -F'load averages:' '{ print $2 }'"
# diskuse = "bwm-ng -c 2 -o plain -i ioservice | grep total"
# netuse = "bwm-ng -c 2 -o plain | grep total"
 
# lines = []
# lines << "Net: #{ bmg_value(netuse) }"
# lines << "Disk: #{ bmg_value(diskuse) }"
# cur_load = `#{ load }`
# lines << "Load: #{ cur_load }"
 
# lines.join("\n")
# end
 
long_time = 15 * 60
 
panel(:right => 1265,
      :bottom => 15,
      :width => 250,
      :command => "icalBuddy eventsToday+1",
      :refresh => long_time)
 
panel(:left => 15,
      :bottom => 15,
      :refresh => long_time) do
  lines = []
 
  cmd = "df -h /"
  lines << "Local: #{ df_free_space(cmd) }"
 
  cmd = "ssh home \"df -h /home\""
  lines << "Clamps: #{ df_free_space(cmd) }"
 
  lines.join("\n")
end
 
panel(:left => 15,
      :top => 762,
      :command => "/Users/brad/projects/scripts/net_usage.rb",
      :refresh => long_time)