deragon / autopoweroff

Manage automatic poweroff and other actions (suspend / custom) when specific conditions are reunited.
GNU General Public License v2.0
52 stars 7 forks source link

This fixes the problem with KVM problem. When you switch keyboads #13

Closed rac8006 closed 3 years ago

rac8006 commented 4 years ago

autopoweroff the threads that monitor keyboard and mouse activity terminate. When the keyboard or mouse is removed from the PC. When the keyboard and mouse is switched back the /dev/input/mouse1 file is created. So instead of terminating the thread we close the file wait for the /dev/input/mouse1 file which indicates the device have returned. So reopen the file and go back to monitoring for activity.

deragon commented 3 years ago

Greetings. In Autopoweroff 4.0.0, I have, I believe, fixed this. Please confirm in the related issue. The code in this pull request is not compatible anymore with the base code. But thanks for working with me! I really appreciated it.

rac8006 commented 3 years ago

I will try to test you code tomorrow. I think I can just cd / tar -zxf autopoweroff-4.0.0.0.gz file to install your code.

I tried to install your source and build a .deb file. But had trouble. No matter what I did I could not get it to create the packages/deb stuff.

Here is the code that I used to setup systemd.

command to start systemctl start autopoweroff command to stop systemctl stop autopoweroff

new directory /etc/systemy/system/multi-user.target.wants Filename = autopoweroff.service located in the new directory With the following contents.

[Unit] Description=autopoweroff daemon After=network.target

[Service] Type=simple User=root NotifyAccess=all PIDFile=/var/run/autopoweroffd/autopoweroffd.pid ExecStart=/usr/sbin/autopoweroffd start RemainAfterExit=true ExecStop=/usr/sbin/autopoweroffd stop ExecReload=/usr/sbin/autopoweroffd reload

[Install] WantedBy=multi-user.target

Sent from Mail for Windows 10

From: Hans Deragon Sent: Thursday, March 11, 2021 10:45 AM To: deragon/autopoweroff Cc: rac8006; Author Subject: Re: [deragon/autopoweroff] This fixes the problem with KVM problem. When you switch keyboads (#13)

Greetings. In Autopoweroff 4.0.0, I have, I believe, fixed this. Please confirm in the related issue. The code in this pull request is not compatible anymore with the base code. But thanks for working with me! I really appreciated it. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

-- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

deragon commented 3 years ago

You do not have to build yourself the binaries. .deb and .rpm are available for each release. The latest one can be found at: Release 4.0.0.

I quickly tried your recipe for systemd but it did not work. Obviously, something is missing. One day, I will work on systemd. Thank you!

rac8006 commented 3 years ago

Not sure if this is the problem. But the autopoweroff.service file is also in /etc/system/system directory.
Yes I don’t need to build the to test. But I do need to build if I want to fold my disk activity stuff

Sent from Mail for Windows 10

From: Hans Deragon Sent: Saturday, March 13, 2021 10:48 AM To: deragon/autopoweroff Cc: rac8006; Author Subject: Re: [deragon/autopoweroff] This fixes the problem with KVM problem. When you switch keyboads (#13)

You do not have to build yourself the binaries. .deb and .rpm are available for each release. The latest one can be found at: Release 4.0.0. I quickly tried your recipe for systemd but it did not work. Obviously, something is missing. One day, I will work on systemd. Thank you! — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

-- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus