Last active
November 18, 2016 06:19
-
-
Save 3ed/4b9f254fa565e820e12819e7b6577322 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# set random only once and exit | |
perl -MPath::Tiny -MURI::file -e 'system(qw(gsettings set org.gnome.desktop.background picture-uri),URI::file->new(path(pop @{[keys %{path(".")->visit(sub{my($p,$s)=@_;$p->is_file and $p=~qr/\.(png|jpg|jpeg|svg)$/i and $s->{$p}++},{recurse =>1})}]})->absolute))' | |
# daemon, infinite random wallpapers, changed by every 10 secounds | |
perl -MPath::Tiny -MURI::file -MList::Util=shuffle -e '@a=keys %{path(".")->visit(sub{my($p,$s)=@_;$p->is_file and $p=~qr/\.(png|jpg|jpeg|svg)$/i and $s->{$p}++},{recurse =>1})};while(1){foreach(shuffle 0..$#a){system(qw(gsettings set org.gnome.desktop.background picture-uri),URI::file->new(path($a[$_])->absolute));sleep($ARGV[0])}}' 10 # secounds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment