1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
#!/bin/sh
# $Id: update-lyxrc,v 1.2 2004/03/04 11:51:20 dexter Exp $
# pod2man --section=1 --release="Debian" --center=" " --date="26 Feb 2004"
error () {
echo "$@" 1>&2
exit 1
}
help () {
echo "Usage: update-lyxrc [ --system | --user ]"
exit 1
}
configure () {
test -d "$1" || error "Can't find directory $1"
touch "$1/lyxrc.defaults" || exit 1
cd "$1" || exit 1
/usr/share/lyx/configure
}
system () {
configure /usr/share/lyx
}
user () {
configure "$HOME/.lyx"
}
if [ "$#" -gt 1 ]; then
help
else
if [ -n "$1" ]; then
case "$1" in
--system) system;;
--user) user;;
*) help;;
esac
else
if [ "$(id -u)" = "0" ]; then
system
else
user
fi
fi
fi
exit 0
cat << END
=head1 NAME
update-lyxrc - Update LyX default configuration
=head1 SYNOPSIS
B<update-lyxrc> S<[B<--system>|B<--user>]>
=head1 DESCRIPTION
B<update-lyxrc> is a tool for updating system or user's LyX
configuration file. This is the same as running Edit->Reconfigure from
LyX's menu.
=head1 OPTIONS
=over 8
=item B<--system>
Update system configuration. This is default for root.
=item B<--user>
Update user's configuration. This is default for non-root.
=back
=head1 SEE ALSO
B<lyx>(1)
=head1 AUTHOR
(c) 2004 Piotr Roszatycki E<lt>dexter@debian.orgE<gt>.
|