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 +4 -4
- data/README.md +1 -1
- data/bin/gtk2clockapp +15 -1
- data/lib/gtk2clockapp.rb +1 -1
- data/lib/gtk2clockapp/config.rb +1 -1
- data/lib/gtk2clockapp/gui.rb +10 -18
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5f28a1d3e170ed1c15e28394cdee787a7fcd2cfcc8fab1971dd1ad588b9294d
|
4
|
+
data.tar.gz: 9ed1880d154a032a94eaba9a62f3dc809c75c39f6ec0dd45719f226d449076bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
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
data/lib/gtk2clockapp/config.rb
CHANGED
data/lib/gtk2clockapp/gui.rb
CHANGED
@@ -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
|
30
|
-
@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.
|
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-
|
11
|
+
date: 2021-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: help_parser
|