clipboard_manager 3.0.0 → 4.0.210706

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: b3482809f7953076b0f8c8ce62c6ba14b010b886405b1dc048fb570037510eaf
4
- data.tar.gz: ebb4dac2ba0f2aad8efa86b1eea59bc13034af259c8311ea22d6d15863942e69
3
+ metadata.gz: 884536f28b9e8d38614cd4df4861889f577147e3684f684878d27a8bd9e27c29
4
+ data.tar.gz: 91d89fd8260c22fc1183a4ea3a33b6e9a7b58dac653a9ce474418f597981d556
5
5
  SHA512:
6
- metadata.gz: 73fffaa22f58886ab4f6b80185d14884a1094dbe5c3d359ac9014de19fbd0341fad55a7663144341ce6397eef636ae1d9c886dc476971bb68dd3c35f4e992248
7
- data.tar.gz: 2e36667fadd205feecaa9a3714e24c154b385dc0329dda455870e7ac21d0bff6f364179fb5f5f289148f0275f5bad098c64c491df4711d48c792b97f32ece47a
6
+ metadata.gz: acab8881f685c92a7173e5fd090e4d3566543ed5107eff5f6243b044169da3ae7a476728a122f0fdbee4c95fde598b8a22f507a5b3d9d1882b953f504222995d
7
+ data.tar.gz: fe1aded68b9451e87475970ed405c6fc48a58f060f93a05fb6887f6c3481f4a2c077714b1b9999cf71af6ebcbbc7ab0393758bdb5d6806d065bcc3e20768a338
data/README.md CHANGED
@@ -1,4 +1,8 @@
1
- # clipboard_manager
1
+ # ClipboardManager
2
+
3
+ * [VERSION 4.0.210706](https://github.com/carlosjhr64/clipboard_manager/releases)
4
+ * [github](https://github.com/carlosjhr64/clipboard_manager)
5
+ * [rubygems](https://rubygems.org/gems/clipboard_manager)
2
6
 
3
7
  ## DESCRIPTION:
4
8
 
@@ -6,76 +10,116 @@ Ruby Gtk3App Clipboard Manager.
6
10
 
7
11
  ## FEATURES
8
12
 
9
- * history
10
- * wget youtube-dl mplayer command to play youtube video
11
- * firefox opens url
13
+ Clipboard auto sends to:
14
+
15
+ * gnome-calculator
16
+ * google dictionary
17
+ * xdg-open url
12
18
  * espeak
13
- * zbarcam qrcode
14
19
 
15
- ## INSTALL:
20
+ Also:
16
21
 
17
- Note that you'll need gtk3app:
22
+ * History
23
+ * QR-Code copy to clipboard
18
24
 
19
- $ sudo gem install gtk3app
20
- $ sudo gem install clipboard_manager
25
+ ## INSTALL:
21
26
 
27
+ Note that you'll need gtk3app:
28
+ ```shell
29
+ $ gem install clipboard_manager
30
+ ```
22
31
  ## CONFIGURATION:
23
32
 
24
33
  After an initial run, your user configuration will found in:
25
34
 
26
- ~/.config/gtk3app/clipboardmanager/config-?.?.yml
27
-
28
- Towards the bottom of the file you will find the available tasks:
29
-
30
- :tasks:
31
- :mplayer:
32
- - "(https?://www\\.youtube\\.com/watch\\?v=[\\w\\-]+)"
33
- - :bashit
34
- - true
35
- - wget --quiet -O - $(youtube-dl -f 5/36/17/18 -g '$1') | mplayer -really-quiet
36
- -cache 8192 -cache-min 1 -
37
- :firefox:
38
- - "^https?://"
39
- - :firefox
40
- - true
41
- :espeak:
42
- - ".{80,}"
43
- - :espeak
44
- - true
45
-
35
+ ~/.config/gtk3app/clipboardmanager/config-?.?.rbon
36
+
37
+ At top of the file you will find the available tasks:
38
+ ```ruby
39
+ {
40
+ Tasks!: {
41
+ calculator: [
42
+ "^([\\d\\.\\+\\-\\*\\/\\%\\(\\) ]{3,80})$",
43
+ :bashit,
44
+ true,
45
+ "gnome-calculator -e '$1'"
46
+ ],
47
+ dictionary: [
48
+ "^(\\w+)$",
49
+ :bashit,
50
+ true,
51
+ "xdg-open 'https://www.google.com/search?q=definition+of+$1'"
52
+ ],
53
+ url: [
54
+ "^https?://\\w[\\-\\+\\.\\w]*(\\.\\w+)(:\\d+)?(/\\S*)?$",
55
+ :open,
56
+ true
57
+ ],
58
+ espeak: [
59
+ ".{80,}",
60
+ :espeak,
61
+ true
62
+ ]
63
+ },
64
+ #...
65
+ }
66
+ ```
46
67
  It is by this configuration that one can modify and add tasks.
68
+ Warning: although the config file looks like `ruby` code,
69
+ it is read like a config file(not evaled).
70
+ Within tolerance(see [rbon](https://rubygems.org/gems/rbon)) you must maintain it's structure.
71
+
72
+ ClipboardManager has three tasks methods: `:bashit`, `:open`, and `:espeak`.
73
+ `:bashit` will take a command to be run by the system.
74
+ `:open` will `xdg-open` the clip.
75
+ `:espeak` will `espeak` the clip.
76
+
47
77
  With the boolean `true` value the clipboard will clear on the matched task.
48
78
  If you don't want the clipboard cleared on a matched task,
49
79
  set the boolean value to `false`.
50
80
 
51
- The _mplayer_ task will run when the clipboard text matches a youtube link.
52
- It will run the given system command `wget.. youtube_dl... '$1' | mplayer ...`,
53
- where $1 will be replaced by the captured 1 match.
81
+ Note that `:bashit` requires a extra command string which
82
+ it will substitute $0, $1, $2... with match data.
83
+ It then passes the string to system.
54
84
 
55
- The _firefox_ task will run when the clipboard text matches a http address.
56
- It will open the address with firefox.
85
+ The `:caculator` task will run when the clip looks like a bunch of number being operated.
57
86
 
58
- The _espeak_ task will run when the clipboard text is at least 80 characters long.
87
+ The `:espeak` task will run when the clip is at least 80 characters long.
59
88
  It will have espeak read the text.
60
89
 
61
- Currently, clipboard_manager has three tasks methods: bashit, firefox, and espeak.
62
-
63
- For firefox and espeak, the pattern is used to recognize the text.
64
- The whole copied text is used to pass on to firefox as a url, or espeak as text to be read.
65
-
66
- bashit is more complicated.
67
- It requires a command string which it will substitute $0, $1, $2... with match data.
68
- It then passes the string to system.
69
-
70
- See [clipboard_manager/clipboard_manager.rb](https://github.com/carlosjhr64/clipboard_manager/blob/master/lib/clipboard_manager/clipboard_manager.rb)
71
- for details.
72
- Specifically, methods #espeak, #firefox, and #bashit, which are called from #manage.
73
-
74
90
  ## HELP:
75
-
76
- Usage:
77
- clipboard_manager [:options+]
78
- Options:
79
- -h --help
80
- -v --version
81
-
91
+ ```shell
92
+ $ clipboard_manager --help
93
+ Usage:
94
+ clipboard_manager [:options+]
95
+ Options:
96
+ -h --help
97
+ -v --version
98
+ --minime Real minime
99
+ --notoggle Minime wont toggle decorated and keep above
100
+ --notdecorated Dont decorate window
101
+ ```
102
+ ## LICENSE:
103
+
104
+ (The MIT License)
105
+
106
+ Copyright (c) 2021 CarlosJHR64
107
+
108
+ Permission is hereby granted, free of charge, to any person obtaining
109
+ a copy of this software and associated documentation files (the
110
+ 'Software'), to deal in the Software without restriction, including
111
+ without limitation the rights to use, copy, modify, merge, publish,
112
+ distribute, sublicense, and/or sell copies of the Software, and to
113
+ permit persons to whom the Software is furnished to do so, subject to
114
+ the following conditions:
115
+
116
+ The above copyright notice and this permission notice shall be
117
+ included in all copies or substantial portions of the Software.
118
+
119
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
120
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
121
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
122
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
123
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
124
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
125
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,14 +1,17 @@
1
1
  #!/usr/bin/env ruby
2
- require 'help_parser'
3
2
  require 'clipboard_manager'
4
3
 
5
- OPTIONS = HelpParser[ClipboardManager::VERSION, <<HELP]
6
- Usage:
7
- clipboard_manager [:options+]
8
- Options:
9
- -h --help
10
- -v --version
11
- HELP
4
+ class ClipboardManager
5
+ begin
6
+ case ARGV
7
+ in [/^(-v)|(--version)$/]
8
+ puts VERSION
9
+ in [/^(-h)|(--help)$/]
10
+ puts HELP
11
+ else
12
+ ClipboardManager.run
13
+ end
14
+ end
15
+ end
12
16
 
13
- ClipboardManager.requires
14
- Gtk3App.main ClipboardManager
17
+ exit
@@ -1,26 +1,46 @@
1
- module ClipboardManager
2
- VERSION = '3.0.0'
1
+ class ClipboardManager
2
+ class << self; attr_accessor :do_qrcode; end
3
+ ClipboardManager.do_qrcode = true
3
4
 
4
- def self.requires
5
- # Standard Libraries
6
- require 'timeout'
5
+ HELP = <<~HELP
6
+ Usage:
7
+ clipboard_manager [:options+]
8
+ Options:
9
+ -h --help
10
+ -v --version
11
+ --minime \t Real minime
12
+ --notoggle \t Minime wont toggle decorated and keep above
13
+ --notdecorated\t Dont decorate window
14
+ HELP
15
+ VERSION = '4.0.210706'
7
16
 
8
- # Work gems
17
+
18
+ def self.run
19
+
20
+ # Gems
9
21
  require 'gtk3app'
10
- require 'helpema/zbar'
22
+ begin
23
+ require 'helpema'
24
+ ::Helpema::ZBar # autoload
25
+ require 'timeout' # needed to timeout zbarcam
26
+ rescue
27
+ # no ZBar? OK, nevermind.
28
+ ClipboardManager.do_qrcode = false
29
+ end
11
30
 
12
31
  # This Gem
13
32
  require_relative 'clipboard_manager/config.rb'
14
33
  require_relative 'clipboard_manager/clipboard_manager.rb'
34
+
35
+ # Run
36
+ Gtk3App.run(klass:ClipboardManager)
15
37
  end
16
38
  end
17
39
 
18
40
  # Requires:
19
- #`ruby`
20
- #`gtk3app`
21
- #`zbarcam`
22
- #`firefox`
41
+ #`gnome-calculator`
23
42
  #`espeak`
24
- #`wget`
25
- #`youtube-dl`
26
43
  #`system`
44
+ #`ruby`
45
+ #`xdg-open`
46
+ #`zbarcam`
@@ -1,53 +1,56 @@
1
- module ClipboardManager
2
- using Rafini::Exception
1
+ def Gtk3App.toggle!
2
+ @clipboard_manager_hook.do_toggle!
3
+ end
3
4
 
4
- def self.run(program)
5
- ClipboardManager.new(program)
6
- end
5
+ def Gtk3App.clipboard_manager_hook(hook)
6
+ @clipboard_manager_hook = hook
7
+ end
7
8
 
8
- class NoYes < Such::Dialog
9
- def initialize(*par)
10
- super
11
- add_button '_No', Gtk::ResponseType::CANCEL
12
- add_button '_Yes', Gtk::ResponseType::OK
13
- end
9
+ class ClipboardManager
10
+ using Rafini::Exception
14
11
 
15
- def label(*par)
16
- Such::Label.new child, *par
17
- end
12
+ class NoYes < Such::Dialog
13
+ def initialize(*par)
14
+ super
15
+ add_button '_No', Gtk::ResponseType::CANCEL
16
+ add_button '_Yes', Gtk::ResponseType::OK
17
+ end
18
18
 
19
- def ok?
20
- show_all
21
- response = run
22
- destroy
23
- response == Gtk::ResponseType::OK
24
- end
25
- end
19
+ def label(*par)
20
+ Such::Label.new child, *par
21
+ end
26
22
 
27
- class CancelOk < Such::Dialog
28
- def initialize(*par)
29
- super
30
- add_button(Gtk::Stock::CANCEL, Gtk::ResponseType::CANCEL)
31
- add_button(Gtk::Stock::OK, Gtk::ResponseType::OK)
23
+ def ok?
24
+ show_all
25
+ response = run
26
+ destroy
27
+ response == Gtk::ResponseType::OK
28
+ end
32
29
  end
33
30
 
34
- def combo(*par)
35
- Such::ComboBoxText.new child, *par
36
- end
31
+ class CancelOk < Such::Dialog
32
+ def initialize(*par)
33
+ super
34
+ add_button(Gtk::Stock::CANCEL, Gtk::ResponseType::CANCEL)
35
+ add_button(Gtk::Stock::OK, Gtk::ResponseType::OK)
36
+ end
37
+
38
+ def combo(*par)
39
+ Such::ComboBoxText.new child, *par
40
+ end
37
41
 
38
- def runs
39
- show_all
40
- response = run
41
- yield if response == Gtk::ResponseType::OK
42
- destroy
42
+ def runs
43
+ show_all
44
+ response = run
45
+ yield if response == Gtk::ResponseType::OK
46
+ destroy
47
+ end
43
48
  end
44
- end
45
49
 
46
- class ClipboardManager
47
- CLIPBOARD = Gtk::Clipboard.get(Gdk::Selection::CLIPBOARD)
50
+ CLIPBOARD = Gtk::Clipboard.get(Gdk::Selection::PRIMARY)
48
51
 
49
- def initialize(program)
50
- @image = program.mini.children.first
52
+ def initialize(stage, toolbar, options)
53
+ @image = toolbar.parent.children[0].child # Expander:hbox:EventImage:Image
51
54
  @timer = nil
52
55
 
53
56
  @working = GdkPixbuf::Pixbuf.new(file: CONFIG[:Working])
@@ -58,9 +61,7 @@ class ClipboardManager
58
61
 
59
62
  @is_pwd = Regexp.new(CONFIG[:IsPwd], Regexp::EXTENDED)
60
63
 
61
- @window = program.window
62
- vbox = Such::Box.new @window, :vbox!
63
-
64
+ vbox = Such::Box.new(stage, :vbox!)
64
65
  @running = Such::CheckButton.new(vbox, :running!, 'toggled'){toggled}
65
66
  @running.active = true
66
67
 
@@ -70,19 +71,12 @@ class ClipboardManager
70
71
  Such::Label.new vbox, :tasks!
71
72
 
72
73
  @checks = {}
73
- CONFIG[:tasks].keys.each do |key|
74
+ CONFIG[:Tasks!].keys.each do |key|
74
75
  @checks[key] = Such::CheckButton.new(vbox, [key.to_s.capitalize], {set_active: true})
75
76
  end
76
77
 
77
78
  Such::Button.new(vbox, :history_button!){do_history!}
78
- Such::Button.new(vbox, :qrcode_button!){do_qrcode!}
79
-
80
- program.app_menu.each{|_|_.destroy if _.key==:fs!}
81
-
82
- mm = program.mini_menu
83
- mm.add_menu_item(:do_toggle!){do_toggle!}
84
- mm.add_menu_item(:do_history!){do_history!}
85
- mm.add_menu_item(:do_qrcode!){do_qrcode!}
79
+ Such::Button.new(vbox, :qrcode_button!){do_qrcode!} if ClipboardManager.do_qrcode
86
80
 
87
81
  @history, @previous = [], nil
88
82
  text = request_text
@@ -95,14 +89,15 @@ class ClipboardManager
95
89
  true # repeat
96
90
  end
97
91
 
92
+ Gtk3App.clipboard_manager_hook(self)
93
+
98
94
  status(@ready)
99
- @window.show_all
100
95
  end
101
96
 
102
97
  # https://github.com/ruby-gnome2/ruby-gnome2/blob/master/gtk3/sample/misc/dialog.rb
103
98
  def do_history!
104
99
  dialog = CancelOk.new(:history_dialog!)
105
- dialog.transient_for = @window
100
+ Gtk3App.transient dialog
106
101
  combo = dialog.combo :history_combo!
107
102
  @history.each do |str|
108
103
  if str.length > CONFIG[:MaxString]
@@ -120,20 +115,19 @@ class ClipboardManager
120
115
  end
121
116
 
122
117
  def do_qrcode!
123
- qrcode = Helpema::ZBar.cam(CONFIG[:QrcTimeOut])
124
- if qrcode.nil?
125
- CLIPBOARD.clear
126
- status(@nope)
127
- else
128
- CLIPBOARD.text = qrcode
129
- status(@ok)
130
- end
118
+ qrcode = Timeout::timeout(CONFIG[:QrcTimeOut]){ Helpema::ZBar.cam() }
119
+ CLIPBOARD.text = qrcode
120
+ status(@ok)
121
+ rescue
122
+ $!.puts
123
+ CLIPBOARD.clear
124
+ status(@nope)
131
125
  end
132
126
 
133
127
  def question?(name)
134
128
  return true unless @ask.active?
135
129
  dialog = NoYes.new :question_dialog!
136
- dialog.transient_for = @window
130
+ Gtk3App.transient dialog
137
131
  dialog.label.text = "Run #{name}?"
138
132
  dialog.ok?
139
133
  end
@@ -185,7 +179,7 @@ class ClipboardManager
185
179
 
186
180
  def manage(text)
187
181
  add_history text
188
- CONFIG[:tasks].each do |name, _|
182
+ CONFIG[:Tasks!].each do |name, _|
189
183
  next unless @checks[name].active?
190
184
  rgx, mth, clr, str = _
191
185
  rgx = Regexp.new(rgx, Regexp::EXTENDED | Regexp::MULTILINE)
@@ -195,8 +189,8 @@ class ClipboardManager
195
189
  case mth
196
190
  when :espeak
197
191
  espeak(text)
198
- when :firefox
199
- firefox(text)
192
+ when :open
193
+ open(text)
200
194
  when :bashit
201
195
  bashit(md, str)
202
196
  else
@@ -217,9 +211,8 @@ class ClipboardManager
217
211
  Rafini.thread_bang!{IO.popen(CONFIG[:Espeak], 'w'){|e|e.puts text.strip}}
218
212
  end
219
213
 
220
- def firefox(text)
221
- raise "quote not allowed in url" if text =~ /'/
222
- Process.detach spawn "#{CONFIG[:Firefox]} '#{text}'"
214
+ def open(text)
215
+ Process.detach spawn CONFIG[:Open], text
223
216
  end
224
217
 
225
218
  def bashit(md, str)
@@ -229,6 +222,4 @@ class ClipboardManager
229
222
  $stderr.puts str
230
223
  Process.detach spawn str
231
224
  end
232
-
233
- end
234
225
  end
@@ -1,25 +1,37 @@
1
- module ClipboardManager
2
- using Rafini::String
3
-
4
- APPDIR = File.dirname File.dirname __dir__
1
+ class ClipboardManager
2
+ using Rafini::String # String#semantic
3
+ extend Rafini::Empty # a0 and h0
5
4
 
6
5
  is_pwd =
7
6
  '\A
8
7
  (?!\w+:\/\/) # not like url
9
8
  (?!\/[a-z]+\/[a-z]) # not like linux path
10
9
  (?![a-z]+\/[a-z]+\/) # not like relative path
11
- (?=.*\d) # at least one diget
10
+ (?=.*\d) # at least one digit
12
11
  (?=.*[a-z]) # at least one lower case letter
13
12
  (?=.*[A-Z]) # at least one upper case letter
14
13
  (?=.*[^\w\s]) # at least one special character
15
14
  \S*$ # no spaces
16
15
  \Z'
17
16
 
18
- a0 = Rafini::Empty::ARRAY
19
- h0 = Rafini::Empty::HASH
20
- #s0 = Rafini::Empty::STRING
21
-
22
17
  CONFIG = {
18
+ Tasks!: { # Note that Ruby's Hash preserves order, and order here is important.
19
+ calculator: [
20
+ '^([\d\.\+\-\*\/\%\(\) ]{3,80})$',
21
+ :bashit,
22
+ true, # clears clipboard
23
+ "gnome-calculator -e '$1'",
24
+ ],
25
+ dictionary: [
26
+ '^(\w+)$',
27
+ :bashit,
28
+ true, # clears clipboard
29
+ "xdg-open 'https://www.google.com/search?q=definition+of+$1'",
30
+ ],
31
+ url: ['^https?://\w[\-\+\.\w]*(\.\w+)(:\d+)?(/\S*)?$', :open, true],
32
+ espeak: ['.{80,}', :espeak, true],
33
+ },
34
+
23
35
  StatusTimeOut: 3,
24
36
  Sleep: 750,
25
37
  MaxHistory: 13,
@@ -30,95 +42,80 @@ module ClipboardManager
30
42
  IsPwd: is_pwd,
31
43
 
32
44
  Espeak: 'espeak --stdin',
33
- Firefox: 'firefox',
34
-
35
- Working: "#{XDG['DATA']}/gtk3app/clipboardmanager/working.png",
36
- Ok: "#{XDG['DATA']}/gtk3app/clipboardmanager/ok.png",
37
- Nope: "#{XDG['DATA']}/gtk3app/clipboardmanager/nope.png",
38
- Ready: "#{XDG['DATA']}/gtk3app/clipboardmanager/ready.png",
39
- Off: "#{XDG['DATA']}/gtk3app/clipboardmanager/off.png",
40
-
41
- thing: {
42
-
43
- HelpFile: "https://github.com/carlosjhr64/clipboard_manager",
44
- Logo: "#{XDG['DATA']}/gtk3app/clipboardmanager/logo.png",
45
-
46
- about_dialog: {
47
- set_program_name: 'Clipboard Manager',
48
- set_version: VERSION.semantic(0..1),
49
- set_copyright: '(c) 2018 CarlosJHR64',
50
- set_comments: 'A Ruby Gtk3App Clipboard Manager ',
51
- set_website: 'https://github.com/carlosjhr64/clipboard_manager',
52
- set_website_label: 'See it at GitHub!',
53
- },
54
-
55
- DO_TOGGLE: [label:'Toggle On/Off'],
56
- do_toggle!: [:DO_TOGGLE, 'activate'],
57
-
58
- DO_HISTORY: [label:'History'],
59
- do_history!: [:DO_HISTORY, 'activate'],
60
-
61
- DO_QRCODE: [label:'QR-Code'],
62
- do_qrcode!: [:DO_QRCODE, 'activate'],
63
-
64
- window: {
65
- set_title: "Clipboard Manager",
66
- set_window_position: :center,
67
- },
68
-
69
- VBOX: [:vertical],
70
- vbox: h0,
71
- vbox!: [:VBOX, :vbox],
72
-
73
- ASK: ['Ask For Confirmation'],
74
- ask: h0,
75
- ask!: [:ASK, :ask],
76
-
77
- RUNNING: ['On/Off'],
78
- running: h0,
79
- running!: [:RUNNING, :running],
80
-
81
- TASKS: ['Tasks:'],
82
- tasks: h0,
83
- tasks!: [:TASKS, :tasks],
84
-
85
- HISTORY_BUTTON: [label: 'History'],
86
- history_button: h0,
87
- history_button!: [:HISTORY_BUTTON, :history_button],
88
-
89
- HISTORY_DIALOG: a0,
90
- history_dialog: {
91
- set_window_position: :center,
92
- },
93
- history_dialog!: [:HISTORY_DIALOG, :history_dialog],
94
-
95
- HISTORY_COMBO: a0,
96
- history_combo: h0,
97
- history_combo!: [:HISTORY_COMBO, :history_combo],
98
-
99
- QRCODE_BUTTON: [label: 'QR-Code'],
100
- qrcode_button: h0,
101
- qrcode_button!: [:QRCODE_BUTTON, :qrcode_button],
102
-
103
- QUESTION_DIALOG: a0,
104
- question_dialog: {
105
- set_window_position: :center,
106
- set_keep_above: true,
107
- },
108
- question_dialog!: [:question_dialog, :QUESTION_DIALOG],
45
+
46
+ Working: "#{UserSpace::XDG['data']}/gtk3app/clipboardmanager/working.png",
47
+ Ok: "#{UserSpace::XDG['data']}/gtk3app/clipboardmanager/ok.png",
48
+ Nope: "#{UserSpace::XDG['data']}/gtk3app/clipboardmanager/nope.png",
49
+ Ready: "#{UserSpace::XDG['data']}/gtk3app/clipboardmanager/ready.png",
50
+ Off: "#{UserSpace::XDG['data']}/gtk3app/clipboardmanager/off.png",
51
+
52
+ HelpFile: "https://github.com/carlosjhr64/clipboard_manager",
53
+ Logo: "#{UserSpace::XDG['data']}/gtk3app/clipboardmanager/logo.png",
54
+
55
+ ### Gui Things ###
56
+
57
+ about_dialog: {
58
+ set_program_name: 'Clipboard Manager',
59
+ set_version: VERSION.semantic(0..1),
60
+ set_copyright: '(c) 2018 CarlosJHR64',
61
+ set_comments: 'A Ruby Gtk3App Clipboard Manager ',
62
+ set_website: 'https://github.com/carlosjhr64/clipboard_manager',
63
+ set_website_label: 'See it at GitHub!',
109
64
  },
110
65
 
111
- # Note that Ruby 2 hashes preserves order, and order here is important.
112
- tasks: {
113
- mplayer: [
114
- '(https?://www\.youtube\.com/watch\?v=[\w\-]+)',
115
- :bashit,
116
- true, # clears clipboard
117
- "wget --quiet -O - $(youtube-dl -f 5/36/17/18 -g '$1') | mplayer -really-quiet -cache 8192 -cache-min 1 -",
118
- ],
119
- firefox: ['^https?://', :firefox, true],
120
- espeak: ['.{80,}', :espeak, true],
121
- }
122
- }
66
+ window: {
67
+ set_title: "Clipboard Manager",
68
+ set_window_position: :center,
69
+ },
70
+
71
+ VBOX: [:vertical],
72
+ vbox: h0,
73
+ vbox!: [:VBOX, :vbox],
74
+
75
+ ASK: ['Ask For Confirmation'],
76
+ ask: h0,
77
+ ask!: [:ASK, :ask],
78
+
79
+ RUNNING: ['On/Off'],
80
+ running: h0,
81
+ running!: [:RUNNING, :running],
82
+
83
+ TASKS: ['Tasks:'],
84
+ tasks: h0,
85
+ tasks!: [:TASKS, :tasks],
123
86
 
87
+ HISTORY_BUTTON: [label: 'History'],
88
+ history_button: h0,
89
+ history_button!: [:HISTORY_BUTTON, :history_button],
90
+
91
+ HISTORY_DIALOG: a0,
92
+ history_dialog: {
93
+ set_window_position: :center,
94
+ },
95
+ history_dialog!: [:HISTORY_DIALOG, :history_dialog],
96
+
97
+ HISTORY_COMBO: a0,
98
+ history_combo: h0,
99
+ history_combo!: [:HISTORY_COMBO, :history_combo],
100
+
101
+ QRCODE_BUTTON: [label: 'QR-Code'],
102
+ qrcode_button: h0,
103
+ qrcode_button!: [:QRCODE_BUTTON, :qrcode_button],
104
+
105
+ QUESTION_DIALOG: a0,
106
+ question_dialog: {
107
+ set_window_position: :center,
108
+ set_keep_above: true,
109
+ },
110
+ question_dialog!: [:question_dialog, :QUESTION_DIALOG],
111
+
112
+ # Toggle's app-menu item.
113
+ # Application MAY modify :TOGGLE for language.
114
+ TOGGLE: [label: 'Toggle'],
115
+ toggle: h0,
116
+ toggle!: [:TOGGLE, :toggle, 'activate'],
117
+ app_menu: {
118
+ add_menu_item: [ :toggle!, :minime!, :help!, :about!, :quit! ],
119
+ },
120
+ }
124
121
  end
metadata CHANGED
@@ -1,78 +1,58 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clipboard_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 4.0.210706
5
5
  platform: ruby
6
6
  authors:
7
7
  - carlosjhr64
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-19 00:00:00.000000000 Z
11
+ date: 2021-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: help_parser
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '6.5'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 6.5.0
23
- type: :runtime
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '6.5'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 6.5.0
33
13
  - !ruby/object:Gem::Dependency
34
14
  name: gtk3app
35
15
  requirement: !ruby/object:Gem::Requirement
36
16
  requirements:
37
17
  - - "~>"
38
18
  - !ruby/object:Gem::Version
39
- version: '3.0'
19
+ version: '5.1'
40
20
  - - ">="
41
21
  - !ruby/object:Gem::Version
42
- version: 3.0.0
22
+ version: 5.1.210203
43
23
  type: :runtime
44
24
  prerelease: false
45
25
  version_requirements: !ruby/object:Gem::Requirement
46
26
  requirements:
47
27
  - - "~>"
48
28
  - !ruby/object:Gem::Version
49
- version: '3.0'
29
+ version: '5.1'
50
30
  - - ">="
51
31
  - !ruby/object:Gem::Version
52
- version: 3.0.0
32
+ version: 5.1.210203
53
33
  - !ruby/object:Gem::Dependency
54
34
  name: helpema
55
35
  requirement: !ruby/object:Gem::Requirement
56
36
  requirements:
57
37
  - - "~>"
58
38
  - !ruby/object:Gem::Version
59
- version: '1.0'
39
+ version: '3.0'
60
40
  - - ">="
61
41
  - !ruby/object:Gem::Version
62
- version: 1.0.1
42
+ version: 3.0.210706
63
43
  type: :runtime
64
44
  prerelease: false
65
45
  version_requirements: !ruby/object:Gem::Requirement
66
46
  requirements:
67
47
  - - "~>"
68
48
  - !ruby/object:Gem::Version
69
- version: '1.0'
49
+ version: '3.0'
70
50
  - - ">="
71
51
  - !ruby/object:Gem::Version
72
- version: 1.0.1
52
+ version: 3.0.210706
73
53
  description: 'Ruby Gtk3App Clipboard Manager.
74
54
 
75
- '
55
+ '
76
56
  email: carlosjhr64@gmail.com
77
57
  executables:
78
58
  - clipboard_manager
@@ -82,7 +62,6 @@ files:
82
62
  - LICENSE
83
63
  - README.md
84
64
  - bin/clipboard_manager
85
- - data/VERSION
86
65
  - data/logo.png
87
66
  - data/nope.png
88
67
  - data/off.png
@@ -96,7 +75,7 @@ homepage: https://github.com/carlosjhr64/clipboard_manager
96
75
  licenses:
97
76
  - MIT
98
77
  metadata: {}
99
- post_install_message:
78
+ post_install_message:
100
79
  rdoc_options: []
101
80
  require_paths:
102
81
  - lib
@@ -111,16 +90,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
90
  - !ruby/object:Gem::Version
112
91
  version: '0'
113
92
  requirements:
114
- - 'ruby: ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]'
93
+ - 'gnome-calculator: 40.1'
94
+ - 'espeak: eSpeak NG text-to-speech: 1.50 Data at: /usr/share/espeak-ng-data'
115
95
  - 'system: linux/bash'
116
- - 'zbarcam: 0.20.1'
117
- - 'firefox: Mozilla Firefox 63.0.3'
118
- - 'espeak: eSpeak text-to-speech: 1.48.03 04.Mar.14 Data at: /usr/share/espeak-data'
119
- - 'wget: GNU Wget 1.19.5 built on linux-gnu.'
120
- - 'youtube-dl: 2018.11.07'
121
- rubyforge_project:
122
- rubygems_version: 2.7.6
123
- signing_key:
96
+ - 'ruby: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-linux]'
97
+ - 'xdg-open: xdg-open 1.1.3+'
98
+ - 'zbarcam: 0.23'
99
+ rubygems_version: 3.2.15
100
+ signing_key:
124
101
  specification_version: 4
125
102
  summary: Ruby Gtk3App Clipboard Manager.
126
103
  test_files: []
data/data/VERSION DELETED
@@ -1 +0,0 @@
1
- 3.0.0