ROX desktop utility to add & remove icons.### Beta 4

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#16 Post by sunburnt »

Thanks Mark; I`ll try it on a different Puppy version, going out awhile now.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#17 Post by disciple »

amigo, how else does your Trash roxapp compare with the one in Puppy?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#18 Post by sunburnt »

My apologies Mark, my bad code writing and I left ".png" off of the icon.
Your code works beautifully now that I`ve overcome my stupidity.
Many thanks for once again for your help. I doubt I`d have found this.

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#19 Post by amigo »

I'm not sure how my trash app compares with any final version included in puppy. For a long time I followed a thread here where a trash app was being develeoped. But about half way trhough, it had already truned into a back-up system with versioning.
Mine allows you to restore items to their original location. I was following the desktop.org standard for a trash app, except I never implemented the separate-trashdir-for-separate-drive concept.
My app is mcuh cleaner in operation as it doesn't create a new AppDir for each item you put in the trash. It simply keeps a single-file database of what is in the trash -this is also different from the desktop.org standard which calls for an individual file for each item.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#20 Post by disciple »

Ah, right. Thanks for that explanation.
The thread you're referring to will be the one I started just to discuss possible improvements to Puppy's Trash. So far no one has cared enough about any of the suggestions to implement them.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#21 Post by sunburnt »

I renamed the app. to: roxDTicon, it just makes more sense than: pupin.
New beta 3 version works wonderfully, many thanks to MU.
It seems to not place the icon exactly where you tell it to. Odd...

I`m working on Basic Script style commands to replace the command line.

Read the new version release info. Feed back and suggestions...

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#22 Post by amigo »

Ah, yes, that was indeed the thread. I dare say you'd find an interesting scrap or two of code in my app which may be useful. For starters, it uses a separate Trash script which was written long ago by someone else, which is suitable for command-line use.
I had several more ideas to implement and was trying to aim towards freedesktop.org compliance, but like you, I found I didn't agree with all the standards. Still, near-compatibility would probably be better than none. I liked the idea of creating a separate trash dir for each separate drive (use stat to find out what drive a file is on), although i wanted to be able to use or not use that as an option. The advantage of doing so is that you can 'mv' items into the trash without changing the disk usage of that drive and without the time delays of moving something onto a new filesystem. But, many users would probably prefer to have a single trash container.
The freedsektop idea of sharing a single trash dir with subdirs for each user adds lots of complexity as well.
I have several of the old ROX trash/rubbish AppDirs -all with different concepts -using libtrash, etc -but none that would restote items to their original location, so I wrote my own -shredding would be fairly easy to add.
I think that the multi-session DVD 'memory' functions discussed in your thread were beyond the scope of a trash app and would be better handled in some other way.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#23 Post by sunburnt »

amigo; A trash bin for each partition is good, files are moved quickly on a partition.

Perhaps have desktop and file browser partition icons that have a trash indicator.
Like a dot that goes from green to yellow to orange to red indicating empty to full.
This keeps from having 2 icons for each partition (redundant).
To right click the partition`s icon pops up a menu with a trash manager item on it.

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#24 Post by ecomoney »

Hi Sunburnt

Ive downloaded it and given it a spin. I must confess I didint actually use it to create an icon. Some suggestions to help the scripts useability to newbies (like me)

In the help files, would you set out the instructions using standard notation. This is similar to this.. Perhaps when the command is invoked, if no parameters are specified then this utility would display the help also?

I intend using this script to add to .pets and .sfs's to create an icon for the application. I use "dir2pet" for this. How could this be added to such a package creator?
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#25 Post by sunburnt »

Yes, often I like to provide examples, it`s more useful.
But most folks who would use it know how a command line works...

roxDTicon -a (app. exec.) (Xpos) (Ypos) (icon file, or -) (icon text, or -) (exec. args., or empty)

roxDTicon -r (app. exec.) (icon text, or empty)

roxDTicon -i (app. exec.) (icon file)

$1 - $4 are required right now to add an icon to the desktop.
If $5 and $6 are to be blank, then a "-" is needed to fill that position.
I`ll add some form of auto. icon placement in the future.
$1 - $2 is required for removing an icon, $3 the text is for multiple icons.
$1 - $3 is required for setting an icon ( changing it ).

I don`t know if this helps much, I`ll rewrite the help when I can...

Ideally this app. would be part of Puppy, so all other apps. can use it.
As I said, Puppy needs a number of utilities written for it (like this one).
A few others are needed badly too (a good boot and mount manager).

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#26 Post by amigo »

"goes from green to yellow to orange to red" -that's what my RecycleBin does, color is according to configurable sizes.

I agree that having individual trash bins for each partition is good in many ways. but, it makes things more complicated and mprobably many users would prefer to have a central trash location. My app was only meant to test a couple of concepts. The GUI and configuration components would need further work.
One unusual thing about it -since I didn't want to write a complete GUI for it, I had to work out how to easily restore items. You do this by dragging a trashed item from the Trash dir onto the RecycleBin AppDir.

Also, the app provides for versioning by renaming trashed items to include the date. But it goes like this:
orig_name-date-trashed_orig_suffix
I wanted to always retain the original file suffix so that the items in the trashcan still have the same MIME type -for easy recognition.

Where I used a singe file to hold the data for all trashed items, it would be easy enough to change and use a separate file for each trashed item. The thing I don't like about that is that it adds extra volume to the trash.

Your idea of creating an appdir for each trashed item clashed with the above concepts.

Using separate trashcans for each drive would require some bit of work -making it so that is an option would be even more.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#27 Post by sunburnt »

Has anyone tested this app. yet? Feed back!!! Talk to meee...

I rewrote the help section as ecomoney asked. Any thoughts?

Code: Select all

###  ROX DeskTop Icon:  Add, Remove, Change. ()= Required, []= Optional.

#  To add a new ROX desktop icon:
roxDTicon (-a) (/path/exec) (X pos) (Y pos) [/path/icon] [label] [args]

#  To remove an existing ROX desktop icon:
roxDTicon (-r) (/path/exec) [label]

#  To change an existing ROX desktop icon:
roxDTicon (-i) (/path/exec) (/path/icon)

# 

sidders
Posts: 464
Joined: Wed 23 Jul 2008, 18:47
Location: Bolton, uk

#28 Post by sidders »

Just been having a play.

I want to lock the icon, so i put locked="true" in the args, however the icon isnt locked and in the puppypin it comes up as arg="locked=true".

Here is the result, i also copied the next item in puppypin to compare.
<icon x="920" y="200" label="Etoys" args="locked=true">etoys</icon>
<icon x="90" y="466" label="Tux-Math" locked="true">/usr/share/applications/Tux-Math.desktop</icon>
I may be doing it wrong, however everything else works great.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#29 Post by sunburnt »

Hi sidders; I don`t know what locking a desktop icon does.
But the lines you posted show the lower line without the: args=
Obviously this is not correct, the args= is for the exec. arguments.
I don`t know why they don`t just put the exec. arguments with the exec.
I`ll look at locking an icon, however I`m sure there`s lots of ROX options.
I won`t be bothering to support every option and command that it has.

NOTE: I am working on auto. positioning the icon (X, Y), it`s hard to do.

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#30 Post by amigo »

"auto. positioning the icon" MU had written a utility to do this in puppy basic. I've tried (some) wrapping my head around the code to do it in bash, but it has been low priority. I'll follow your lead... I hope you use simple tools to do it -bash, cut, etc.

I have written a tool which rearranges the pinboard entries -that is it sorts them so that the desktop loads faster by loading icons top-to-bottom or left-to-right, etc, instead of jumping all over the place to create the isons in their historical order of creation. This tool uses some of the needed logic.

I'm inclined to think that it might be best to read the grid size being used, and divide the desktop into an 'array' of grid locations and work with that. Anyway you go about it, it will be pretty involved code. Much easier if you could assume that a certain area was reserved for transient icons -like a panel or dock area. Still, I'm intrigued with the idea of a tool which could auto-arrange the icons -maybe according to multiple criteria. I mean, maybe arrange alphabetically, as well as simply being able to find any available spot, or being able to tell it what area of the desktop to use. Pretty heavy logic, as you allure to -that's what should make it fun! -for you I mean...

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#31 Post by sunburnt »

amigo; Yep... I enjoy the mental challenge that programming gives me.
I have the code written, and it about doubles the size of the apps. code!
Not including the code MU gave me and the Help section that is...
Rearranging the icons is a separate utility really, this one makes them.
Generally I don`t like desktop icons, I prefer a pristine desktop.
That`s why I really flipped the first time I saw the Xfce window manager.
Popup panels are a sooo much better way to handle icons on the desktop.

The criteria for icon placement is as follows:
Get half the screen`s width and the right most icon in it is, the "add to column".
Then the bottom icon in that column is found and a 96 pixel Y offset is added to it.
If not greater than the screen`s Y axis minus 64 (the task bar) then place the icon.
If it is greater, then move to the top of the screen and start a new column of icons.

While this isn`t perfect, it seems to be a good methodology, and nothing`s perfect!
I invite your thoughts, or anyone else`s thoughts about this coding logic.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#32 Post by sunburnt »

sidders; I looked at locking a ROX icon and there`s no SOAP command.
I can make the app. put the "locked=true" into the file: PuppyPin, but I
don`t know if it`ll have any effect, you could try editing the file and see...

============================================
### NOTE: I noticed some bad behavior by ROX, it uses the last icon...
Whatever the last icon was, if one isn`t provided, it just uses the last one.
I had hoped that there would be a default icon that it would use...
In light of this, would it be a good idea to make the icon mandatory?

Another odd thing is it dumps junk lines into the file: PuppyPin
Maybe that`s what the file: /usr/sbin/fixPuppyPin is for... Anyone know?

sidders
Posts: 464
Joined: Wed 23 Jul 2008, 18:47
Location: Bolton, uk

#33 Post by sidders »

Dont worry too much about the lock icon. I have been experimenting with the script in the SFS, and JRB's load_sfs.pet. It works great. The script is dropped into /root/my-aplications/bin. Added IF statement to tghe load_sfs to have a look, if theres one there execute it, which in turn will execute roxDTicon.
I did map out the icons first manually, so they are precoded to load in a line at the right hand sode of the screen

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#34 Post by sunburnt »

sidders; I had thought about having roxDTicon do selectable columns.
So it would be column #N from the left or right side of the screen.
If column is full to the screen bottom, then next column to left or right..

##### Beta 4 version ready for download. Works goood !!!

Does anyone think a GUI for it is a good idea? I`m not sure it`d be useful.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#35 Post by sunburnt »

If no one has any more bugs to report or complaints, I`ll post this as finished.
There`s more that could be done with it, but more functions may not be useful.

Post Reply