From: Sergey Vlasov <vsu@altlinux.ru> To: ALT Devel discussion list <devel@lists.altlinux.org> Subject: Re: [devel] XFS - кому он нужен? или продожение шрифтовой темы Date: Fri, 24 Mar 2006 14:20:08 +0300 Message-ID: <20060324112008.GK32278@master.mivlgu.local> (raw) In-Reply-To: <200603241336.04079.shrek@freesource.info> [-- Attachment #1: Type: text/plain, Size: 3139 bytes --] On Fri, Mar 24, 2006 at 01:35:58PM +0300, Valery V. Inozemtsev wrote: > > > #!/bin/sh > > > > > > PROG="${0##*/}" > > > > > > XFS= > > > USEXFS=0 > > > XSET= > > > ADD=0 > > > FONTPATH= > > > CHKFONTPATH= > > > > > > Usage() > > > { > > > [ "$1" = 0 ] || exec >&2 > > > cat <<EOF > > > Usage: $PROG option[s] directory > > > > > > Valid options are: > > > -a, --add=DIRECTORY Add directory to font path > > > -r, --remove=DIRECTORY Remove directory from font path > > > > Именно так - с параметром? Или всё-таки --add или --remove для задания > > режима работы, а каталог отдельно? > > не думаю что это принципиально Тогда Usage неправильный - каталог не указывается как отдельный параметр. Ну и можно придраться к отсутствию обработки ситуации, когда опция --add или --remove (или вообще обе) присутствует в командной строке несколько раз. > > > -f, --first Make --add to put the directory first (not last) > > > in the path > > > EOF > > > > > > [ -n "$1" ] && exit "$1" || exit > > > } > > > > > > [ -n "$*" ] || Usage > > > > > > TEMP=`getopt -n "$PROG" -o a:r:f -l add:,remove:,first -- "$@"` || Usage > > > eval set -- "$TEMP" > > > > > > if [ -r /etc/sysconfig/xfs ]; then > > > source /etc/sysconfig/xfs > > > case "$XFS" in > > > yes|Yes|YES|true|True|TRUE|on|On|ON|Y|y|1) > > > USEXFS=1 > > > ;; > > > esac > > > fi > > > > > > while :; do > > > case "$1" in > > > -a|--add) > > > shift > > > [ -n "$XSET" ] || XSET="fp+" > > > ADD=1 > > > [ -n "$CHKFONTPATH" ] || CHKFONTPATH="-q -a" > > > FONTPATH="$1" > > > shift > > > ;; > > > -r|--remove) > > > shift > > > XSET="-fp" > > > ADD=0 > > > CHKFONTPATH="-q -r" > > > FONTPATH="$1" > > > shift > > > ;; > > > -f|--first) > > > XSET="+fp" > > > ADD=1 > > > CHKFONTPATH="-q -fa" > > > shift > > > ;; > > > --) > > > shift > > > break > > > ;; > > > esac > > > done > > > > > > eval /usr/sbin/chkfontpath "$CHKFONTPATH" "$FONTPATH" >/dev/null 2>&1 > > > > > > if [ "$USEXFS" = 0 ]; then > > > XPID=`pidof X` > > > if [ -n "$XPID" ]; then > > > for n in $XPID; do > > > SERVER=`awk -F: '{print(substr($2,1,1))}' /proc/$n/cmdline` > > > [ -n "$SERVER" ] || continue > > > AUTH=`awk -F-auth '{print($2)}' /proc/$n/cmdline` > > > [ -r "$AUTH" ] || continue > > > export XAUTHORITY="$AUTH" > > > FP=`xset -display :"$SERVER" q | grep -q "$FONTPATH"; echo $?` > > > if [ "$FP" = 1 -o "$ADD" = 0 ]; then > > > xset -display :"$SERVER" "$XSET" "$FONTPATH" > /dev/null 2>&1 > > > fi > > > xdpyinfo -display :"$SERVER" | grep -q FontCache && > > > xset -display :"$SERVER" fp rehash > > > done > > > fi > > > fi > > > > Выглядит как набор кривых хаков :( > > мне оно тоже не нравится, поэтому я и предлагал не заморачиваться с > доступностью шрифтов скразу после установки в прогах не поддерживающих > fontconfig. однако оно работает Надо будет придумать, как сделать при запуске X что-нибудь такое, чтобы это работать перестало ;) [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2006-03-24 11:20 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2006-03-22 13:44 Valery V. Inozemtsev 2006-03-22 14:13 ` Michael Shigorin 2006-03-22 14:30 ` Valery V. Inozemtsev 2006-03-22 14:39 ` Michael Shigorin 2006-03-22 18:38 ` Valery V. Inozemtsev 2006-03-22 19:35 ` Dmitry V. Levin 2006-03-22 20:55 ` Michael Shigorin 2006-03-24 8:20 ` Valery V. Inozemtsev 2006-03-24 9:58 ` Sergey Vlasov 2006-03-24 10:35 ` Valery V. Inozemtsev 2006-03-24 11:20 ` Sergey Vlasov [this message] 2006-03-22 20:09 ` Vitaly Lipatov
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20060324112008.GK32278@master.mivlgu.local \ --to=vsu@altlinux.ru \ --cc=devel@lists.altlinux.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux Team development discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \ devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru public-inbox-index devel Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.devel AGPL code for this site: git clone https://public-inbox.org/public-inbox.git