summaryrefslogtreecommitdiff
path: root/scripts/desktop/i3status-wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/desktop/i3status-wrapper')
-rwxr-xr-xscripts/desktop/i3status-wrapper9
1 files changed, 4 insertions, 5 deletions
diff --git a/scripts/desktop/i3status-wrapper b/scripts/desktop/i3status-wrapper
index cbe02685..e9df86c8 100755
--- a/scripts/desktop/i3status-wrapper
+++ b/scripts/desktop/i3status-wrapper
@@ -6,8 +6,10 @@
use 5.032;
use strict;
use warnings;
-use JSON;
+use lib "$ENV{HOME}/src/dotfiles/perl5";
+use JSON;
+use Local::Desktop;
use IO::Pipe;
use Sys::Hostname;
@@ -33,9 +35,6 @@ my $caffeinated;
my $username = $ENV{LOGNAME} || $ENV{USER} || getpwuid($<);
my $hostname = hostname;
-`which i3-msg`;
-my $exec = $? == 0 ? "i3-msg" : "swaymsg";
-
expensive();
$SIG{USR1} = sub { kill USR1 => $i3status; expensive() };
@@ -55,7 +54,7 @@ while (my ($statusline) = (<$pipe> =~ /^,?(.*)/)) {
sub expensive {
my %marks;
- walk_tree(\%marks, decode_json `$exec -t get_tree`);
+ walk_tree(\%marks, decode_json `$wmipc -t get_tree`);
$caffeinated = exists $marks{caffeinated} ? $marks{caffeinated} : undef;
}