le-proinfodata: 05-exec_dialog.script is now a symlink to exec_dialog.sh

parent 2acd9327
......@@ -24,6 +24,7 @@
SEED_MEC_HOME="/opt/seed_mec"
BACKUP_DIR="/opt/seed_mec_backup"
LBFILE="/etc/le-proinfodata/le.zone.bz2"
MULTISEAT_DIR="/etc/userful/scripts/PostLogin"
# Descompressing the local base
[[ -f $LBFILE ]] && bunzip2 -f $LBFILE
......@@ -72,6 +73,13 @@ for file in $DIVERTS; do
fi
done
# The multiseat system need the exec_dialog.sh script to be in a different
# place to work properly
if [[ -d "$MULTISEAT_DIR" ]]; then
ln -fs "/usr/local/bin/exec_dialog.sh" \
"$MULTISEAT_DIR/05-exec_dialog.script"
fi
# Make sure the owner of ~seed_mec is seed_mec
chown -R seed_mec:seed_mec "${SEED_MEC_HOME}"
......
#!/bin/bash
# Copyright (C) 2004-2012 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
# This file is part of le-proinfodata
#
# exec_dialog.sh is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
F_MULT="/tmp/.mult.lock"
F_LOCK="/tmp/.dialog.lock"
F_INEP="/opt/seed_mec/SEED2/client/conf/inep"
BACKGROUND="/usr/share/backgrounds/le5-wallpaper1600X1200.png"
LE_EDUBAR_POS="/usr/share/gnome/autostart/le-edubar_position.sh"
function enable_mouse () {
xmodmap -e "pointer = 1 2 3 4 5 6 7 8 9" &
xmodmap -e "keycode 64 = Alt_L Meta_L Alt_L Meta_L Alt_L Meta_L" &
}
function disable_mouse () {
xmodmap -e "pointer = 1 2 11 4 5 6 7 8 9" &
xmodmap -e "keycode 64 = " &
}
function call_dialog_inep_mult_off () {
#Disable mouse right-click
disable_mouse
#Set background
xli -onroot -fillscreen $BACKGROUND
dialog_inep.sh
#Reset background to default
xli -onroot -background black
#Enable mouse right-click
enable_mouse
}
function call_dialog_inep_mult_on () {
#Disable mouse right-click
disable_mouse
dialog_inep.sh
#Get PID
P_EDUBAR=$(ps aux | grep $LE_EDUBAR_POS | tr -s -t " " "|" | cut -d"|" -f2)
P_GPANEL=$(pgrep gnome-panel)
#Enable Edubar and Panel
kill -cont $P_GPANEL
kill -cont $P_EDUBAR
#Enable mouse right-click
enable_mouse
}
export LANG="pt_BR.UTF-8"
# SANITY CHECK -------------------------------------------------------
# Do not run script if we are on live-cd
# or the INEP code is already set
# or we are logging out
if dpkg --get-selections "ubiquity-le" | grep -q 'install$' ||
[ -f $F_INEP ] ||
[ -f $F_LOCK ]; then
exit 0
fi
# --------------------------------------------------------------------
# Delay for not happen overlay window
sleep 3
# Check whether the computer is running on a the multiterminal
if dpkg --get-selections "le-multiterminal" | grep -q 'install$'; then
# In the first call (lightdm) in multiterminal this is script must leave, to be called again after.
if [ -f $F_MULT ];then
touch $F_LOCK
echo "0" > $F_LOCK
call_dialog_inep_mult_on
else
touch $F_MULT
exit 0
fi
else
touch $F_LOCK
echo "1" > $F_LOCK
call_dialog_inep_mult_off
fi
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment