Page 1 of 2

nicOS-PowerTimeout

Posted: Sun Feb 14, 2021 6:35 am
by amethyst

Deleted. Leaving the forum.


Re: PowerTimeout

Posted: Mon Feb 15, 2021 8:17 am
by amethyst

Released nicOS-PowerTimeout script. Completely new script, should now work on all modern Puppys (Precise upwards). Attached to first post.


Re: nicOS-PowerTimeout

Posted: Thu Mar 18, 2021 8:58 am
by amethyst

I've made some changes to the lay-out (looks better to me), added 4 hour time-setting, etc. See first post for new download.


Re: nicOS-PowerTimeout

Posted: Thu Mar 18, 2021 2:48 pm
by bigpup

Thanks for this!

It is small enough that you could package it as a pet package -- and attach the pet.


Re: nicOS-PowerTimeout

Posted: Thu Mar 18, 2021 5:09 pm
by amethyst
bigpup wrote: Thu Mar 18, 2021 2:48 pm

Thanks for this!

It is small enough, that you could package it as a pet package, and attach the pet.

I suggest users create a quick-launch button for the script in the bottom tray. Works well for me like that (for instance, I use suspend to RAM immediately, regularly). This is a powertool and the idea is to run this application as quickly as possible. Running from menu requires an extra step for the user so I'm not going to make a pet. Users are free to make a menu entry themselves or a pet and install it if they so wish.


Re: nicOS-PowerTimeout

Posted: Thu Mar 18, 2021 5:42 pm
by rockedge
amethyst wrote:

suggest users create a quick-launch button for the script in the bottom tray

great idea! I also have added it to my xlunch menu like this

Screenshot(69).png
Screenshot(69).png (237.42 KiB) Viewed 6182 times
Screenshot(68)-600.png
Screenshot(68)-600.png (246 KiB) Viewed 6182 times

Re: nicOS-PowerTimeout

Posted: Thu Mar 18, 2021 8:22 pm
by bigpup

I suggest users create a quick-launch button for the script in the bottom tray.

All of that is good for you people.
Now give a new Puppy user some love and tell them how to do it.
I am not exactly sure how to do it :shock: :oops:

Running from menu requires an extra step for the user so I'm not going to make a pet

A pet package can do more than just install and make a menu entry.
Whatever you are doing to make a launch button in the tray, can be in the pet.
The pet could be made to do an install and only make the tray quick launch button.


Re: nicOS-PowerTimeout

Posted: Thu Mar 18, 2021 10:56 pm
by amethyst

bigpup - I leave it up to you to create a pet for this application which includes a launch button which will work for all Puppys and different windows managers. Go for it.


Re: nicOS-PowerTimeout

Posted: Fri Mar 19, 2021 5:42 am
by bigpup

It is your program and code.
I am not going to take it over and try to make it my code!
You are the one that wants it to have a tray quick-launch button, not me.
But that does seem to be a good feature the program could have.

I am happy using it as a desktop icon or a menu entry.
That would be my version of your program, not yours.
I do not do that to people, that offer stuff for Puppy.
It is your code and how you want to offer it!!!

I am only offering an idea you can choose to use or not use!


Re: nicOS-PowerTimeout

Posted: Fri Mar 19, 2021 6:00 am
by amethyst
bigpup wrote: Fri Mar 19, 2021 5:42 am

It is your program and code.
I am not going to take it over and try to make it my code!
You are the one that wants it to have a tray quick-launch button, not me.

I am happy using it as a desktop icon or a menu entry.
That would be my version of your program, not yours.
I do not do that to people, that offer stuff for Puppy.
It is your code and how you want to offer it!!!

I am only offering an idea you can choose to use or not use!

A launch button, is a strong user SUGGESTION. Adding a launch button has NOTHING to do with the actual code of the application so you are NOT changing any code. The point is that it's not an easy thing (well near impossible) to add a launch button (code for) to a package to cater for all Puppy's, different windows managers, every user setup. That is something the user will have to do himself.


Re: nicOS-PowerTimeout

Posted: Fri Mar 19, 2021 12:28 pm
by rockedge

@bigpup If you want to go ahead and give this go, I and others can help with some guidance.

Once you've finished making your PET and it works you will be on your way to "User & Developer"....... and you'll feel great and flowing with ideas. This a usual side effect.


Re: nicOS-PowerTimeout

Posted: Fri Mar 19, 2021 1:19 pm
by amethyst
rockedge wrote: Fri Mar 19, 2021 12:28 pm

@bigpup If you want to go ahead and give this go, I and others can help with some guidance.

Once you've finished making your PET and it works you will be on your way to "User & Developer"....... and you'll feel great and flowing with ideas. This a usual side effect.

:thumbup: :thumbup: :thumbup:


Re: nicOS-PowerTimeout

Posted: Sat Mar 20, 2021 4:09 am
by bigpup

Working in my high security programing underground layer.

bulldog.jpg
bulldog.jpg (13.67 KiB) Viewed 3934 times

.
The NicOS-PowerTimeout pet package

nicOS-PowerTimeout.pet
(4.61 KiB) Downloaded 132 times

.
menu entry will be in menu->System
.
Tray quick launch button
In JWM Window Manager
To have a quick launch button in the desktop tray.
Open this file in a text editor:
/root/.jwmrc-tray (hidden file)
Add this entry to the tray button entries:
<TrayButton popup="Power Timeout" icon="/usr/share/nicOS-PowerTimeout/nicOS.png">exec:/usr/share/nicOS-PowerTimeout/nicOS-PowerTimeout</TrayButton>
.

Screenshot.jpg
Screenshot.jpg (3.92 KiB) Viewed 3932 times

.
Note:
In Fossapup64 9.5
JWMDesk Manager->Launch Tab
This can be used to add a quick launch button to the tray.
.
Hit me, with what I did wrong or maybe would be better, for the pet :) :thumbup: :idea:
Look at that picture!
Do you really want to get this person mad at you? :lol: :ugeek:


Re: nicOS-PowerTimeout

Posted: Sat Mar 20, 2021 6:10 am
by amethyst

:thumbup: Now, that wasn't too difficult, was it? Not a bad effort at all. Just an observation - you've duplicated the icon file. Personally I would have just placed the script in /usr/sbin and not created the application folder, and used /usr/local/lib/X11/pixmaps for the icon. In addition, a nice doc file for the application where you explain the purpose, etc. of the application and perhaps include the How TO create a quick launch button when using JMW and the other windows managers. There used to be a JWW Configuration Manager which you could use to add the launch button (don't know if it's still there for newer Puppy's). Anyways, hope this effort has inspired you to perhaps try your hand at some coding and produce some applications. :thumbup2:


Re: nicOS-PowerTimeout

Posted: Sat Mar 20, 2021 12:26 pm
by bigpup

a nice doc file for the application where you explain the purpose, etc. of the application and perhaps include the How TO create a quick launch button when using JMW and the other windows managers.

Well you do have the help button in the programs main window.

Here we go changing your code.
Example of what you could add to the help.
.

Screenshot(1).png
Screenshot(1).png (54.5 KiB) Viewed 3912 times

Re: nicOS-PowerTimeout

Posted: Sat Mar 20, 2021 1:17 pm
by amethyst

Get your text to line up, it looks messy.


Re: nicOS-PowerTimeout

Posted: Sat Mar 20, 2021 1:27 pm
by bigpup

I would have just placed the script in /usr/sbin and not created the application folder,

I was going to do that, but I was trying a different way to do it.
.

and used /usr/local/lib/X11/pixmaps for the icon.

That icon directory gets changed, when you select a different desktop, icon theme.
All the icons are replaced, by the ones in the theme.
True, the nicOS.png icon would probably still be there, because no icon theme is going to change it.

I thought /usr/share/icons was the specific location for icons in Linux?
Other programs you install seem to use it.
I think other window managers may also use this location to find icons.

The icon in the nicOS-PowerTimeout directory is a backup.
But also being used for the active icon in the .desktop file.
I guess my choice for that.


Re: nicOS-PowerTimeout

Posted: Sat Mar 20, 2021 1:31 pm
by bigpup
amethyst wrote: Sat Mar 20, 2021 1:17 pm

Get your text to line up, it looks messy.

That is my writing style for information.

I am not really seeing what you are saying about looking messy.
The text looks lined up in the image I posted.


Re: nicOS-PowerTimeout

Posted: Sat Mar 20, 2021 1:33 pm
by amethyst

As for the Help file, it seems a bit "heavv" (too much other information) not really relevant to the actual running of the application. So for me, I would make a doc file to give all the extra juicy detail.


Re: nicOS-PowerTimeout

Posted: Sat Mar 20, 2021 1:36 pm
by amethyst
bigpup wrote: Sat Mar 20, 2021 1:31 pm
amethyst wrote: Sat Mar 20, 2021 1:17 pm

Get your text to line up, it looks messy.

That is my writing style for information.

I am not really seeing what you are saying about looking messy.
The text looks lined up in the image I posted.

It's not wrapping correctly. There are HUGE OPEN SPACES WITHIN SENTENCES. Looks untidy.


Re: nicOS-PowerTimeout

Posted: Sat Mar 20, 2021 1:59 pm
by bigpup

OK.
It is just an example, of what you could add, to the help.
I did not spend a lot of time, tweaking it.
Anyway, it is up to you to make any changes, to the help.
Again, I am not going to change, your code.
Only offer ideas, you can use or not use.

I have never felt a programs help had too much info.
But, I sure have seen some, that have too little info :thumbdown:
Plus, that help button is in your face.
Click help, to find out needed, information.


Re: nicOS-PowerTimeout

Posted: Sat Mar 20, 2021 2:07 pm
by amethyst

You want your help section (button) of the application to focus on the functionality (how to use instructions) of the application. Providing other (too much) information could confuse users. Best to make a nice document (read me) of the additional information.


Re: nicOS-PowerTimeout

Posted: Sun Feb 27, 2022 7:08 pm
by amethyst

Made a .pet for this utility instead. Attached to first post.


Re: nicOS-PowerTimeout

Posted: Wed Apr 27, 2022 6:34 am
by amethyst

See first post for some user tips using the Run Video "ScreenSaver" feature.


Re: nicOS-PowerTimeout

Posted: Mon May 02, 2022 1:25 am
by greengeek

Wanting to use the RunVideo function but have not succeeded in getting the timeout to trigger.

So far have modified the RunVideo script to run vlc (on desktop 2) as follows:

Code: Select all

#!/bin/sh
xdotool key alt+2
exec /usr/bin/cvlc --fullscreen --volume=50 /root/testvideo.mp4

(this works fine when i manually use it in the cli)

and have set the 5 minute timeout and "runvideo" as shown below - but nothing happens after 5 minutes of inactivity.

Any thoughts what I can check?

settings.jpg
settings.jpg (20.67 KiB) Viewed 4089 times

xset -q contains the following info which seems to suggest that my dpms is off and screensaver set to 120 (Does that seem right? Or is the power timeout utility not using those?)

Code: Select all

Screen Saver:
  prefer blanking:  no    allow exposures:  no
  timeout:  120    cycle:  600
Colors:
  default colormap:  0x22    BlackPixel:  0x0    WhitePixel:  0xffffff
Font Path:
  /usr/share/X11/fonts/misc/,/usr/share/X11/fonts/TTF/,built-ins
DPMS (Energy Star):
  Standby: 600    Suspend: 600    Off: 600
  DPMS is Disabled

Re: nicOS-PowerTimeout

Posted: Mon May 02, 2022 6:01 am
by amethyst
greengeek wrote: Mon May 02, 2022 1:25 am

Wanting to use the RunVideo function but have not succeeded in getting the timeout to trigger.

So far have modified the RunVideo script to run vlc (on desktop 2) as follows:

Code: Select all

#!/bin/sh
xdotool key alt+2
exec /usr/bin/cvlc --fullscreen --volume=50 /root/testvideo.mp4

(this works fine when i manually use it in the cli)

and have set the 5 minute timeout and "runvideo" as shown below - but nothing happens after 5 minutes of inactivity.

Any thoughts what I can check?

settings.jpg

xset -q contains the following info which seems to suggest that my dpms is off and screensaver set to 120 (Does that seem right? Or is the power timeout utility not using those?)

Code: Select all

Screen Saver:
  prefer blanking:  no    allow exposures:  no
  timeout:  120    cycle:  600
Colors:
  default colormap:  0x22    BlackPixel:  0x0    WhitePixel:  0xffffff
Font Path:
  /usr/share/X11/fonts/misc/,/usr/share/X11/fonts/TTF/,built-ins
DPMS (Energy Star):
  Standby: 600    Suspend: 600    Off: 600
  DPMS is Disabled

You need to check the Disable/Reset Timeouts button as well. BTW - Your video(s) can be located at any place. Read the first post, I've added some addidional information later on. Also - I think I uploaded the utility again after making some changes. Just download it again just to make sure you have the latest. The system's "screen saver" (ScreenSaver Control application) is actually a screen blanking application and not a traditional screen saver utility. It uses different mechanisms and is unrelated. I have screen blanking set to 10 minutes and Run Video to 5 minutes. Most video players will suppress screen blanking by default anyway so it doesn't matter if screen blanking is on or off. I use this utility very often because you can toggle between options i.r.o what will happen after a certain amount of mouse inactivity. For instance, I toggle between Suspend to RAM and Run Video quite often (definitely at night when I listen to audiobooks in bed before going to sleep, I want the laptop to suspend or switch off after a period of mouse inactivity instead of playing a video). I change the time settings also quite often (depending how long I want to listen to audiobooks at night for example). This utility does this quickly.


Re: nicOS-PowerTimeout

Posted: Mon May 02, 2022 8:50 am
by HerrBert

When changing POWERTIMEOUT doesn't work (at least on Slacko64 7.0):

If on startup POWERTIMEOUT is not already set to anything other than 0 in /etc/eventmanager, the autoshutdown_daemon will quit instantly.
To start autoshutdown_daemon after making changes you can restart X or you can change the periode of inactivity in Puppy Eventmanager.

Also a running autoshutdown_daemon will not recognize a change in PowerTimeout.
It needs to be restarted with the new setting in /etc/eventmanager or changing the periode of inactivity in Puppy Eventmanager.

Note that Puppy Eventmanager only recognizes a real change. Setting timeout from 5 to 1 will not be a change because eventmanager sets any value between 1 and 5 to it's minimum of 5 again. An unchanged value will not trigger autoshutdown_daemon.

Getting PowerTimeout to work instantly really depends on the pup_event_frontend_d your Puppy uses (and i have seen some...)


Re: nicOS-PowerTimeout

Posted: Mon May 02, 2022 9:54 am
by amethyst
HerrBert wrote: Mon May 02, 2022 8:50 am

When changing POWERTIMEOUT doesn't work (at least on Slacko64 7.0):

If on startup POWERTIMEOUT is not already set to anything other than 0 in /etc/eventmanager, the autoshutdown_daemon will quit instantly.
To start autoshutdown_daemon after making changes you can restart X or you can change the periode of inactivity in Puppy Eventmanager.

Also a running autoshutdown_daemon will not recognize a change in PowerTimeout.
It needs to be restarted with the new setting in /etc/eventmanager or changing the periode of inactivity in Puppy Eventmanager.

Note that Puppy Eventmanager only recognizes a real change. Setting timeout from 5 to 1 will not be a change because eventmanager sets any value between 1 and 5 to it's minimum of 5 again. An unchanged value will not trigger autoshutdown_daemon.

Getting PowerTimeout to work instantly really depends on the pup_event_frontend_d your Puppy uses (and i have seen some...)

Works perfectly for me. The options edits scripts in /usr/local/pup_event/* and /etc/eventmanager. If the relevant scripts to be changed are not at those locations, the utility will not work. If the relevant scripts are totally different from each other in different flavours of Puppy it won't work either. It works on all the Puppy's I have been using (I use 32-bit Ubuntu and Stretch and I guess it will work for the 64-bit branches of these too). I've tested it on Ubuntu based Puppys from Precise right through to Bionic 32 as well as Stretch 7.5 and DpupBuster 32 and 64-bits. Those are all the Puppys I have on my machine. So, if it's not working for ALL Puppy's then tough luck. It is what it is, I can't guess the workings of ALL Puppys, I don't use all of them.


Re: nicOS-PowerTimeout

Posted: Mon May 02, 2022 2:42 pm
by HerrBert

No offense intended. I just wanted to let know why it might not work as expected on some Puppies and what can be done to get it working at least partially.

May be of interest @greengeek


Re: nicOS-PowerTimeout

Posted: Mon May 02, 2022 3:41 pm
by amethyst
HerrBert wrote: Mon May 02, 2022 2:42 pm

No offense intended. I just wanted to let know why it might not work as expected on some Puppies and what can be done to get it working at least partially.

May be of interest @greengeek

As a matter of interest - The command used for shutdown (poweroff) is wmpoweroff and the utility will look for this somewhere in /usr/local/pup_event/*. It will be interesting to know how Slacko 7 differs from other Puppys in this regard. Which command is used for poweroff in Slacko and where is that command located? If it's the same in Slacko 7 the possibility must exist that you did not use my utility correctly (ie. ticking all the correct boxes)......