gtk2mp3 3.1.210926 → 3.2.230112

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7c165134edc00cdf60e79473c1c85808eeb405719c81daa096b8ace59af8b83
4
- data.tar.gz: d909d47246ceaf95959dbde7e30ea4e63de94e54d5f7c0852f5ffa449ffff5c9
3
+ metadata.gz: a7f31d4ae2d5af872d9c75141828b23b3636cf10ca4c6902fc77d37f41d00246
4
+ data.tar.gz: 217cf9c6ddcd6c07c920b6c2f5e33d1d22fd1f4072715183a359bcc21226d2e6
5
5
  SHA512:
6
- metadata.gz: f0c7bc19d1a82272bbd644e8a3fc3592b00053477e5fafefd4bffebca2e6904fd178267a3780e35aa2ed776dea909593f4e9ad2daaef60972117586c80cc54b9
7
- data.tar.gz: ddb29e99f9c23a0cd710c656744afaf95180e08fa70f542a87c698a56777ec9f9323e3b1bf952a9ef70aebc55e66faaa5e5f4e370a5598b8c6549a6dd768a036
6
+ metadata.gz: '079e757062dd079e5d8ce944c9f0762001e70a2b9d5214598bcd1627963473484453f67288a958b837f19d0ffd3e94b821b269ac783b7ed5a2cbe1bbe9d33e39'
7
+ data.tar.gz: cb8d058b4717cd924137bc0e3e938f29edf22e3ba20dd9c79e8c2c9f54a4270af2bc76bc3437ad7537b86ffec87bb92f6f668b21d72cf79c91d21e4182d7f456
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Gtk2Mp3
2
2
 
3
- * [VERSION 3.1.210926](https://github.com/carlosjhr64/gtk2mp3/releases)
3
+ * [VERSION 3.2.230112](https://github.com/carlosjhr64/gtk2mp3/releases)
4
4
  * [github](https://www.github.com/carlosjhr64/gtk2mp3)
5
5
  * [rubygems](https://rubygems.org/gems/gtk2mp3)
6
6
 
@@ -16,6 +16,10 @@ $ gtk2mp3
16
16
  ```console
17
17
  $ gem install gtk2mp3
18
18
  ```
19
+ ## SCREENSHOT
20
+
21
+ ![Screenshot](img/screenshot.png)
22
+
19
23
  ## HELP
20
24
  ```console
21
25
  $ gtk2mp3 --help
@@ -35,13 +39,16 @@ Options:
35
39
  ## MORE:
36
40
 
37
41
  You can add your own custom buttons.
38
- See my [Picard](lib/gtk2mp3/picard_button.rb) button hook.
42
+ See:
43
+
44
+ * [Picard](lib/gtk2mp3/picard_button.rb) button hook.
45
+ * [Trash](lib/gtk2mp3/trash_button.rb) button hook.
39
46
 
40
47
  ## LICENSE:
41
48
 
42
49
  (The MIT License)
43
50
 
44
- Copyright (c) 2021 CarlosJHR64
51
+ Copyright (c) 2023 CarlosJHR64
45
52
 
46
53
  Permission is hereby granted, free of charge, to any person obtaining
47
54
  a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ class Gtk2Mp3
27
27
  about_dialog: {
28
28
  set_program_name: 'Gtk2Mp3',
29
29
  set_version: VERSION.semantic(0..1),
30
- set_copyright: '(c) 2021 CarlosJHR64',
30
+ set_copyright: '(c) 2023 CarlosJHR64',
31
31
  set_comments: 'A MPD/MPC "Next!" Button',
32
32
  set_website: 'https://github.com/carlosjhr64/gtk2mp3',
33
33
  set_website_label: 'See it at GitHub!',
data/lib/gtk2mp3/gui.rb CHANGED
@@ -3,6 +3,7 @@ class Gtk2Mp3
3
3
  @label.text = text
4
4
  end
5
5
 
6
+ # gui = Gtk2Mp3.new(stage, toolbar, options){Gtk2Mp3.mpc_command _1}
6
7
  def initialize(stage, toolbar, options, &block)
7
8
  @toolbox = Such::Box.new toolbar, :toolbox!
8
9
  CONFIG[:BUTTONS].each do |button|
data/lib/gtk2mp3/mpd.rb CHANGED
@@ -45,7 +45,7 @@ class Gtk2Mp3
45
45
 
46
46
  def Gtk2Mp3.mpc_idleloop(gui)
47
47
  Thread.new do
48
- IO.popen('mpc idleloop', 'r') do |pipe|
48
+ IO.popen('mpc idleloop player', 'r') do |pipe|
49
49
  while line = pipe.gets
50
50
  gui.set_label File.basename(`mpc current`.strip, '.*')
51
51
  end
@@ -1,8 +1,8 @@
1
+ # [Picard](https://musicbrainz.org/doc/Picard_Linux_Install)
1
2
  # To activate this hook, edit your current configuration file:
2
3
  # ~/.config/gtk3app/gtk2mp3/config-?.?.rbon
3
4
  # Set:
4
5
  # MonkeyPatch: "gtk2mp3/picard_button",
5
- require 'shellwords'
6
6
  class Gtk2Mp3
7
7
  extend Rafini::Empty
8
8
 
@@ -10,31 +10,15 @@ class Gtk2Mp3
10
10
  CONFIG[:PICARD_BUTTON] = [label: 'Picard']
11
11
  CONFIG[:picard_button] = h0,
12
12
  CONFIG[:picard_button!] = [:PICARD_BUTTON,:picard_button,'clicked']
13
+ # If your music is not in ~/Music, edit your config file:
13
14
  CONFIG[:Music] ||= File.expand_path '~/Music'
14
15
 
15
16
  def Gtk2Mp3.hook(command)
16
17
  case command
17
18
  when :picard_button!
18
- current = `mpc current`.strip
19
- if current=~/^(.*) - (.*)/
20
- artist,title = $1,$2
21
- else
22
- artist,title = nil,current
23
- end
24
- tfiles = `mpc search Title #{Shellwords.escape(title)} | egrep '\.mp3$'`
25
- .strip.split
26
- if artist and tfiles.length > 1
27
- afiles =
28
- `mpc search Artist #{Shellwords.escape(artist)} | egrep '\.mp3$'`
29
- .strip.split
30
- tfiles.delete_if{ not afiles.include? _1}
31
- end
32
- if tfiles.length > 0
33
- files = tfiles.map{Shellwords.escape File.join(CONFIG[:Music], _1)}
34
- .join(' ')
35
- spawn "picard #{files}" if tfiles.length > 0
36
- else
37
- $stderr.puts "Not an mp3 file: #{current}"
19
+ if current = `mpc --format '%file%' current`.strip
20
+ file = File.join(CONFIG[:Music], current)
21
+ spawn "picard #{file}"
38
22
  end
39
23
  end
40
24
  end
@@ -0,0 +1,28 @@
1
+ # Trash:
2
+ # Uses `gio trash file`.
3
+ # To activate this hook, edit your current configuration file:
4
+ # ~/.config/gtk3app/gtk2mp3/config-?.?.rbon
5
+ # Set:
6
+ # MonkeyPatch: "gtk2mp3/trash_button",
7
+ class Gtk2Mp3
8
+ extend Rafini::Empty
9
+
10
+ CONFIG[:BUTTONS].push :trash_button!
11
+ CONFIG[:TRASH_BUTTON] = [label: 'Trash!']
12
+ CONFIG[:trash_button] = h0,
13
+ CONFIG[:trash_button!] = [:TRASH_BUTTON,:trash_button,'clicked']
14
+ # If your music is not in ~/Music, edit your config file:
15
+ CONFIG[:Music] ||= File.expand_path '~/Music'
16
+
17
+ def Gtk2Mp3.hook(command)
18
+ case command
19
+ when :trash_button!
20
+ if position_file = `mpc --format '%position% %file%' current`.strip
21
+ position,file = position_file.split(' ',2)
22
+ if system('mpc','del',position)
23
+ system('gio','trash',File.join(CONFIG[:Music],file))
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
data/lib/gtk2mp3.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  class Gtk2Mp3
2
- VERSION = '3.1.210926'
2
+ VERSION = '3.2.230112'
3
3
  HELP = <<~HELP
4
4
  Usage:
5
5
  gtk2mp3 [:options+]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gtk2mp3
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.210926
4
+ version: 3.2.230112
5
5
  platform: ruby
6
6
  authors:
7
7
  - CarlosJHR64
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-26 00:00:00.000000000 Z
11
+ date: 2023-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gtk3app
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '5.3'
19
+ version: '5.4'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 5.3.210919
22
+ version: 5.4.230109
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: '5.3'
29
+ version: '5.4'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 5.3.210919
32
+ version: 5.4.230109
33
33
  description: 'A "Next!" button gui for [MPD/MPC](https://www.musicpd.org/).
34
34
 
35
35
  '
@@ -39,7 +39,6 @@ executables:
39
39
  extensions: []
40
40
  extra_rdoc_files: []
41
41
  files:
42
- - LICENSE
43
42
  - README.md
44
43
  - bin/gtk2mp3
45
44
  - data/logo.png
@@ -48,11 +47,12 @@ files:
48
47
  - lib/gtk2mp3/gui.rb
49
48
  - lib/gtk2mp3/mpd.rb
50
49
  - lib/gtk2mp3/picard_button.rb
50
+ - lib/gtk2mp3/trash_button.rb
51
51
  homepage: https://github.com/carlosjhr64/gtk2mp3
52
52
  licenses:
53
53
  - MIT
54
54
  metadata: {}
55
- post_install_message:
55
+ post_install_message:
56
56
  rdoc_options: []
57
57
  require_paths:
58
58
  - lib
@@ -67,10 +67,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  requirements:
70
- - 'ruby: ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux]'
71
- - 'mpd: Music Player Daemon 0.22.11 (0.22.11)'
72
- rubygems_version: 3.2.22
73
- signing_key:
70
+ - 'ruby: ruby 3.2.0 (2022-12-25 revision a528908271) [aarch64-linux]'
71
+ - 'mpd: Music Player Daemon 0.22.6 (0.22.6)'
72
+ rubygems_version: 3.4.3
73
+ signing_key:
74
74
  specification_version: 4
75
75
  summary: A "Next!" button gui for [MPD/MPC](https://www.musicpd.org/).
76
76
  test_files: []
data/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2018 carlosjhr64
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.