Author Topic: LMCE in Dolphin's Places  (Read 3189 times)

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1084
    • View Profile
LMCE in Dolphin's Places
« on: February 13, 2011, 08:18:13 am »
Thom thought it would be convenient for KDE users to have a folder in Dolphins "Places" generated by the system, so I thought it would be an easy opportunity to write my first bash script. Of course it should have been a perl script, but I spent too much time learning the one to move. So this is my solution. I would appreciate review, laughter, whatever the case may be.
http://svn.linuxmce.org/trac.cgi/attachment/ticket/986/t4.sh

It works. I have tried to make it not work, but it always works. Dolphin is very lenient on order.
It will download an icon set. I will make something nice if people think that is a good idea. I don't get butt hurt at criticism. Thanks for your time.

This is a fresh 0810 bookmarks.xml file.

Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xbel>
<xbel xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks" xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info" xmlns:kdepriv="http://www.kde.org/kdepriv" dbusName="kfilePlaces" >
 <bookmark href="file:///home/mcc" >
  <title>Home</title>
  <info>
   <metadata owner="http://freedesktop.org" >
    <bookmark:icon name="user-home" />
   </metadata>
   <metadata owner="http://www.kde.org" >
    <ID>1297542459/0</ID>
    <isSystemItem>true</isSystemItem>
   </metadata>
  </info>
 </bookmark>
 <bookmark href="remote:/" >
  <title>Network</title>
  <info>
   <metadata owner="http://freedesktop.org" >
    <bookmark:icon name="network-workgroup" />
   </metadata>
   <metadata owner="http://www.kde.org" >
    <ID>1297542459/1</ID>
    <isSystemItem>true</isSystemItem>
   </metadata>
  </info>
 </bookmark>
 <bookmark href="file:///" >
  <title>Root</title>
  <info>
   <metadata owner="http://freedesktop.org" >
    <bookmark:icon name="folder-red" />
   </metadata>
   <metadata owner="http://www.kde.org" >
    <ID>1297542459/2</ID>
    <isSystemItem>true</isSystemItem>
   </metadata>
  </info>
 </bookmark>
 <bookmark href="trash:/" >
  <title>Trash</title>
  <info>
   <metadata owner="http://freedesktop.org" >
    <bookmark:icon name="user-trash" />
   </metadata>
   <metadata owner="http://www.kde.org" >
    <ID>1297542459/3</ID>
    <isSystemItem>true</isSystemItem>
   </metadata>
  </info>
 </bookmark>
</xbel>

This is the result of the code. The bottom entry is new, and will generate without any conflicts or odd behavior no matter how many things or separators are there... of course ideally it would be run before Dolphin ever mounted anything.
Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xbel>
<xbel xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks" xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info" xmlns:kdepriv="http://www.kde.org/kdepriv" dbusName="kfilePlaces">
 <bookmark href="file:///home/rec">
  <title>Home</title>
  <info>
   <metadata owner="http://freedesktop.org">
    <bookmark:icon name="user-home"/>
   </metadata>
   <metadata owner="http://www.kde.org">
    <ID>1289787488/0</ID>
    <isSystemItem>true</isSystemItem>
   </metadata>
  </info>
 </bookmark>
 <bookmark href="remote:/">
  <title>Network</title>
  <info>
   <metadata owner="http://freedesktop.org">
    <bookmark:icon name="network-workgroup"/>
   </metadata>
   <metadata owner="http://www.kde.org">
    <ID>1289787488/1</ID>
    <isSystemItem>true</isSystemItem>
   </metadata>
  </info>
 </bookmark>
 <bookmark href="file:///">
  <title>Root</title>
  <info>
   <metadata owner="http://freedesktop.org">
    <bookmark:icon name="folder-red"/>
   </metadata>
   <metadata owner="http://www.kde.org">
    <ID>1289787488/2</ID>
    <isSystemItem>true</isSystemItem>
   </metadata>
  </info>
 </bookmark>
 <bookmark href="trash:/">
  <title>Trash</title>
  <info>
   <metadata owner="http://freedesktop.org">
    <bookmark:icon name="user-trash"/>
   </metadata>
   <metadata owner="http://www.kde.org">
    <ID>1289787488/3</ID>
    <isSystemItem>true</isSystemItem>
   </metadata>
  </info>
 </bookmark>
<bookmark href="file:///home/public/data" >
 <title>LMCE_Data</title>
 <info>
  <metadata owner="http://freedesktop.org" >
   <bookmark:icon name="folder-lmce" />
  </metadata>
  <metadata owner="http://www.kde.org" >
   <ID>1289787488/4</ID>
   <isSystemItem>true</isSystemItem>
  </metadata>
 </info>
</bookmark>
</xbel>

I have figured a lot out the last few days and would like a more difficult task. Thanks.
« Last Edit: February 13, 2011, 09:16:36 am by l3mce »
I never quit... I just ping out.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: LMCE in Dolphin's Places
« Reply #1 on: February 14, 2011, 07:44:00 am »
Thanks so much. We'll fold this in after we test it a bit.

-Thom

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1084
    • View Profile
Re: LMCE in Dolphin's Places
« Reply #2 on: February 14, 2011, 03:08:10 pm »
Was a great place to start for me.

It would be very easy to add quick links to the video/audio folders if you wanted also. Less clicking is less clicking imo. I can also make a dev one which goes to logs etc.

The images should probably live somewhere other than photobucket also... of course if the image does not exist, dolphin is nice enough to make it a blue folder.
« Last Edit: February 14, 2011, 05:10:13 pm by l3mce »
I never quit... I just ping out.