About Me

header ads

Change wallpaper automatically and configure the startup menu in LXDE

The two days with LXDE finished, but I had been a thorn stuck in the affairs that are advertised in the headline of this post and let's move to finalize now, to lay aside this lightweight desktop, at least for now.


The first point many people may seem silly, to me, that in 2011 you have to go full manually changing wallpaper seems very dodgy. There are programs to deal with these things, of course, but in an attempt to preserve the most stark minimalism and expenditure of resources LXDE ,It is best to leave for a script.

The best I found was the posted by a user in Linux Mint Forums distribution, as you can see below:

#!/bin/bash

DIR=/home/user/wallpapers
FLOOR=1
RANGE=`ls -1 "$DIR"/*.jpg | wc | awk '// {print $1}'`

number=0

while [ 1 -eq 1 ]; do

   number=$RANDOM
   while [ "$number" -le $FLOOR ]; do
        number=$RANDOM
   done
   let "number %= $RANGE"  # Scales $number down within $RANGE.
   COUNTER=1
   for X in "$DIR"/*.jpg
   do
      if [ $number -eq $COUNTER ]; then
         pcmanfm --set-wallpaper "$X"
      fi
   COUNTER=$(($COUNTER+1))
   done
   COUNTER=1
   sleep 2m
done
I copied as such in a plain text editor Leafpad, You change the path of images ("DIR=") to the appropriate (it is also possible to vary the range of changes by changing the number in the "sleep") and you keep the name you wish to extension ".sh" (Without the quotes, for example: rotator.sh). Now we have to do executable file (Right click and Permits) and already with a double click should do its function.

As we are interested not disturb or touch running the file manually to change in wallpaper, you can add to startup programs in "~/.config/autostart/" though, as the author warns script, should kill him when you close or restart the session, Not to continue replicating in memory on successive reboots. There two ways to do.

Finally, in contrast to the previous "frivolity" in work environments where the user is not the computer administrator but merely to use the system to perform specific functions for which it has been set, there Menu items leftover LXDE applications in many cases.

It is at least hide the menu options such as installing software or access to administrative tools, and to do this you must edit the file (so that Linux everything is a file ...).

Now, goodbye LXDE, we will follow the trail

Post a Comment

0 Comments