Commit 7f0c0385 authored by Diego Giovane Pasqualin's avatar Diego Giovane Pasqualin

Merge branch 'proinfodata_dialog' of /home/git/repositories/le5/unstable

parents bb156099 d8cafdbc
Package: le-proinfodata
Version: 1.2.38
Version: 1.2.39
Maintainer: <proinfodata@c3sl.ufpr.br>
Architecture: i386
Section: main
......
......@@ -53,11 +53,16 @@ fi
# Set lightdm to open the le-proinfodata configuration script when user
# session starts
if ! grep -q "session.*exec_dialog.sh" "/etc/lightdm/lightdm.conf"; then
sed -i '/\[SeatDefaults\]/ a\session-setup-script=/usr/local/bin/exec_dialog.sh' \
if [[ ! -d $MULTISEAT_DIR ]]; then
if ! grep -q "session.*exec_dialog.sh" "/etc/lightdm/lightdm.conf"; then
sed -i '/\[SeatDefaults\]/ a\session-setup-script=/usr/local/bin/exec_dialog.sh' \
/etc/lightdm/lightdm.conf
fi
else
sed -i '\,session-setup-script=/usr/local/bin/exec_dialog.sh,d' \
/etc/lightdm/lightdm.conf
fi
# We will no longer need this files, but as the postrm would only remove the
# diverts when this package were removed, we have to do it here
DIVERTS="
......
......@@ -25,25 +25,48 @@ BACKGROUND="/usr/share/backgrounds/le5-wallpaper1600X1200.png"
LE_EDUBAR_POS="/usr/share/gnome/autostart/le-edubar_position.sh"
function enable_mouse () {
# Enable mouse right-click and left-click
xmodmap -e "pointer = default"
xmodmap -e "keycode 64 = Alt_L Meta_L Alt_L Meta_L Alt_L Meta_L"
}
function disable_mouse () {
xmodmap -e "pointer = 1 2 32 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 3"
if [[ -z "$1" ]]; then
# Disable mouse right-click
xmodmap -e "pointer = 1 2 0 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"
xmodmap -e "keycode 64 = "
else
# Disable mouse right-click and left-click
xmodmap -e "pointer = 0 2 0 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"
xmodmap -e "keycode 64 = "
fi
}
function disable_keyboard () {
# Disable keyboard control-button and alt-button
xmodmap -e "remove Control = Control_L"
xmodmap -e "keycode 64 = "
}
function enable_keyboard () {
# Enable keyboard control-button and alt-button
xmodmap -e "add Control = Control_L"
xmodmap -e "keycode 64 = Alt_L Meta_L Alt_L Meta_L Alt_L Meta_L"
}
function call_dialog_inep_mult_off () {
#Disable mouse right-click
# Disable mouse right-click
disable_mouse
#Set background
# Disable keyboard control-button and alt-button
disable_keyboard
# Set background
xli -onroot -fillscreen $BACKGROUND
dialog_inep.sh
#Reset background to default
# Reset background to default
xli -onroot -background black
#Enable mouse right-click
# Enable mouse right-click
enable_mouse
# Enable keyboard control-button and alt-button
enable_keyboard
}
# Disable user interaction with gnome panel
......@@ -88,12 +111,31 @@ function call_dialog_inep_mult_on () {
# Disable user interaction
disable_mouse
disable_gnome
# Disable keyboard control-button and alt-button
disable_keyboard
# Start Inep Dialog
dialog_inep.sh
# Enable user interaction
enable_gnome
enable_mouse
enable_keyboard
}
function warning_dialog_inep_on () {
# Disable user interaction
# Disable mouse right-click and left-click
disable_mouse "all"
# Disable keyboard control-button and alt-button
disable_keyboard
# Warning other INEP setting
while [ ! -e $F_LOCK ]; do
echo wait
sleep 1
done | zenity --progress --pulsate --no-cancel --auto-close --title="INEP" \
--text="Aguarde a configuração do PROINFODATA"
# Enable user interaction
enable_keyboard
enable_mouse
}
export LANG="pt_BR.UTF-8"
......@@ -111,18 +153,18 @@ fi
# 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
(
flock -n 200
if [ $? != "0" ]; then
warning_dialog_inep_on
else
call_dialog_inep_mult_on
touch $F_LOCK
fi
) 200>$F_MULT
else
touch $F_LOCK
echo "1" > $F_LOCK
call_dialog_inep_mult_off
touch $F_LOCK
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