updating desktop icon [Solved]

Discuss all artwork and development - Suggestions needed

Moderator: Moderators

updating desktop icon [Solved]

Postby amoebios » Fri Oct 23, 2009 11:43

Update:
This is how to get an icon that automatically makes a screenshot and uses that as an icon for your desktop folder in KDE (i guess it can also work on Gnome, but i don't know the paths for the icon cache).
You need:
* scrot (command line application to make the screenshots, install it from repository)
* desktop.svg (You will use this for the icon)
* desktop.sh (put this script into Autostart)

Modify desktop.sh (in a text editor) to adjust paths or to specify another application, for example. Make sure it is executable.
You can also alter the SVG icon. You could combine it with an icon of a laptop or monitor, for example.

----------------------------------
Hey all,

i'm trying to figure out a way to make an updating desktop icon.
So far i have a "desktop.SVG" that uses a "desktop.png", but i don't know how to automatically make a screenshot and save it as "desktop.png".
Image
(You can also see the limitations of SVG: i wanted an alphablended reflection and had to use a (grey) gradient on top of the reflection.)

Edit:
Please, don't tell me it's already available in KDE4.3.
Last edited by amoebios on Thu Nov 05, 2009 23:58, edited 7 times in total.
User avatar
amoebios
Growing Hen
 
Posts: 168
Joined: Wed Dec 03, 2008 22:25

Re: updating desktop icon

Postby dave_p_b » Fri Oct 23, 2009 23:45

Hi. Not sure if this will help but there's a program called recordmydesktop. Qt-recordmydesktop and gtk-recordmydesktop are graphical frontends to recordmydesktop (which is the command line version). The program can record the whole desktop or just part of it. It also takes snapshots of the whole screen. Maybe this program can be of some help. All the best. Dave.
User avatar
dave_p_b
Old Dear Hen
 
Posts: 607
Joined: Fri Dec 15, 2006 1:39
Location: Exeter, UK

Re: updating desktop icon

Postby amoebios » Sat Oct 24, 2009 15:57

Hey Dave,
Thanks for the hint, but recordMyDesktop doesn't seem to have an option for making single image snapshots. (too bad videos can't be used as icons!)
Looking into other screen recorders now.

Edit: i finally found a screenshot tool for the command line: scrot.
User avatar
amoebios
Growing Hen
 
Posts: 168
Joined: Wed Dec 03, 2008 22:25

Re: updating desktop icon

Postby dave_p_b » Sat Oct 24, 2009 22:08

Hi. I'm suprised it doesn't have an option for a single shot coz both the GUI front ends have a button that takes a single shot of the desktop. When you've finished you'll have to let us know (in detail) how you've done it. I would be interested in doing the same thing. Good luck. Cheers dave.
User avatar
dave_p_b
Old Dear Hen
 
Posts: 607
Joined: Fri Dec 15, 2006 1:39
Location: Exeter, UK

Re: updating desktop icon

Postby amoebios » Mon Oct 26, 2009 20:19

Funny indeed! (Or maybe i overlooked it?) :lol:

Anyway, so now i have a "desktop.sh" with:
Code: Select all
#!/bin/sh

exec /usr/bin/scrot /home/user2/desktop.png

and added it to Autostart.

But the icon uses a cached image. i haven't looked into that issue, yet.
User avatar
amoebios
Growing Hen
 
Posts: 168
Joined: Wed Dec 03, 2008 22:25

Re: updating desktop icon

Postby amoebios » Sat Oct 31, 2009 14:29

I can't figure out how to (automatically) clear the icon cache. Could somebody on KDE4.3 try and report if that issue is there, too?

So far i have:
Code: Select all
#!/bin/sh

exec /usr/bin/scrot /home/user2/desktop.png
exec rm -r /home/user2/.thumbnails
exec rm /home/user2/.kde4.2/cache-sabayon/kpc/kde-icon-cache.data
exec rm /home/user2/.kde4.2/cache-sabayon/kpc/kde-icon-cache.index


Or any help with the SVG? i want to keep the mirror reflection, but want it to fade out.

Edit:
Here's the SVG for convenience: http://amoebios.wikispaces.com/file/vie ... esktop.svg
Last edited by amoebios on Thu Nov 05, 2009 12:56, edited 1 time in total.
User avatar
amoebios
Growing Hen
 
Posts: 168
Joined: Wed Dec 03, 2008 22:25

Re: updating desktop icon [Solved]

Postby amoebios » Thu Nov 05, 2009 12:35

Update:

Code: Select all
#!/bin/sh

exec /usr/bin/scrot /home/user2/desktop.png &
exec rm -r /home/user2/.thumbnails &
exec rm /home/user2/.kde4.2/cache-sabayon/kpc/kde-icon-cache.data &
exec rm /home/user2/.kde4.2/cache-sabayon/kpc/kde-icon-cache.index &


So, i finally managed to do it. (I'm so proud!)
It works now. i just wonder if it's necessary to delete both kde-icon-cache.data and kde-icon-cache.index or if it's possible to delete just the desktop.png from the cache. Right now it will delete all icons from the cache. Let me (and all others) know if you find improvements or anything related to this.
User avatar
amoebios
Growing Hen
 
Posts: 168
Joined: Wed Dec 03, 2008 22:25

Re: updating desktop icon [Solved]

Postby Fitzcarraldo » Thu Nov 05, 2009 13:17

Nice. Thanks for sharing this.

(Thinking about it, you could even set up a cronjob (or alternatively use something like KAlarm) to run desktop.sh periodically (perhaps once every 15 minutes or once every hour, or whatever) while you are using your PC. Then the icon would be updated dynamically.)
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7335
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: updating desktop icon [Solved]

Postby amoebios » Thu Nov 05, 2009 13:29

Ideally, it could update when changing themes or the wallpaper.
User avatar
amoebios
Growing Hen
 
Posts: 168
Joined: Wed Dec 03, 2008 22:25

Re: updating desktop icon [Solved]

Postby amoebios » Sun Nov 15, 2009 17:49

In KDE 4.3 (i hopped) i have some issues with thumbnails. Some icons get "stuck". Maybe i messed something up while hopping.

These lines have to be added to the shell script (desktop.sh):
Code: Select all
exec rm /home/user2/.kde/cache-sabayon/kpc/kde-icon-cache.data &
exec rm /home/user2/.kde/cache-sabayon/kpc/kde-icon-cache.index &
exec rm /home/user2/.kde4/cache-sabayon/kpc/kde-icon-cache.data &
exec rm /home/user2/.kde4/cache-sabayon/kpc/kde-icon-cache.index &
User avatar
amoebios
Growing Hen
 
Posts: 168
Joined: Wed Dec 03, 2008 22:25


Return to Artwork and Development Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest

cron