View Single Post
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#26
Originally Posted by Markkyboy View Post
A little help required please guys. I have read the rest of this thread. I have tried Schturman's suggestions on different commands used in either script or desktop file, but after 3 evenings or so, I'm not getting the effect I would like.

Basically, my script tells mcetool to 'disable flipover detection' from a launcher icon, then when icon is executed again, it 'enables flipover detection'. (All of my files are currently in /home/nemo/.local/share/applications).

My script does definitely work, I can check mcetool status output after each execution and I can see the setting is either 'disabled' or 'enabled'.

Thing is, when the enabling or disabling is done, I would like to see fingerterm close, as it opens to display 'flip-detection - enabled/disabled'. (I realise there are other ways to show notifications to user, but I would like to understand this approach first).
I have tried so many different commands and variations within my desktop file and sh file, but to be honest, I don't fully know what I'm doing and am now going round in ever decreasing circles!, I just know what I want to achieve! (closing fingerterm automatically after command/execution is done).

Code from my 'flipdisabled.desktop' file;

Code:
#!/usr/bin/env xdg-open

[Desktop Entry]
Type=Application
Terminal=false
Name=Flip Disabled
Icon=/home/nemo/.local/share/applications/flipdisabled.png
Exec=fingerterm -e /home/nemo/.local/share/applications/flipdisabled.sh
and my 'flipdisabled.sh' file;

Code:
#!/bin/sh
#toggle mcetool flipover-gesture detection
#Markkyboy 2016

TOGGLE=$HOME/.toggle

if [ ! -e $TOGGLE ]; then
    touch $TOGGLE
    echo rootme | devel-su -c exit
    mcetool --set-flipover-gesture-detection=disabled
    echo flip-detection - disabled
else
    rm $TOGGLE
    mcetool --set-flipover-gesture-detection=enabled
    echo flip-detection - enabled
fi
Where and how do I tell the terminal/script to wait 5 seconds, then close fingerterm back to desktop?

All info appreciated
I don't understand, you need fingerterm to be opened ?
If no... Just create helper if you need to run you script as ROOT...

P.S. Also to detect if it enabled or disabled, you can use this command (as root):
Code:
if [[ $(mcetool --status|grep Flipover|awk '{print $4}') == enabled ]]; then
//do something
else
//do something
fi

Last edited by Schturman; 2016-04-01 at 14:18.