lilalo

diff l3bashrc @ 78:147fb109c012

Добавлена функция l3shot,
которая позволяет делать скриншот экрана,
для того чтобы он мог быть автоматически вставлен в lablog
author devi
date Sun Feb 19 14:36:33 2006 +0200 (2006-02-19)
parents e56f21c44faf
children 44973d76ba4d
line diff
     1.1 --- a/l3bashrc	Mon Feb 13 19:28:51 2006 +0200
     1.2 +++ b/l3bashrc	Sun Feb 19 14:36:33 2006 +0200
     1.3 @@ -166,3 +166,30 @@
     1.4      unset `set | grep '^_l3_.*()' | sed 's/()//'`
     1.5      unset `set | grep '^_l3_.*=' | sed 's/=.*//'`
     1.6  }
     1.7 +
     1.8 +
     1.9 +l3shot()
    1.10 +{
    1.11 +    if [ -x "`which xwd`" ]
    1.12 +    then
    1.13 +        _l3_home=${L3_HOME:-~/.lilalo}
    1.14 +        shot_name="${L3_SESSION_ID}_`date +%s`".xwd
    1.15 +        echo -n Choose window to be shoot ... >&2
    1.16 +        [ -d ${_l3_home} ] || mkdir -p ${_l3_home}
    1.17 +        xwd -out "$_l3_home/$shot_name" \
    1.18 +        && echo  Ok\
    1.19 +        && echo Shot was successful. \
    1.20 +        && echo Screenshot is written to ${_l3_home}/${shot_name} \
    1.21 +        && echo Screenshot will appears in the lablog.
    1.22 +    else
    1.23 +        {
    1.24 +            echo
    1.25 +            echo "Can't make screenshot :("
    1.26 +            echo 
    1.27 +            echo I must use program xwd to make screenshot, 
    1.28 +            echo but it seems not to be installed
    1.29 +            echo Try to find the program in the \"xbase-clients\" package
    1.30 +            echo
    1.31 +        }   >&2 
    1.32 +    fi
    1.33 +}