3 # This is a simple script to merge the keyword tree of one Geeqie
4 # configuration file into another.
5 # The keyword trees are simply concatenated. When Geeqie loads
6 # the resulting configuration file, any duplicates are discarded.
8 # There is no error checking.
17 if [[ $line_merge =~ "<keyword_tree>" ]]
22 if [[ $line_merge =~ "</keyword_tree>" ]]
26 echo $line_merge >> "$2"
34 zenity --info --text="This script will merge the keywords from one Geeqie\nconfiguration file into another.\n\n\The command format is:\nmerge.sh {config. file to merge into} {config. file to merge from}\n\nIf you do not supply parameters, you are prompted.\n\nYou are given the option to backup the main config. file before it is overwritten with the merged data.\n\nEnsure that Geeqie is not running." --title="Geeqie merge keywords" --width=400 --height=200
43 zenity --error --text "Too many parameters"
47 config_main=$(zenity --file-selection --file-filter="geeqierc.xml" --file-filter="*.xml" --file-filter="*" --title="Select main configuration file")
52 config_merge=$(zenity --file-selection --file-filter="geeqierc.xml" --file-filter="*.xml" --file-filter="*"-- title="Select configuration file to merge from")
59 config_merge=$(zenity --file-selection --file-filter="geeqierc.xml" --file-filter="*.xml" --file-filter="*" --title="Select configuration file to merge from")
70 if [[ $line_main =~ "</keyword_tree>" ]]
72 merge_file "$config_merge" "$tmp_file"
74 echo "$line_main" >> "$tmp_file"
77 zenity --question --text="Backup configuration file before overwriting?"
80 cp "$config_main" "$config_main""."$(date +%Y%m%d%H%M%S)
83 mv "$tmp_file" "$config_main"