I started using openbox and I use feh to set my background...
I wanted a way so that each time I logged in it would change my background from a selection I chose
This is what I came up with...
#!/usr/bin/perl
use strict;
use warnings;
# You will need to install feh to make this work...
# You also need to create a folder called rotate in your home
# folder under Pictures...also the names of the pics
# need to be (1.jpg, 2.jpg, 3.jpg, etc.)
# Keep in mind these images will be centered and need to be the size o
+f
# your resolution for best viewing.
# by: pretendeavor
# How many pictures you have in your rotate folder
my $num_of_pics = 10;
# Get a random number from your total of pictures
my $pic = int(rand($num_of_pics)+1);
chomp($pic);
# Change your background using feh to a random pic from rotate folder
print `feh --bg-center ~/Pictures/rotate/$pic.jpg`;
# or --bg-tile, --bg-scale, --bg-seamless
Keep in mind that once you create this script that changes your background, to make it work you still need to call this script in your startup whichever distro you are using...most likely you will call this script using a sh script at startup...or at least that is what I do :D
Enjoy!!!
The early bird gets the worm but the second mouse gets the cheese.
pretendeavor
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.