Lets start making the helper gadgets


theredbaron

Very Active Member
Joined
Feb 12, 2014
Messages
130
Location
/home/theredbaron/
I want scripts with no interface that I can run from keyboard shortcuts. Like, a script that I run and if the modem is on, it turns it off, and if it's off, it turns it on. Stuff like that.
While I understand the want, this is something even I can script in a few min with a simple if/then.

However, this isn't exactly user facing friendly. A simple gui, even just zenity, or an applet with right click menu would be better for "users". Like me. I don't do shortcuts in general, f12 to a term, then type it in, or gui for me. Granted, I have used many toggle scripts, but never as shortcuts.

Personally, I would want both. An applet, with all the pyra specific toggles, which when clicked run the toggle scripts. Thus those of use who prefer gui for toggles can do that, and keyboard ninjas have their own option too.

Sent from my H3123 using Tapatalk
 

pyrat

Very Active Member
Joined
May 20, 2016
Messages
404
Can you pass parameters to scripts on a keyboard shortcut ? You can at least have further scripts that call a script with different parameters.

Then the script could work as told by the parameters when it gets them and ask with zenity or any GUI when missing parameters and everyone is happy ?
 

F_Slim

IDDQD
Joined
Aug 25, 2010
Messages
1,412
Age
41
Location
Germany
What else is missing or wanted?
A sleep timer would be nice. I often use my Pandora as mp3 player when going to bed and so I want it to poweroff after an hour or so.
Someone posted a .PND (it is not ithe one from the Repo) which opens a dialog where you can set the desired time in minutes. It then minimizes to the task bar and shows the remaining time in a mouse-over popup. You can also stop or change the timer from there.

Something like that would be nice to have as build-in widget.
 

elw3

ƐʍlƎ
Joined
Aug 10, 2010
Messages
1,478
That needs one line only
Code:
sleep 3600 && systemctl poweroff
Yea no shit? Everything here is just one line of code.
And the whole purpose of this very thread was to supply NON CODE solutions.
There are people out there who dont want to glare on a terminal all the time and if you loose the terminal you cannot cancel this anymore, plus there is no feedback in this.
Thanks for this counter productive contribution.

If this man wants a sleep timer then he will get a sleep timer! Its in fact a lovely request.
Chances are that the existing pandora tool still works or just needs minor mods, this isnt something of priority atm tho.
 

TrashyMG

Sarcasm Dispenser
Staff member
Joined
Jan 18, 2010
Messages
10,930
I been meaning to play with coding some system tray applications, a simple sleep timer may just give me a reason to get into it.

edit: or some other use case.
 
Last edited:

Blue Shadow

Very Active Member
Joined
Mar 7, 2016
Messages
180
elw3, Why so agressive? You did not even mention in your original post that you explicitly want no code solutions (wich is strange wording anyway, as every applet will ultimately be code). And it did not even contradict gui solutions, as the mentioned line could easily be bound to a menue app, a zenity script or even just a desktop icon. Although the shutdown command has a builtin timer, which can be interrupted, so this might be a better solution.
 

elw3

ƐʍlƎ
Joined
Aug 10, 2010
Messages
1,478
Non code solutions for users for simple tasks.
You cannot expect that everyone here is that into nerdporn that he enjoys opening a terminal, entering a password and than writing into some dev file to say turn the gps off.
Of course that is easy, of course you can make a keybinding for that.
But every half sane person would be glad to have a simple clickable button instead.
And this thread was meant to provide this buttons.
 

levi

Still fresh, damnit!
Joined
Oct 6, 2008
Messages
13,538
Location
Somewhere off the coast of the EU
Or you should be able to use at. I find I can time things to kick off after midnight on my machines, and it works fine. I do something like 'at 00:30' which opens an interpreter, into which I can type my commands in and end with ctrl+d, which it then runs at the specified time. So you need to do something like:
Code:
at 02:00<enter>
> poweroff<enter>
> ctrl+d

I also turn my computer off after it does some processing. For this I use a while loop and sleep to avoid the system powering down in the brief gap between one set of processing finishing and the next one starting.

First find out if you can watch the process using pgrep:
Code:
pgrep <processname>

If that works (it won't work with something like audacious or deadbeef, but it will if you use mplayer or cvlc to play back stuff from the terminal; those processes fully terminate when they're done), you can do something like:
Code:
while [[ `pgrep mplayer|wc -l` -gt 0 ]]; do while [[ `pgrep mplayer|wc -l` -gt 0 ]]; do sleep 20; done; sleep 10; done; poweroff

Edit: Sorry if this is triggering for you elw3.
 
Last edited:

elw3

ƐʍlƎ
Joined
Aug 10, 2010
Messages
1,478
 

elw3

ƐʍlƎ
Joined
Aug 10, 2010
Messages
1,478
*Twitching intensifies*
How come that those who claim to type all the time fail to read in return?
 

Silent-Hunter

Hardcore Member
Joined
May 29, 2010
Messages
3,337
Also using the terminal is not code, it's running programs. @Blue Shadow is right, it should be trivial to turn these command-line apps into GUI ones with Zenity or some other similar thing.
 

troy

Member
Joined
May 2, 2016
Messages
41
Running scripts is that "simple button", GUI is useless bloat for a good majority of this stuff.
You cannot expect that everyone here is that into nerdporn that he enjoys opening a terminal, entering a password and than writing into some dev file to say turn the gps off.
If you ordered a Pyra 5 years in advance I would hope you're into that nerdporn lmao
 

Silent-Hunter

Hardcore Member
Joined
May 29, 2010
Messages
3,337
Also, users should always expect to have to open the terminal at least every once in a while. Simple commands like these should be in a manual new users can read. That way it won't be a problem.
Post automatically merged:

I will try to make a script for sleep timer that can be run from GUI.
 
Top