Skip to content

Commit

Permalink
Merge pull request #6 from husam212/master
Browse files Browse the repository at this point in the history
Add support for Sway
  • Loading branch information
veelenga authored Dec 6, 2019
2 parents 0c3a2a7 + fa18b28 commit d201701
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions lib/i3ipc/protocol.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,15 @@ def unpack_header(data)
end

def get_socketpath
path = `i3 --get-socketpath`.chomp!
raise 'Unable to get i3 socketpath' unless path
cmd = if system('i3 --version')
'i3'
elsif system('sway --version')
'sway'
else
raise 'Unable to find i3 compatible window manager'
end
path = `#{cmd} --get-socketpath`.chomp!
raise 'Unable to get i3 compatible socketpath' unless path
path
end

Expand Down
2 changes: 1 addition & 1 deletion lib/i3ipc/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module I3ipc
VERSION = "0.2.0"
VERSION = "0.3.0"
end

0 comments on commit d201701

Please sign in to comment.