Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 24 Oct 2014, 12:17
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Problem with fixdesktopicons in Bash
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
trio


Joined: 21 Dec 2008
Posts: 1805
Location: अनुमोदना

PostPosted: 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
before.jpg
 Description   
 Filesize   18.57 KB
 Viewed   621 Time(s)

before.jpg

after.jpg
 Description   
 Filesize   17.46 KB
 Viewed   628 Time(s)

after.jpg

Icons_line_moved.jpg
 Description   
 Filesize   31.21 KB
 Viewed   625 Time(s)

Icons_line_moved.jpg

fixdesktopicons.tar.gz
Description 
gz

 Download 
Filename  fixdesktopicons.tar.gz 
Filesize  485 Bytes 
Downloaded  375 Time(s) 

_________________
PET Maker|WbarCC
Back to top
View user's profile Send_private_message 
01micko


Joined: 11 Oct 2008
Posts: 7835
Location: qld

PostPosted: 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

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send_private_message Visit_website 
trapster


Joined: 28 Nov 2005
Posts: 2009
Location: Maine, USA

PostPosted: 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 Slacko AND lupu52 w/ fluxbox
Back to top
View user's profile Send_private_message Visit_website 
MinHundHettePerro


Joined: 05 Feb 2009
Posts: 853
Location: SE

PostPosted: Sun 01 Nov 2009, 09:57    Post_subject:  

Hello! Smile

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 Smile/
MHHP

_________________
Celeron 2.8 GHz, 1 GB, i82845, many ptns, modes 12, 13
Dual Xeon 3.2 GHz, 1 GB, nvidia quadro nvs 285

Slackos & 214X, ... and Q6xx
Nämen, vaf.... ln -s /dev/null MHHP
Back to top
View user's profile Send_private_message 
zigbert


Joined: 29 Mar 2006
Posts: 5753
Location: Valåmoen, Norway

PostPosted: 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
View user's profile Send_private_message Visit_website 
trio


Joined: 21 Dec 2008
Posts: 1805
Location: अनुमोदना

PostPosted: Sun 01 Nov 2009, 11:03    Post_subject:  

Thanks!!!
_________________
PET Maker|WbarCC
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0556s ][ Queries: 12 (0.0066s) ][ GZIP on ]