gtk2clockapp 2.1.210818 → 2.1.210819

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9729b91b949fc87022a3da8add43b69da00255d12d5ef824e6c5bb064cf97c4
4
- data.tar.gz: 1f541f138b44118d232e9ffd0262bba1fe31ef3138ee03df842f821297c92191
3
+ metadata.gz: d5f28a1d3e170ed1c15e28394cdee787a7fcd2cfcc8fab1971dd1ad588b9294d
4
+ data.tar.gz: 9ed1880d154a032a94eaba9a62f3dc809c75c39f6ec0dd45719f226d449076bd
5
5
  SHA512:
6
- metadata.gz: fa922051af87a7b759853b8e8c7d2739addd57a5480cf0caa7e72991f97ddcdc852d830631e39ac69d6c79f3c347b641ed4e5e877d632560b6fa748c0ddea3ca
7
- data.tar.gz: 6c75812d05339cd79b059fcd0da6ea4b0edf4c390d3160f6290467c239751c47609875bff0498a655f08b061cc2ba8789e1786f5cd854f5188c830e088390bde
6
+ metadata.gz: 8f3b5754f6c0544e3c7d27338ffcebde191927321328a8bc2cbf68819423cd37384f5963f362b9f28cbef44facc7f7cec7240af3b80486f1e76fe19c0354ebd3
7
+ data.tar.gz: 2f6f0634370ce5ad60a708f49f74d6de01639e85af9773fa80195a6ea3dd7959a42ac86444a0b359aaa7a201302b28f35333adcfca3b051d0a6f3b3ce2a138a8
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Gtk2ClockApp
2
2
 
3
- * [VERSION 2.1.210818](https://github.com/carlosjhr64/gtk2clockapp/releases)
3
+ * [VERSION 2.1.210819](https://github.com/carlosjhr64/gtk2clockapp/releases)
4
4
  * [github](https://github.com/carlosjhr64/gtk2clockapp)
5
5
  * [rubygems](https://rubygems.org/gems/gtk2clockapp)
6
6
 
data/bin/gtk2clockapp CHANGED
@@ -9,7 +9,7 @@ Options:
9
9
  -v --version
10
10
  --fullscreen
11
11
  --notdecorated
12
- --size=INT \t 250
12
+ --size=INT \t 186
13
13
  --font=NAME \t Courier
14
14
  --background=COLOR \t 000000
15
15
  --day=COLOR \t 00FF00
@@ -22,6 +22,20 @@ Types:
22
22
  HELP
23
23
  HelpParser.int?(:size)
24
24
  gui = Gtk2ClockApp.gui
25
+ Thread.new do
26
+ now = lambda {|key| Time.now.strftime(Gtk2ClockApp::CONFIG[key])}
27
+ gui.set_date now[:DateA]
28
+ gui.set_time now[:Time]
29
+ loop do
30
+ sleep(60 - Time.now.sec)
31
+ gui.set_date now[:DateB]
32
+ gui.set_time now[:Time]
33
+ 11.times do |i|
34
+ sleep 5
35
+ gui.set_date now[[:DateA, :DateB][i%2]]
36
+ end
37
+ end
38
+ end
25
39
  gui.set_weather '' # '⛅ 75F 92F/66F'
26
40
  gui.set_spot '' # '🗠 WUT: $500'
27
41
  gui.set_alert '' # '📢 Attention!'
data/lib/gtk2clockapp.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Gtk2ClockApp
2
- VERSION = '2.1.210818'
2
+ VERSION = '2.1.210819'
3
3
 
4
4
  def self.gui
5
5
  require 'gtk3'
@@ -2,7 +2,7 @@ module Gtk2ClockApp
2
2
  OPTIONS ||= nil
3
3
 
4
4
  g = 2 - (1 + Math.sqrt(5))/2
5
- big = OPTIONS&.size? || 250
5
+ big = OPTIONS&.size? || 186
6
6
  medium = (big*g).round
7
7
  small = (big*g*g).round
8
8
  pad = (big*g*g*g).round
@@ -1,24 +1,9 @@
1
1
  module Gtk2ClockApp
2
2
  class Gui
3
- def now(key)
4
- Time.now.strftime(CONFIG[key])
5
- end
6
-
7
3
  def new_label(key)
8
4
  hbox = Such::Box.new @vbox, :hbox!
9
5
  Such::Label.new hbox, key
10
6
  end
11
-
12
- def time_label(key, seconds, *formats)
13
- label = new_label(key)
14
- i = 0
15
- label.set_text now(formats[i])
16
- GLib::Timeout.add(seconds*1000) do
17
- i = (i+1)%formats.length
18
- label.set_text now(formats[i])
19
- end
20
- label
21
- end
22
7
 
23
8
  def initialize
24
9
  @window = Such::Window.new :window! do Gtk.main_quit end
@@ -26,9 +11,8 @@ module Gtk2ClockApp
26
11
  @window.fullscreen if OPTIONS.fullscreen?
27
12
  @vbox = Such::Box.new @window, :vbox!
28
13
 
29
- @date = time_label(:medium_label!, 5, :DateA, :DateB)
30
- @time = time_label(:big_label!, 60, :Time)
31
-
14
+ @date = new_label(:medium_label!)
15
+ @time = new_label(:big_label!)
32
16
  @weather = new_label(:medium_label!)
33
17
  @spot = new_label(:medium_label!)
34
18
  @alert = new_label(:small_label!)
@@ -36,6 +20,14 @@ module Gtk2ClockApp
36
20
  @window.show_all
37
21
  end
38
22
 
23
+ def set_date(text)
24
+ @date.set_text text
25
+ end
26
+
27
+ def set_time(text)
28
+ @time.set_text text
29
+ end
30
+
39
31
  def set_weather(text)
40
32
  @weather.set_text text
41
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gtk2clockapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.210818
4
+ version: 2.1.210819
5
5
  platform: ruby
6
6
  authors:
7
7
  - carlosjhr64
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-18 00:00:00.000000000 Z
11
+ date: 2021-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: help_parser