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
# 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 |