DeskDevRename

Various KDE 1.-4. Improvements

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

0
Score 50.0%
Description:

DeskDevRename.sh: Renames KDE desktop files according to a medium's Volume id
and changes their icons in case one is found on the medium

It does so by scanning /etc/mtab for a defined list of devices (links to which reside on the desktop) and, upon mount, gets the volume id from the device and simply renames the desktop files to it. On termination of the script or umounting the device, all changes made are reversed.

Install:
========
Simply copy it to some place that's in your $PATH and run it. It scans your
Desktop directory for Device files and creates ~/.kde/share/apps/DeskDevRename/devs.rc , in which you should delete all devices you don't wish to monitor (i.E., hard drives)

I recommend starting the script from your ~/.kde/Autostart directory
or via ~/.xinitrc
Moreover, it is very beneficial to get 'CD Detect&Execute'
(http://ericlathrop.com/cdde/), until it is possible to use it together
with supermount and such.

Further instructions and known issues can be found in the Bash script.
Last changelog:

15 years ago

0.3:
* This version has the ability to scan Autorun.inf, in order to substitute the icon of the Desktop device with an .ico file on the mounted CD
* $confDir/devs.rc may now be edited during run-time in order to add or remove devices to monitor on the fly, but it does not yet work very well.

janschaefer

15 years ago

When mounting a CD-ROM, the script gives an error saying:

sed: unkown option -- i

I use SuSE 8.2 with
GNU sed version 3.02.80

Report

C

sgtpepper

15 years ago

Well, the -i switch is used to edit files with sed "in-place", that is: without having to make the changes to a temporary file and then overwriting the original with it... pretty convenient, I thought.
Since I am using GNU sed version 4.0.9 from Debian SID, I guess this feature is simply not yet supported in earlier versions. :-/

However, the more I look at it, the more it bugs me how bad the script is designed. At the current state it relies on 8 external utilities, in many cases for doing very small things that Bash is probably able to do on its own.
I just started with Bash scripting, or more or less programming in general, so there is still much to learn.
Also, I think it is a very poor idea to actually rename the Desktop files, because it leads to many problems (i.e., Icon positioning). I just found out that the script could simply manipulate or append an entry "Name=Volume Name" to the Desktop file for the same effect...
So I am looking forward to do a major re-write asap (at the weekend).

bye

Report

janschaefer

15 years ago

You can use Perl instead of sed,
because perl can emulate sed behaviour:

perl -pi -e 's/Hello/World/g' *.desktop

replaces all occurrences of Hello with World in place.

Report

janschaefer

15 years ago

Did you thought of implementing this as a KDE-Demon like KNemo? I think this would be the best.

Report

SmackedFly

15 years ago

Works fine, nice work.

Should really be integrated into KDE, any plans?

Report

C

sgtpepper

15 years ago

...erm... well, no. :-D
Though I'm glad that you like it and that it works for you, it is still nothing more than a simple Shell script and should thus be considered a quick'n'dirty workaround, until the developers integrate this feature in a more "sophisticated" way.
However, I'll try to improve it further ( i.e., to support icons embedded in .exe and .dll using the 'icoutils' ), but mainly in order to learn Bash scripting, and hopefully Perl, while at the same time creating something useful.

Thanks for your comment!! :-)

Report

15 years ago

0.3:
* This version has the ability to scan Autorun.inf, in order to substitute the icon of the Desktop device with an .ico file on the mounted CD
* $confDir/devs.rc may now be edited during run-time in order to add or remove devices to monitor on the fly, but it does not yet work very well.

12345678910
product-maker Base: 4 x 5.0 Ratings
File (click to download) Version Description PackagetypeArchitecture Downloads Date Filesize DL OCS-Install MD5SUM
*Needs ocs-url or ocs-store to install things
Pling
0 Affiliates
Details
license
version
0.3
updated Jun 07 2004
added Jun 07 2004
downloads 24h
0
pageviews 24h 2