Skip to content

Commit

Permalink
Use I3SOCK environment variable for path in AnyEvent::I3
Browse files Browse the repository at this point in the history
Commit 3ae5f31 introduced the I3SOCK environment variable. This
prevents us from having to call `i3 --get-socketpath'. In case the
variable doesn't exist, fall back to the old ways.

Signed-off-by: Wesley Schwengle <wesleys@opperschaap.net>
  • Loading branch information
waterkip committed Apr 8, 2024
1 parent 47cab33 commit 116dd4e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions AnyEvent-I3/lib/AnyEvent/I3.pm
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ instance on the current DISPLAY which is almost always what you want.
sub new {
my ($class, $path) = @_;

# We have I3SOCK now
$path ||= $ENV{I3SOCK};
$path = _call_i3('--get-socketpath') unless $path;

# This is the old default path (v3.*). This fallback line can be removed in
Expand Down

0 comments on commit 116dd4e

Please sign in to comment.