Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If there is a directory under /usr where any contents are added to each user's desktop, it could be used to make icons appear when "udev" reacts to a storage device being plugged in, like a USB key. This icon can then be used to mount the storage device. Could be quite a smooth way of doing things, especially in conjunction with "autofs".
I know that Mandrake used to do this in early versions, as there were icons on your user desktop that you could not get rid of, because they were controlled by the system and not actually in your ~/Desktop directory.
Does anyone know which directory I am looking for?
I don't know about a directory under /usr but you could change the udev.rules file to do what you want (I think). You can set up udev to run a program/script when a device is detected using the PROGRAM option. Look at
man udev
for more details.
Alternatively, if you don't mind all users having the same desktop, you could symlink the ~/Desktop directory to some directory in /usr or whereever and make that directory writable to everyone (not a good idea if you have different people using the computer but if it's just you as root and as a user, seems fine).
I realise I could make the icons appear on my personal desktop as I am the only actual user, but I wanted to go about it properly! I am sure there is a folder for this... internet search time!
K12ltsp has a script for pushing icons to users desktops. The script is /usr/sbin/push-icons-to-users-desktops . You can put a link to that on the root desktop. The root user drags a icon right over this script or link and it will appear on all user desktops.
That might be a starting point for you....
Code:
#!/bin/sh
#
# A quick-n-dirty little script that will copy an icon to all user's
# GNOME/KDE desktops
#
# give the user a usage message if there were no files specified
if [ ! "$1" ]
then
if [ "$DISPLAY" ]
then
gdialog --title "Push new icons to all user's desktops" --msgbox "Create a new icon on your desktop.\nOnce it is working the way you want it to, drag-n-drop the new icon ontop of this one and the icon will be copied to all user's home directories" 10 55
else
echo
echo "This script will copy a *.desktop file to all "
echo "user's home directories"
echo
echo "Usage:"
echo " $0 <icon to push>"
echo
echo
fi
fi
while [ $# -gt 0 ]
do
FILE="$1"
if [ -f "$FILE" ]
then
# save a copy in /etc/skel/Desktop for new users
if [ -d /etc/skel/Desktop ]
then
cp -a "$FILE" /etc/skel/Desktop/
fi
DEST="`basename \"$FILE\"`"
# find all of the subdirectories under /home
getent passwd | cut -d: -f6 | while read U
do
# copy new-style Desktop
if [ -d "$U"/Desktop/ ]; then
cp -a "$FILE" "$U"/Desktop/
chown --reference="$U"/Desktop "$U"/Desktop/"$DEST"
fi
# copy old-style .gnome-desktop
if [ -d "$U"/.gnome-desktop/ ]; then
cp -a "$FILE" "$U"/.gnome-desktop/
chown --reference="$U"/.gnome-desktop "$U"/.gnome-desktop/"$DEST"
fi
done
fi
shift
done
If you're using kde, it can be set to show icons for devices (configure desktop). You can also set it to show just mounted devices or mounted and unmounted devices. Would this be good enough? I don't think this works through a directory.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.