I just thought this would be helpful to most newbies migrating from windows to Gnu/Linux: familiar with Right-click >> Arrange-icons-automatically, while under my KDE & XFCE this feature is something I wanted.
This code is not mine: I only copied this from where I found, from the ubuntuforums authored by a member logged as user PGScooter, you may read him/her directly
from here.
Procedure:
Copy the following code:
Code:
#make sure you change 'user' on line 4 to the username of the desktop you want to organize
use strict;
use warnings;
my $conffile='/home/user/.config/xfce4/desktop/icons.screen0.rc';
open(CONF,"$conffile") or die "can't find the config file";
my $all;
while (<CONF>) {
$all=$all.$_;
}
my @oldnames=($all=~/\[(.*)\]/g);
my @allnames=sort { lc($a) cmp lc($b) } @oldnames;
print "testing sort:";
print join("\n",@allnames);
my @rows=($all=~/row=(\d*)/g);
print join("\n",@allnames);
print "ok now I will print the amount of rolls\n\n\n";
@rows=sort(@rows);
my $maxrow=$rows[-1];
print "the max rows is $maxrow";
my $numicons=scalar(@allnames);
print "number of icons is $numicons";
my @cols=($all=~/col=(\d*)/g);
@cols=sort(@cols);
my $maxcol=$cols[-1];
print "the max cols is $maxcol";
my $i=0;
open(OUTPUT,'>icons.screen0.rc');
for (my $j=0;$j<=$maxcol;$j++) {
if ($i<=19) {
for (my $k=0;$k<=$maxrow;$k++) {
print OUTPUT "\[$allnames[$i]\]\nrow=$k\ncol=$j\n\n";
$i++;
}
}
}
close(OUTPUT);
Be sure to change the /home/YOURNAME-here/.... to your user name in the ~/ directory.
Paste the code into an editor and save it into your home folder as /home/user/.config/xfce4/desktop/icons.screen0.rc
{if you run Kde you may replace that xfce4 to kde whatever is found in your current directory.
Log out. Log in as that user again. The icons are arranged this time. It worked for me automatically. I am running Xfce4 over a Slackware 12.2.
Hope this helps. Good luck.