Skip to content
Snippets Groups Projects
Commit f81361e9 authored by Diego Giovane Pasqualin's avatar Diego Giovane Pasqualin
Browse files

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: default avatarDiego Giovane Pasqualin <dpasqualin@c3sl.ufpr.br>
parent 54c3206e
Branches
No related tags found
No related merge requests found
......@@ -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
}
function call_dialog_inep_mult_on () {
#Disable mouse right-click
disable_mouse
dialog_inep.sh
# 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=$(ps aux | grep $LE_EDUBAR_POS | tr -s -t " " "|" | cut -d"|" -f2)
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
kill -cont $P_GPANEL
kill -cont $P_EDUBAR
#Enable mouse right-click
# NOTE: le-edubar_position.sh will automatically open le-edubar
kill -cont $P_GPANEL $P_EDUBAR_POS
}
function call_dialog_inep_mult_on () {
# Disable user interaction
disable_mouse
disable_gnome
dialog_inep.sh
# 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment