| Author |
Message |
trio

Joined: 21 Dec 2008 Posts: 1786 Location: अनुमोदना
|
Posted: Sun 01 Nov 2009, 07:07 Post subject:
Problem with fixdesktopicons in Bash |
|
Hi,
I am in the middle of making a new bash program which main goal is to re-align desktop icons vertically and horizontally (see pics below, before and after). It is useful when you put new icons on desktop.
I am successful in aligning vertically and my next thing to do is horizontal alignment (which I think I can manage). But a problem persists, Icons on first line is always moved to the fifth line.
Assistance needed, I am confused.
Thanks
| Description |
|
| Filesize |
18.57 KB |
| Viewed |
544 Time(s) |

|
| Description |
|
| Filesize |
17.46 KB |
| Viewed |
550 Time(s) |

|
| Description |
|
| Filesize |
31.21 KB |
| Viewed |
539 Time(s) |

|
| Description |
|

Download |
| Filename |
fixdesktopicons.tar.gz |
| Filesize |
485 Bytes |
| Downloaded |
316 Time(s) |
_________________ PET Maker|WbarCC|My Website
|
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 7019 Location: qld
|
Posted: Sun 01 Nov 2009, 07:25 Post subject:
|
|
That's a good idea! But I haven't a clue at this stage...
I'm sure ttuuxxx would know..
Cheers
_________________ keep the faith .. 
|
|
Back to top
|
|
 |
trapster

Joined: 28 Nov 2005 Posts: 1966 Location: Maine, USA
|
Posted: Sun 01 Nov 2009, 09:00 Post subject:
|
|
Should 390 be 399?
| Code: | if [[ $(echo {201..299}) =~ $y ]] ; then
ynew='"'224'"'
fi
if [[ $(echo {300..390}) =~ $y ]] ; then
ynew='"'320'"'
fi
if [[ $(echo {400..480}) =~ $y ]] ; then
ynew='"'416'"'
fi |
_________________ trapster
Maine, USA
Asus eeepc 1005HA PU1X-BK
Frugal install:Puppeee4.31 + 1.0, Puppy4.10 + Lupu52
Currently using Puppeee-1.0 AND lupu52 w/ fluxbox
|
|
Back to top
|
|
 |
MinHundHettePerro

Joined: 05 Feb 2009 Posts: 831 Location: SE
|
Posted: Sun 01 Nov 2009, 09:57 Post subject:
|
|
Hello!
For example, y=32 will test true in all the [[ ... ]]'s,
a workaround could be to re-phrase the tests, like e.g. | Code: | | if [[ $(echo " "{8..100}" ") =~ " $y " ]] ; then |
hth /
MHHP
_________________ Celeron 2.8 GHz, 1 GiB RAM, i82845 graphics, many partitions, Pupmode 12 (13)
Mostly running Slacko & 214X
Nämen, vaf.... ln -s /dev/null MHHP
|
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 5243 Location: Valåmoen, Norway
|
Posted: Sun 01 Nov 2009, 10:04 Post subject:
|
|
Hello trio
Long time....good to see you!!!
The answer is simply to reorder you ifs
| Code: |
for y in `cat /root/Choices/ROX-Filer/PuppyPin | grep "</icon>" | cut -d "y" -f2 | cut -d '"' -f2 | sort -n`
do
if [[ $(echo {101..200}) =~ $y ]] ; then
ynew='"'128'"'
fi
if [[ $(echo {201..299}) =~ $y ]] ; then
ynew='"'224'"'
fi
if [[ $(echo {300..390}) =~ $y ]] ; then
ynew='"'320'"'
fi
if [[ $(echo {400..480}) =~ $y ]] ; then
ynew='"'416'"'
fi
if [[ $(echo {481..580}) =~ $y ]] ; then
ynew='"'512'"'
fi
if [[ $(echo {581..$END}) =~ $y ]] ; then
ynew='"'608'"'
fi
if [[ $(echo {8..100}) =~ $y ]] ; then
ynew='"'32'"'
fi
if [[ $(echo {$BOTTOM..~}) =~ $y ]] ; then
ynew='"'$BOTTOM'"'
fi |
Sigmund
_________________ Stardust resources
|
|
Back to top
|
|
 |
trio

Joined: 21 Dec 2008 Posts: 1786 Location: अनुमोदना
|
Posted: Sun 01 Nov 2009, 11:03 Post subject:
|
|
Thanks!!!
_________________ PET Maker|WbarCC|My Website
|
|
Back to top
|
|
 |
|