dotfiles/tmux/clocks.rb
Bill Niblock 11536ef919 Fidgeting
2017-01-27 20:52:36 -05:00

47 lines
743 B
Ruby

######
# Clocks -- Tmux status line output
###
require 'net/http'
class Weather
attr_reader :temp, :flag, :summary
def initialize()
@temp = 68
@flag = "(!)" if hasflag?
@summary = "Dang nice"
end
private
def get_weather(lat = 42.9333, lon = -78.877)
end
def hasflag?
return true
end
end
class Clocks
def initialize()
w = Weather.new()
t = Time.new()
@tu = t.utc.strftime("[ %H:%M ]")
@tb = t.getlocal.strftime("<][ %b %d %H:%M | ")
@tw = "#{w::flag} #{w::temp} ][>"
@tc = t.getlocal("-07:00").strftime("<][ %H:%M ]")
@ti = t.getlocal("+05:30").strftime("[ %H:%M ][>")
end
def show()
puts "#{@tc} #{@tb}#{@tw} #{@tu} #{@ti}"
end
end
c = Clocks.new()
c.show()