Skip to content

Commit

Permalink
release v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
veny committed Mar 4, 2015
1 parent dcfd7b0 commit fb6e441
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

Dual monitor manager for Linux with GTK based user interface represented by system tray icon's context menu.

[![Gem Version](https://badge.fury.io/rb/dumon.svg)](http://badge.fury.io/rb/dumon)

## SCREENSHOTS

[![](https://raw.github.com/veny/dumon/master/screenshots/tray_icon.png)](https://raw.github.com/veny/dumon/master/screenshots/tray_icon.png)
Expand Down
2 changes: 1 addition & 1 deletion dumon.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ Gem::Specification.new do |s|
s.summary = %q{Dual monitor manager for Linux.}
s.license = 'Apache License, v2.0'

s.add_runtime_dependency 'gtk2', '~> 1.2', '>= 1.2.0'
s.add_runtime_dependency 'gtk2', '~> 2.2', '>= 2.2.0'
end
2 changes: 1 addition & 1 deletion lib/dumon/omanager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def read #:nodoc:
output = nil

xrandr_out = `#{self.stool} -q`
xrandr_out.strip!
xrandr_out.each_line do |line|
if line =~ /^[\w-]+ connected /
output = line[/^[\w-]+/]
Expand All @@ -209,7 +210,6 @@ def read #:nodoc:
Dumon::logger.debug "Outputs found: #{rslt}"

# verify structure of readed infos
assert(!rslt.empty?, 'no outputs found')
rslt.each do |output,out_meta|
verify_options(out_meta, {:resolutions=>:mandatory, :default=>:mandatory, :current=>:optional})
assert(out_meta[:resolutions].size >= 1, "no resolution found, output=#{output}")
Expand Down
14 changes: 13 additions & 1 deletion lib/dumon/ui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,19 @@ def initialize #:nodoc:
###
# Reads info about currently usable outputs and construct corresponding structure of context menu.
def create_menu
outputs = self.omanager.read
begin
outputs = self.omanager.read
if outputs.empty?
md = Gtk::MessageDialog.new(nil,
Gtk::Dialog::DESTROY_WITH_PARENT, Gtk::MessageDialog::WARNING, Gtk::MessageDialog::BUTTONS_YES_NO,
"Failed to load display information.\nDo you want to reload?\n(Hit 'no' to terminate application)")
md.set_window_position :mouse
md.run do |r|
raise 'failed to load display information' if r == Gtk::Dialog::RESPONSE_NO
end
md.destroy
end
end while outputs.empty?

rslt = Gtk::Menu.new

Expand Down
1 change: 1 addition & 0 deletions lib/dumon/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module Dumon

# Version history.
VERSION_HISTORY = [
['0.3.0', '2015-03-04', 'Upgrade to Gtk v2.2+, BF #19'],
['0.2.9', '2014-06-11', 'Added configurable shell command running after each switch of output'],
['0.2.8', '2013-07-10', 'BF #15: Problem with nvidia graphic driver'],
['0.2.7', '2013-05-08', 'BF #14: Failure if applied profile with unconnected output; Enh #7'],
Expand Down

0 comments on commit fb6e441

Please sign in to comment.