Suse/NovellThis Forum is for the discussion of Suse Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Distribution: openSUSE 10.3, Yoper Linux 3.0 , Arch Linux 2007.08
Posts: 253
Original Poster
Rep:
One more time, this time with the body of the post included! Doh.....
Does anyone know if there is a command that could be included in a script that would cause KDE to refresh the desktop? I know that I can manually refresh the desktop by right clicking on it and selecting "Refresh Desktop", but I am wondering if there is a way to simply include a command in a larger script that will do this automatically. Thanks.
Well when I copy files with Konsole to the Desktop, its there practically instantly. Now is yours different?
Maybe you could shead some light on why you need this auto refresh and describe the problem you're having a bit more.
Distribution: openSUSE 10.3, Yoper Linux 3.0 , Arch Linux 2007.08
Posts: 253
Original Poster
Rep:
Actually, I have managed to solve the problem at this point, but I would be happy to elaborate a bit and then describe the solution for other's benefit. The basic problem I am having is that KDE seems quite erratic at updating disk icons on the desktop to show when they are mounted vs. when they are not. In my case, this is worse because I have an encrypted volume file that I use to keep financial and other personal records quite protected. I think because this is not a "traditional" hard disk volume (even though it has an fstab entry, and does show up in mtab when mounted) KDE somehow fails to pop an icon onto the desktop when it is mounted. So, using the Desktop's right click context menu, I did a Create New -> Link to Device -> Hard Disk Device and specified the relevant fstab entry. With this done, I thought that KDE would notice mount state changes in it via mtab (I am guessing here) and update the icon to its mounted icon whenever I mounted the volume, like it does for the two other normal hard disk partitions I have icons for on my desktop (my Windows C and D drives).
No such luck. However, I noticed that if I forced a desktop refresh via the right click context menu, it immediately updated the encrypted volume's icon to the mounted/unmounted one as appropriate to the state the volume is in. So, I started looking for ways to force a desktop update as part of the script I use to mount/unmount the encrypted volume. That led to the thread we are looking at right now.
Since I have both SuSE and VectorLinux, I posted in both newsgroups, and a kind soul in the VectorLinux newsgroup provided a working answer. Here it is. KDE apparently monitors the ~/Desktop directory using FAM (File Access Monitor) and will receive a notification from the kernel if anything changes on the desktop. When it gets such a notification, it updates the desktop. Ah hah... the solution presents itself.
So, to force an update, I simply added the following to my encrypted volume mounting script.
touch ~/Desktop/u.txt; rm ~/Desktop/u.txt
This briefly places the empty file u.txt (any file name will do here) on the desktop, and then removes it. This causes FAM to give KDE a notification, and it updates the desktop. Not very obvious, but perfectly effective! By the way, this is for SuSE 9.3, with KDE 3.4. I can't guarantee that this will work on any other version of SuSE.
It still would be nice to be able to run some command that simply updated the desktop directly though!
I have noticed that there are times when icon properties are not updated until you close the application that operating on the file the icon represents. At least that appears to be the case.
I have a similar issue with my top icons getting overlapped by a top panel I've added to my desktop, and a refresh desktop corrects the problem. I want to add a script to my ~/.kde3/Autostart folder and also think that a direct command rather than a file create and delete would be better...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.