Helge Hafting wrote:

> Alexis Huxley wrote:
> 
>>Hi, I'm using a 21" screen and a 14" laptop for LyX.
>>
>>I keep having to change the font zoom from the
>>Edit/Preferences/Screen-Fonts menu when I go from
>>one monitor to the other.
>>
>>Is there a way to specify a per-$DISPLAY value here?
>>If there is an X resource for it then I can xrdb
>>merge it; or I can if LyX will not overrule that with
>>the preference-specified value.
>>
>>Any help appreciated. Thanks!
>>  
>>
> There is no direct support, but workarounds are possible.
> 
> The setting \screen_zoom is stored in .lyx/preferences
> 
> So, you can keep two such preference files and have scripts called
> lyx14 and lyx21 that copies one or the other into .lyx/preferences
> before starting lyx.
> 
> Of course this solution makes changing any other preferences
> more difficult, as you have to update the two other files
> afterwards.  A better option is to write a script that modifies
> the \screen_zoom setting in .lyx/preferences directly before
> starting lyx.  This script may be a little harder to write though.

Not that hard though and a good idea. Something like:

#! /bin/sh

# A script to start lyx on a 21" screen

LYXDIR=$HOME/.lyx
PREFERENCES=$LYXDIR/preferences

# Tune to suit
ZOOM=120

test -r ${PREFERENCES} && {
        grep '^\\screen_zoom' ${PREFERENCES} > /dev/null && {
                sed "s/^\(\\\\screen_zoom\).*/\1 ${ZOOM}/" \
                        ${PREFERENCES} > ${PREFERENCES}_new
                mv ${PREFERENCES}_new ${PREFERENCES}
        } || {
                echo "\\screen_zoom ${ZOOM}" >> ${PREFERENCES}
        }
} || {
        echo "\\screen_zoom ${ZOOM}" >> ${PREFERENCES}
}

-- 
Angus

Reply via email to