Skip to content

Commit

Permalink
Add support for Sway
Browse files Browse the repository at this point in the history
  • Loading branch information
husam212 committed Dec 5, 2019
1 parent 0c3a2a7 commit e647b88
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.2.1"
end

0 comments on commit e647b88

Please sign in to comment.