![]() |
2014-02-06
, 01:02
|
Posts: 15 |
Thanked: 15 times |
Joined on Jan 2014
@ Estonia
|
#22
|
![]() |
2014-02-06
, 02:12
|
Moderator |
Posts: 6,215 |
Thanked: 6,400 times |
Joined on Nov 2011
|
#23
|
![]() |
2014-02-06
, 04:01
|
|
Posts: 6,436 |
Thanked: 12,701 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#24
|
![]() |
2016-04-01
, 12:40
|
|
Posts: 433 |
Thanked: 727 times |
Joined on Oct 2012
@ Costa Blanca, España
|
#25
|
#!/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
#!/bin/sh #toggle mcetool flipover-gesture detection #Markkyboy 2016 TOGGLE=$HOME/.toggle if [ ! -e $TOGGLE ]; then touch $TOGGLE mcetool --set-flipover-gesture-detection=disabled echo flip-detection - disabled else rm $TOGGLE mcetool --set-flipover-gesture-detection=enabled echo flip-detection - enabled fi
![]() |
2016-04-01
, 13:51
|
|
Posts: 5,339 |
Thanked: 4,133 times |
Joined on Jan 2010
@ Israel
|
#26
|
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;
and my 'flipdisabled.sh' 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
Where and how do I tell the terminal/script to wait 5 seconds, then close fingerterm back to desktop?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
All info appreciated
if [[ $(mcetool --status|grep Flipover|awk '{print $4}') == enabled ]]; then //do something else //do something fi
![]() |
2016-04-01
, 15:24
|
|
Posts: 433 |
Thanked: 727 times |
Joined on Oct 2012
@ Costa Blanca, España
|
#27
|
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
![]() |
2016-04-01
, 15:53
|
|
Posts: 5,339 |
Thanked: 4,133 times |
Joined on Jan 2010
@ Israel
|
#28
|
Thanks Schturman, but all you have done is confuse me more than I already am!
So, okay, I don't necessarily need fingerterm to be opened, it was something I had stumbled across and thought it was suitable at this point to use as notification that the service is enabled/disabled.
One of the reasons I went with terminal opening and displaying enabled/disabled was so I didn't have to see the cover with the busy indicator on it - which stays on screen from around 12 seconds..?, yet the process is done as soon as the command/script is executed, so why the lengthy wait for cover/indicator to close. I'm to understand this cannot be avoided or closed, it has to run til its finished.
So, you are saying I should replace my Toggle script with your 'helper' script, yes?,
(if so, I tried it, I also removed 'fingerterm -e' from 'Exec=' in desktop file just leaving /path/to/file/blah.sh). But when exectued, this just shows cover and busy indicator/cover for 12 seconds again. I'd like to not see that cover! (Yes, the service is still getting switched, but I had that happening anyway).
#include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <unistd.h> int main() { setuid( 0 ); system( "/path/to/your/script.sh"); return 0; }
gcc /path/to/helper.c -o /path/to/your/script-root
Exec=/path/to/your/script-root
Telegram | Openrepos | GitHub | Revolut donations