4 #==============================================================================#
9 echo "To load a config file:"
10 echo " $0 load CONFIG_NAME"
12 echo "To save the current config to file:"
13 echo " $0 save CONFIG_NAME"
15 echo "To delete the current config:"
16 echo " $0 delete CONFIG_NAME"
18 echo "To list existing configs:"
21 echo "To print the contents of a config:"
22 echo " $0 print CONFIG_NAME"
24 echo "To see the difference between the current config and another:"
25 echo " $0 diff CONFIG_NAME"
27 echo "To use the .pdrc instead, add '--pdrc':"
28 echo " $0 --pdrc load CONFIG_NAME"
29 echo " $0 --pdrc save CONFIG_NAME"
30 echo " $0 --pdrc delete CONFIG_NAME"
31 echo " $0 --pdrc list"
32 echo " $0 --pdrc print CONFIG_NAME"
33 echo " $0 --pdrc diff CONFIG_NAME"
37 #==============================================================================#
43 # get the command line arguments
44 if [ $1 == "--pdrc" ]; then
52 # location of pref file that Pd reads
55 CONFIG_DIR
=~
/Library
/Preferences
56 CONFIG_FILE
=org.puredata.pd.plist
60 CONFIG_FILE
=.pdsettings
63 echo "Not supported on this platform."
69 # everything happens in this dir
72 selected_file
="$CONFIG_DIR/$CONFIG_FILE-$CONFIG_NAME"
75 if [ -e "$selected_file" ]; then
76 test -e "$CONFIG_FILE" && mv -f "$CONFIG_FILE" /tmp
77 cp "$selected_file" "$CONFIG_FILE" && \
78 echo "Pd config \"$selected_file\" loaded."
80 echo "\"$selected_file\" doesn't exist. No action taken."
84 if [ -e "$CONFIG_FILE" ]; then
85 cp -f "$CONFIG_FILE" "$selected_file" && \
86 echo "Pd config \"$CONFIG_NAME\" saved."
88 echo "\"$CONFIG_FILE\" doesn't exist. No action taken."
92 if [ -e "$selected_file" ]; then
93 rm -f "$selected_file" && \
94 echo "Pd config \"$selected_file\" deleted."
96 echo "\"$selected_file\" doesn't exist. No action taken."
100 echo "Available configs:"
102 ls -1 "${CONFIG_FILE}"*
106 if [ "${CONFIG_NAME}" == "" ]; then
113 diff -uw "${CONFIG_FILE}" "$selected_file"