View Single Post
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#28
Originally Posted by Markkyboy View Post
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).
It can't be done without seeing the cover (as far as I know).
About helper.c, I mean if you need to run your script as root, you can create this file:
Code:
#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;
}
Now convert it:
Code:
gcc /path/to/helper.c -o /path/to/your/script-root
Give permisdion 4755 to your script.sh and script-root files.
In desktop file:
Code:
Exec=/path/to/your/script-root

Last edited by Schturman; 2016-04-01 at 16:13.