Lets start making the helper gadgets


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 ?
 
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.
 
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.
 
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:
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.
 
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.
 
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:
Louise-Eye-Twitch-Of-Anger-On-Bobs-Burgers.gif
 
*Twitching intensifies*
How come that those who claim to type all the time fail to read in return?
 
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.
 
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
 
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.
 
I think Elw3 has a point. I made my last post before I'd read his first objection to shell scripting. It took me a while to craft all of the code snippets and the thread had moved on by the time I pressed submit. Sure he's said earlier perhaps in the OP that he wanted GUI tools, but the thread had moved on to the point where shell scripting examples were being posted when I started writing that post, and I was following on from that. In the context of Elw3's desires, these scripts can be tied to zenity buttons or python code or anything else to be honest, as @Silent-Hunter says, but I didn't write it explicitly to be used that way, and I wasn't thinking it at the time, so his criticism of me has some value in my opinion.
 
Last edited:
Back
Top