Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Wallpaper per workspace
# example
/path/to/ | 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
# ...
#!/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";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment