LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 01-24-2005, 03:48 PM   #1
davecs
Member
 
Registered: Feb 2003
Location: Barking, Essex, Britain
Distribution: PCLinuxOS and MX-Linux
Posts: 503

Rep: Reputation: 32
How does ROOT force icons onto USER desktops?


Odd request? Not really!

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?
 
Old 01-24-2005, 10:19 PM   #2
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Rep: Reputation: 48
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).
 
Old 01-25-2005, 03:34 PM   #3
davecs
Member
 
Registered: Feb 2003
Location: Barking, Essex, Britain
Distribution: PCLinuxOS and MX-Linux
Posts: 503

Original Poster
Rep: Reputation: 32
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!
 
Old 01-25-2005, 04:13 PM   #4
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
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
 
Old 01-25-2005, 05:22 PM   #5
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Rep: Reputation: 48
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
force apps in specific virtual desktops gollum26 Linux - Software 2 01-02-2005 07:17 PM
Virtual Desktops and Icons question webwolf70 Linux - General 5 08-24-2004 12:30 PM
Force user to be in a group to use su? jrbush82 Linux - Security 2 06-03-2004 09:48 PM
Force user ust Linux - General 1 10-09-2003 11:03 AM
mandrake 8.2. missing icons from desktops. LinuxHatesMe Linux - General 0 05-25-2002 01:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration