le-proinfodata: Fix exec_dialog.sh

This script had lots of problems: 1. Fixed disable/enable mouse button 2. Moved code from stop_screen.sh to exec_dialog.sh 3. Fixed code moved.. Signed-off-by: 's avatarDiego Giovane Pasqualin <dpasqualin@c3sl.ufpr.br>
parent 54c3206e
......@@ -17,6 +17,7 @@
# 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"
......@@ -24,13 +25,13 @@ 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" &
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 11 4 5 6 7 8 9" &
xmodmap -e "keycode 64 = " &
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"
xmodmap -e "keycode 64 = "
}
function call_dialog_inep_mult_off () {
......@@ -45,17 +46,45 @@ function call_dialog_inep_mult_off () {
enable_mouse
}
# Disable user interaction with gnome panel
function disable_gnome() {
local P_EDUBAR=""
local P_EDUBAR_POS=""
local P_GPANEL=""
while [[ -z "$P_EDUBAR" ]] || [[ -z "$P_GPANEL" ]] || [[ -z "$P_EDUBAR_POS" ]]; do
# Get PID
P_EDUBAR_POS=$(ps aux | grep "le-edubar_position.sh" | awk '{print $2}')
P_EDUBAR=$(pgrep le-edubar)
P_GPANEL=$(pgrep gnome-panel)
sleep 1
done
# Disable Edubar and Panel
kill $P_EDUBAR
kill -stop $P_EDUBAR_POS $P_GPANEL
}
# Enable user interaction with gnome panel
function enable_gnome() {
# Get PID
local P_EDUBAR_POS=$(ps aux | grep "le-edubar_position.sh" | awk '{print $2}')
local P_GPANEL=$(pgrep gnome-panel)
# Enable Edubar and Panel
# NOTE: le-edubar_position.sh will automatically open le-edubar
kill -cont $P_GPANEL $P_EDUBAR_POS
}
function call_dialog_inep_mult_on () {
#Disable mouse right-click
# Disable user interaction
disable_mouse
disable_gnome
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 user interaction
enable_gnome
enable_mouse
}
......
#!/bin/bash
# Copyright (C) 2004-2012 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#session-setup-script = exec_dialog.sh
# 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_LOCK="/tmp/.dialog.lock"
P_EDUBAR=$(ps aux | grep "/usr/share/gnome/autostart/le-edubar_position.sh" | tr -s -t " " "|" | cut -d"|" -f2)
P_GPANEL=$(pgrep -u $USER gnome-panel)
NUM=$(cat $F_LOCK)
#Disable Edubar and Panel in Multiterminal
if [ $NUM -eq 0 ]; then
kill -stop $P_EDUBAR
pkill le-edubar
kill -stop $P_GPANEL
fi
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