
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
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.
16 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.
16 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
16 years ago
sed: unkown option -- i
I use SuSE 8.2 with
GNU sed version 3.02.80
Report
sgtpepper
16 years ago
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
16 years ago
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
16 years ago
Report
SmackedFly
16 years ago
Should really be integrated into KDE, any plans?
Report
sgtpepper
16 years ago
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