image
image

Go Back   macosx.com > Mac Help Forums > Mac OS X System & Mac Software

Reply
 
Thread Tools
  #1  
Old May 13th, 2003, 02:25 PM
Registered User
 
Join Date: May 2003
Location: San Diego
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
wstewart is on a distinguished road
Question Sharing Stickies between Accounts

Anyone have an idea how to set up Stickies so you can see the same file across multiple Accounts (on the same machine)?

I asked this question on MacOSXHints.com and it was suggested that I move the .StickiesDatabase file to ~/Users/Shared/ and place an alias back in ~/Library/.StickiesDatabase for each account. It was also mentioned that I might have to change the permissions to read/write for group access.

I tried the above, but I must either not have all the steps correct (particularly the permissions), or it simply doesn't work. Now, on launch of Stickies, I get nothing (no Stickies appear).

I also see that there is a .plist for the Stickies database. Is this part of the equation? Do I need to put it in ~/Users/Shared/ and an alias back to ~/Library/?

If you have any ideas (or better instructions), I'd appreciate the help. I really like Stickies; but, I need to share them between multiple users of the same machine.

Thanks... Bill
Reply With Quote
  #2  
Old May 14th, 2003, 05:00 PM
In debt medical student
 
Join Date: Sep 2001
Location: In a chair
Posts: 270
Thanks: 0
Thanked 0 Times in 0 Posts
Lazarus18 is on a distinguished road
It ain't pretty

I think I came up with a solution, but it requires an amount of hacking around in the terminal. I'm assuming that we're talking about sharing these stickies between two accounts on the same computer (although if you were really tricky you could modify the scripts to do this over multiple machines).

1) First, you'll need to create a script that you will run when a user logs out. In the terminal use sudo mkdir to create the directory /usr/local/bin if it does not already exist. In this directory type:
sudo pico -w logoutscript
then in the file you're creating write the following script:
#!/bin/sh
rsync -uaW /Users/user1/Library/StickiesDatabase /Users/user2/Library/StickiesDatabase

rsync -uaW /Users/user2/Library/StickiesDatabase /Users/user1/Library/StickiesDatabase

/usr/sbin/chown user1.staff /Users/user1/Library/StickiesDatabase

/usr/sbin/chown user2.staff /Users/user2/Library/StickiesDatabase

(If you have more than 2 users this gets uglier, but is still doable. In theory you could write a script to do all this, but I'm FAR too lazy for that. If you had 3 users you'd have to run rsync -uaW /Users/user1... twice, and copy it into user2 and user3's Libraries. Then user2 has two rsyncs to copy into 1 and 3, etc. You'd also then use chown to set the ownership of this file to the correct user 3 times.)

hit ^X to exit and type Y to indicate you want to save this wonderful new file, then enter.

If you're not familiar with rsync, the short version is that it's one of my favorite things about unix. With the -u tag it compares which file is most recent and updates the files to refelct this. It won't overwrite a newer file with an older one IOW.

2) Now we need to make this script executable. Type sudo chmod 700 logoutscript

3) Now we need to tell OSX to run this script anytime a user logs out. To do this type sudo pico -w /etc/ttys. Now look for a line that starts console "/System/Library/CoreServices/loginwindow.app/Contents/MacOS... and change it to read:
console "/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow -LogoutHook /usr/local/bin/logoutscript" vt100 on secure
window=/System/Library/CoreServices/WindowServer onoption="/usr/libexec/getty std.960

This should all be on one line. There's a space before and after -LogoutHook if that's not apparent. Hit ^X followed by Y then enter to exit and save. Restart el computero.

That should do it (unless I'm a moron and forgot something). The script will run when you logout and rsync will copy the newest version of StickiesDatabase to each user's Library, and then reset the owner to the appropriate party.

All of this is necessary because for whatever reason Stickies reads symbolic links but ignores them when it comes time to writing data and if you have them it will just overwrite new data.

Hope that does it for you. Let me know if something goes awry. (And I disavow any responsibility if you frag your machine, but I'll try and help you fix it )
__________________
-Rob


-iMac 20" 2.4Ghz C2D, 1GB RAM, 500GB HD
-iBook G4 1.2 GHz, 756 MB RAM, 60GB HD, Superdrive

Last edited by Lazarus18; May 14th, 2003 at 05:20 PM.
Reply With Quote
  #3  
Old May 14th, 2003, 05:43 PM
profx's Avatar
ill never 4get watsisname
 
Join Date: May 2001
Location: Auckland New Zealand
Posts: 386
Thanks: 0
Thanked 0 Times in 0 Posts
profx is on a distinguished road
or instead of rsync-ing the files you could just set the permissions to group write then move the file from the shared folder to the users on login then back to shared on logout. Only one person has access to the file at a time after all.

You might want to copy the file just incase the script fails to run on logout (power failure for instance - i would say crash but a powercut would be much more likley!)
__________________
| PowerBook G4 550 - 10.4 - 512Mb - 20Gb | 30Gb iPod Photo | 40x12x48 Fantom Drives CDRW (firewire) | Logitech Cordless Mouse MX700 | xBox with XBMC for movies and music in the lounge
Reply With Quote
  #4  
Old May 14th, 2003, 06:04 PM
In debt medical student
 
Join Date: Sep 2001
Location: In a chair
Posts: 270
Thanks: 0
Thanked 0 Times in 0 Posts
Lazarus18 is on a distinguished road
That wouldn't work. The script that is run at logout is run as root. Therefore there is no way for it to know what user set it off. It can't say, "Ah, user2 logged out, causing me to run, thus I shall copy StickiesDatabase from user2's Library to the Shared directory." It does the same thing at every logout from every user. Therefore rsync provides the intelligence, the user who exited most recently has the newest copy of StickiesDatabase and that's the one that will overwrite everyone else's copy.

I've always thought it would be easiest to have a .logout for each user or something similar. Too bad that's not an option.
__________________
-Rob


-iMac 20" 2.4Ghz C2D, 1GB RAM, 500GB HD
-iBook G4 1.2 GHz, 756 MB RAM, 60GB HD, Superdrive

Last edited by Lazarus18; May 14th, 2003 at 06:46 PM.
Reply With Quote
Reply

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HP Photosmart 1315 and USB Print Sharing zwheeloc Mac Classic System & Software 12 February 6th, 2003 08:20 PM
[HOWTO] Create mail-only user accounts gatorparrots HOWTO & FAQs 2 January 1st, 2003 08:24 PM
How sercure is OS X's Web Sharing and File Sharing? PowerBookDude Mac OS X System & Mac Software 5 October 13th, 2001 01:06 AM
File sharing problems iconara Mac OS X System & Mac Software 0 April 9th, 2001 06:26 AM


All times are GMT -5. The time now is 06:51 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.