gtk2clockapp 2.1.210818 → 2.2.230108

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: 2ac27497b790add88dfc9540564a9a6d2461f84fa1637e397d062bcc13f6cc99
4
+ data.tar.gz: 28b5c8208954db089c4cb9eb080d30a2ddcd8461cb0ab36b6243042becb025b5
5
5
  SHA512:
6
- metadata.gz: fa922051af87a7b759853b8e8c7d2739addd57a5480cf0caa7e72991f97ddcdc852d830631e39ac69d6c79f3c347b641ed4e5e877d632560b6fa748c0ddea3ca
7
- data.tar.gz: 6c75812d05339cd79b059fcd0da6ea4b0edf4c390d3160f6290467c239751c47609875bff0498a655f08b061cc2ba8789e1786f5cd854f5188c830e088390bde
6
+ metadata.gz: b8a70af08a4c3c86b2e4f93858ccc48bafdd3d621e1eb5e203067855081a4c4dc0e44dbde1c9983bc825cd4c37bbf439c295d2d1c227f302e8fafe2982545f3e
7
+ data.tar.gz: 1f0ac94d66ab239da27342b594fe2bf7f3a8741b99de7c637ee960c78ea9f897804dbc1058052b23f450222ae2cfebee31e50b2c40bbe67df6538ab36c1ad6a4
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.2.230108](https://github.com/carlosjhr64/gtk2clockapp/releases)
4
4
  * [github](https://github.com/carlosjhr64/gtk2clockapp)
5
5
  * [rubygems](https://rubygems.org/gems/gtk2clockapp)
6
6
 
@@ -30,7 +30,7 @@ Mode: night
30
30
  ```
31
31
  ![Night Mode](img/night.png)
32
32
  ## HELP:
33
- ```shell
33
+ ```console
34
34
  $ gtk2clockapp --help
35
35
  Usage:
36
36
  gtk2clockapp [:options+]
@@ -39,7 +39,7 @@ Options:
39
39
  -v --version
40
40
  --fullscreen
41
41
  --notdecorated
42
- --size=INT 250
42
+ --size=INT 186
43
43
  --font=NAME Courier
44
44
  --background=COLOR 000000
45
45
  --day=COLOR 00FF00
@@ -54,7 +54,7 @@ Types:
54
54
 
55
55
  (The MIT License)
56
56
 
57
- Copyright (c) 2021 CarlosJHR64
57
+ Copyright (c) 2023 CarlosJHR64
58
58
 
59
59
  Permission is hereby granted, free of charge, to any person obtaining
60
60
  a copy of this software and associated documentation files (the
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,18 @@ 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
+ loop do
28
+ gui.set_date now[:DateB]
29
+ gui.set_time now[:Time]
30
+ sleep(60 - Time.now.sec)
31
+ 11.times do |i|
32
+ gui.set_date now[[:DateA, :DateB][i%2]]
33
+ sleep 5
34
+ end
35
+ end
36
+ end
25
37
  gui.set_weather '' # '⛅ 75F 92F/66F'
26
38
  gui.set_spot '' # '🗠 WUT: $500'
27
39
  gui.set_alert '' # '📢 Attention!'
@@ -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,38 +20,14 @@ module Gtk2ClockApp
36
20
  @window.show_all
37
21
  end
38
22
 
39
- def set_weather(text)
40
- @weather.set_text text
41
- end
42
-
43
- def set_spot(text)
44
- @spot.set_text text
45
- end
46
-
47
- def set_alert(text)
48
- @alert.set_text text
49
- end
50
-
51
- def labels
52
- [@date, @time, @weather, @spot, @alert]
53
- end
54
-
55
- def day_mode
56
- labels.each do |label|
57
- label.override_color(:normal, CONFIG[:Day])
58
- end
59
- end
60
-
61
- def dusk_mode
62
- labels.each do |label|
63
- label.override_color(:normal, CONFIG[:Dusk])
64
- end
65
- end
66
-
67
- def night_mode
68
- labels.each do |label|
69
- label.override_color(:normal, CONFIG[:Night])
70
- end
71
- end
23
+ def set_date(text) = @date.set_text(text)
24
+ def set_time(text) = @time.set_text(text)
25
+ def set_weather(text) = @weather.set_text(text)
26
+ def set_spot(text) = @spot.set_text(text)
27
+ def set_alert(text) = @alert.set_text(text)
28
+ def labels = [@date, @time, @weather, @spot, @alert]
29
+ def day_mode = labels.each{_1.override_color(:normal,CONFIG[:Day])}
30
+ def dusk_mode = labels.each{_1.override_color(:normal,CONFIG[:Dusk])}
31
+ def night_mode = labels.each{_1.override_color(:normal,CONFIG[:Night])}
72
32
  end
73
33
  end
data/lib/gtk2clockapp.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Gtk2ClockApp
2
- VERSION = '2.1.210818'
2
+ VERSION = '2.2.230108'
3
3
 
4
4
  def self.gui
5
5
  require 'gtk3'
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.2.230108
5
5
  platform: ruby
6
6
  authors:
7
- - carlosjhr64
8
- autorequire:
7
+ - CarlosJHR64
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-18 00:00:00.000000000 Z
11
+ date: 2023-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: help_parser
@@ -16,60 +16,60 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '7.0'
19
+ version: '8.1'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 7.0.200907
22
+ version: 8.1.221206
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: '7.0'
29
+ version: '8.1'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 7.0.200907
32
+ version: 8.1.221206
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: gtk3
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '3.4'
39
+ version: '4.0'
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 3.4.6
42
+ version: 4.0.5
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: '3.4'
49
+ version: '4.0'
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 3.4.6
52
+ version: 4.0.5
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: such
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: '2.0'
59
+ version: '2.1'
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: 2.0.210201
62
+ version: 2.1.230106
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '2.0'
69
+ version: '2.1'
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
- version: 2.0.210201
72
+ version: 2.1.230106
73
73
  description: |
74
74
  A clock/bulletin board with a STDIN interface.
75
75
 
@@ -91,7 +91,7 @@ homepage: https://github.com/carlosjhr64/gtk2clockapp
91
91
  licenses:
92
92
  - MIT
93
93
  metadata: {}
94
- post_install_message:
94
+ post_install_message:
95
95
  rdoc_options: []
96
96
  require_paths:
97
97
  - lib
@@ -106,9 +106,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  - !ruby/object:Gem::Version
107
107
  version: '0'
108
108
  requirements:
109
- - 'ruby: ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux]'
110
- rubygems_version: 3.2.22
111
- signing_key:
109
+ - 'ruby: ruby 3.2.0 (2022-12-25 revision a528908271) [aarch64-linux]'
110
+ rubygems_version: 3.4.2
111
+ signing_key:
112
112
  specification_version: 4
113
113
  summary: A clock/bulletin board with a STDIN interface.
114
114
  test_files: []