Created
July 17, 2015 09:39
-
-
Save Airblader/d1375fde12d1135daca9 to your computer and use it in GitHub Desktop.
Wallpaper per workspace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# example | |
/path/to/wallpaper.pl | while read num; do echo "feh --bg-scale /path/to/wallpaper$num.png"; done | |
# produces | |
# feh --bg-scale /path/to/wallpaper3.png | |
# feh --bg-scale /path/to/wallpaper1.png | |
# ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
BEGIN { $| = 1 } | |
use strict; | |
use warnings; | |
use AnyEvent::I3; | |
use v5.10; | |
my $i3 = i3(); | |
die "failed to connect to i3" unless $i3->connect->recv; | |
die "failed to subscribe to event" unless $i3->subscribe({ | |
workspace => sub { | |
my ($msg) = @_; | |
return unless $msg->{change} eq 'focus'; | |
print $msg->{current}->{num} . "\n"; | |
} | |
})->recv->{success}; | |
AE::cv->recv; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment