dumon 0.2.9 → 0.3.0

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
  SHA1:
3
- metadata.gz: 1e1daac0755fa53c78fb91863a65d47d1c7be4cd
4
- data.tar.gz: 499ac893d612c967dca12a9424222000d143af7e
3
+ metadata.gz: 698d5426fddbe57d8e19dc790593e35312cf33b4
4
+ data.tar.gz: f6222646686459f2397b2ec5871a7d1e10f05f5a
5
5
  SHA512:
6
- metadata.gz: 6ad46b641ac58fd2e61e84bd3bd87cc4fe46fedf8d39a97fddc8d128dd2b98e8088be80a4994ed57e10a6afac0c5a7357149523b2350b2fb68f9ab04a1c179ad
7
- data.tar.gz: 9315d27aea0a9ef3425da388326e1bb1493475c0bfa26900526e523015c7395c060fc5dfebda4c12e2770295af59d0e7ce3894efe212fb0dff9c02a9962738b8
6
+ metadata.gz: 8c9dfcfd7bcccfd3a1ede8625d4179f7145f51314ca544e3c9691b86bcb36b446b4cff224cbea5a8797531c71abcd4236cb5f803df7519717601d2e473105f58
7
+ data.tar.gz: ec79e705f82be6d87513833a87492297898b14033dc113ef35e666cc674d8d21385a26721263d575ab02057efe87a07c16f117efb0abd1094f7edfa0fe96bb0c
data/README.md CHANGED
@@ -7,6 +7,8 @@
7
7
 
8
8
  Dual monitor manager for Linux with GTK based user interface represented by system tray icon's context menu.
9
9
 
10
+ [![Gem Version](https://badge.fury.io/rb/dumon.svg)](http://badge.fury.io/rb/dumon)
11
+
10
12
  ## SCREENSHOTS
11
13
 
12
14
  [![](https://raw.github.com/veny/dumon/master/screenshots/tray_icon.png)](https://raw.github.com/veny/dumon/master/screenshots/tray_icon.png)
@@ -69,7 +71,7 @@ Dual monitor manager for Linux with GTK based user interface represented by syst
69
71
 
70
72
  > Dumon.logger.level = Logger::DEBUG
71
73
 
72
- #### Post Switch Command
74
+ #### Post Switch Command
73
75
 
74
76
  * you can define a shell command that will be executed after each switch of output
75
77
  * just insert _post_switch_ key into _$HOME/.config/dumon.conf_ like this
@@ -25,5 +25,5 @@ Gem::Specification.new do |s|
25
25
  s.summary = %q{Dual monitor manager for Linux.}
26
26
  s.license = 'Apache License, v2.0'
27
27
 
28
- s.add_runtime_dependency 'gtk2', '~> 1.2', '>= 1.2.0'
28
+ s.add_runtime_dependency 'gtk2', '~> 2.2', '>= 2.2.0'
29
29
  end
@@ -189,6 +189,7 @@ module Dumon
189
189
  output = nil
190
190
 
191
191
  xrandr_out = `#{self.stool} -q`
192
+ xrandr_out.strip!
192
193
  xrandr_out.each_line do |line|
193
194
  if line =~ /^[\w-]+ connected /
194
195
  output = line[/^[\w-]+/]
@@ -209,7 +210,6 @@ module Dumon
209
210
  Dumon::logger.debug "Outputs found: #{rslt}"
210
211
 
211
212
  # verify structure of readed infos
212
- assert(!rslt.empty?, 'no outputs found')
213
213
  rslt.each do |output,out_meta|
214
214
  verify_options(out_meta, {:resolutions=>:mandatory, :default=>:mandatory, :current=>:optional})
215
215
  assert(out_meta[:resolutions].size >= 1, "no resolution found, output=#{output}")
@@ -117,7 +117,19 @@ module Dumon
117
117
  ###
118
118
  # Reads info about currently usable outputs and construct corresponding structure of context menu.
119
119
  def create_menu
120
- outputs = self.omanager.read
120
+ begin
121
+ outputs = self.omanager.read
122
+ if outputs.empty?
123
+ md = Gtk::MessageDialog.new(nil,
124
+ Gtk::Dialog::DESTROY_WITH_PARENT, Gtk::MessageDialog::WARNING, Gtk::MessageDialog::BUTTONS_YES_NO,
125
+ "Failed to load display information.\nDo you want to reload?\n(Hit 'no' to terminate application)")
126
+ md.set_window_position :mouse
127
+ md.run do |r|
128
+ raise 'failed to load display information' if r == Gtk::Dialog::RESPONSE_NO
129
+ end
130
+ md.destroy
131
+ end
132
+ end while outputs.empty?
121
133
 
122
134
  rslt = Gtk::Menu.new
123
135
 
@@ -2,6 +2,7 @@ module Dumon
2
2
 
3
3
  # Version history.
4
4
  VERSION_HISTORY = [
5
+ ['0.3.0', '2015-03-04', 'Upgrade to Gtk v2.2+, BF #19'],
5
6
  ['0.2.9', '2014-06-11', 'Added configurable shell command running after each switch of output'],
6
7
  ['0.2.8', '2013-07-10', 'BF #15: Problem with nvidia graphic driver'],
7
8
  ['0.2.7', '2013-05-08', 'BF #14: Failure if applied profile with unconnected output; Enh #7'],
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dumon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vaclav Sykora
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-11 00:00:00.000000000 Z
11
+ date: 2015-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gtk2
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.2'
19
+ version: '2.2'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 1.2.0
22
+ version: 2.2.0
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: '1.2'
29
+ version: '2.2'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 1.2.0
32
+ version: 2.2.0
33
33
  description: Dual monitor manager for Linux with GTK based user interface represented
34
34
  by system tray icon's context menu.
35
35
  email: vaclav.sykora@gmail.com