nicOS-PowerTimeout

Moderator: Forum moderators

User avatar
amethyst
Posts: 2355
Joined: Tue Dec 22, 2020 6:35 am
Has thanked: 55 times
Been thanked: 473 times

nicOS-PowerTimeout

Post by amethyst »

Deleted. Leaving the forum.

Last edited by amethyst on Mon Apr 22, 2024 9:09 am, edited 40 times in total.
User avatar
amethyst
Posts: 2355
Joined: Tue Dec 22, 2020 6:35 am
Has thanked: 55 times
Been thanked: 473 times

Re: PowerTimeout

Post by amethyst »

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

User avatar
amethyst
Posts: 2355
Joined: Tue Dec 22, 2020 6:35 am
Has thanked: 55 times
Been thanked: 473 times

Re: nicOS-PowerTimeout

Post 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.

User avatar
bigpup
Moderator
Posts: 6271
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 732 times
Been thanked: 1292 times

Re: nicOS-PowerTimeout

Post by bigpup »

Thanks for this!

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

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
amethyst
Posts: 2355
Joined: Tue Dec 22, 2020 6:35 am
Has thanked: 55 times
Been thanked: 473 times

Re: nicOS-PowerTimeout

Post 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.

User avatar
rockedge
Site Admin
Posts: 5719
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 1997 times
Been thanked: 2099 times
Contact:

Re: nicOS-PowerTimeout

Post 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 4134 times
Screenshot(68)-600.png
Screenshot(68)-600.png (246 KiB) Viewed 4134 times
User avatar
bigpup
Moderator
Posts: 6271
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 732 times
Been thanked: 1292 times

Re: nicOS-PowerTimeout

Post 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.

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
amethyst
Posts: 2355
Joined: Tue Dec 22, 2020 6:35 am
Has thanked: 55 times
Been thanked: 473 times

Re: nicOS-PowerTimeout

Post 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.

User avatar
bigpup
Moderator
Posts: 6271
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 732 times
Been thanked: 1292 times

Re: nicOS-PowerTimeout

Post 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!

Last edited by bigpup on Fri Mar 19, 2021 6:18 am, edited 1 time in total.

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
amethyst
Posts: 2355
Joined: Tue Dec 22, 2020 6:35 am
Has thanked: 55 times
Been thanked: 473 times

Re: nicOS-PowerTimeout

Post 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.

User avatar
rockedge
Site Admin
Posts: 5719
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 1997 times
Been thanked: 2099 times
Contact:

Re: nicOS-PowerTimeout

Post 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.

User avatar
amethyst
Posts: 2355
Joined: Tue Dec 22, 2020 6:35 am
Has thanked: 55 times
Been thanked: 473 times

Re: nicOS-PowerTimeout

Post 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:

User avatar
bigpup
Moderator
Posts: 6271
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 732 times
Been thanked: 1292 times

Re: nicOS-PowerTimeout

Post by bigpup »

Working in my high security programing underground layer.

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

.
The NicOS-PowerTimeout pet package

nicOS-PowerTimeout.pet
(4.61 KiB) Downloaded 65 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 1868 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:

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
amethyst
Posts: 2355
Joined: Tue Dec 22, 2020 6:35 am
Has thanked: 55 times
Been thanked: 473 times

Re: nicOS-PowerTimeout

Post 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:

User avatar
bigpup
Moderator
Posts: 6271
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 732 times
Been thanked: 1292 times

Re: nicOS-PowerTimeout

Post 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 1848 times

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
amethyst
Posts: 2355
Joined: Tue Dec 22, 2020 6:35 am
Has thanked: 55 times
Been thanked: 473 times

Re: nicOS-PowerTimeout

Post by amethyst »

Get your text to line up, it looks messy.

User avatar
bigpup
Moderator
Posts: 6271
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 732 times
Been thanked: 1292 times

Re: nicOS-PowerTimeout

Post 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.

Last edited by bigpup on Sat Mar 20, 2021 1:39 pm, edited 1 time in total.

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
bigpup
Moderator
Posts: 6271
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 732 times
Been thanked: 1292 times

Re: nicOS-PowerTimeout

Post 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.

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
amethyst
Posts: 2355
Joined: Tue Dec 22, 2020 6:35 am
Has thanked: 55 times
Been thanked: 473 times

Re: nicOS-PowerTimeout

Post 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.

User avatar
amethyst
Posts: 2355
Joined: Tue Dec 22, 2020 6:35 am
Has thanked: 55 times
Been thanked: 473 times

Re: nicOS-PowerTimeout

Post 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.

User avatar
bigpup
Moderator
Posts: 6271
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 732 times
Been thanked: 1292 times

Re: nicOS-PowerTimeout

Post 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.

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
amethyst
Posts: 2355
Joined: Tue Dec 22, 2020 6:35 am
Has thanked: 55 times
Been thanked: 473 times

Re: nicOS-PowerTimeout

Post 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.

User avatar
amethyst
Posts: 2355
Joined: Tue Dec 22, 2020 6:35 am
Has thanked: 55 times
Been thanked: 473 times

Re: nicOS-PowerTimeout

Post by amethyst »

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

User avatar
amethyst
Posts: 2355
Joined: Tue Dec 22, 2020 6:35 am
Has thanked: 55 times
Been thanked: 473 times

Re: nicOS-PowerTimeout

Post by amethyst »

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

User avatar
greengeek
Posts: 1200
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 340 times
Been thanked: 145 times

Re: nicOS-PowerTimeout

Post 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 1994 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
User avatar
amethyst
Posts: 2355
Joined: Tue Dec 22, 2020 6:35 am
Has thanked: 55 times
Been thanked: 473 times

Re: nicOS-PowerTimeout

Post 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.

HerrBert
Posts: 329
Joined: Mon Jul 13, 2020 6:14 pm
Location: Germany, NRW
Has thanked: 17 times
Been thanked: 110 times

Re: nicOS-PowerTimeout

Post 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...)

User avatar
amethyst
Posts: 2355
Joined: Tue Dec 22, 2020 6:35 am
Has thanked: 55 times
Been thanked: 473 times

Re: nicOS-PowerTimeout

Post 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.

HerrBert
Posts: 329
Joined: Mon Jul 13, 2020 6:14 pm
Location: Germany, NRW
Has thanked: 17 times
Been thanked: 110 times

Re: nicOS-PowerTimeout

Post 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

User avatar
amethyst
Posts: 2355
Joined: Tue Dec 22, 2020 6:35 am
Has thanked: 55 times
Been thanked: 473 times

Re: nicOS-PowerTimeout

Post 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)......

Post Reply

Return to “System”