arigit / lastwake.py Goto Github PK
View Code? Open in Web Editor NEWWake/Suspend Time SystemD Journal Analyzer [current boot]
License: GNU General Public License v3.0
Wake/Suspend Time SystemD Journal Analyzer [current boot]
License: GNU General Public License v3.0
chmod +x lastwake.py
./lastwake.py
Hi,
I've added this the Arch Linux User Repository (AUR) here:
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=lastwake-git
I've listed the license as unknown
, since I couldn't find any licenses listed in your repository. Let me know and I will update it.
On Ubuntu 20.04 18.04, I did:
git clone https://github.com/arigit/lastwake.py.git
cd lastwake.py
then:
$ pip3 install -r requirements.txt
Collecting systemd-python (from -r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/e8/a8/00ba0f605837a8f69523e6c3a4fb14675a6430c163f836540129c50b3aef/systemd-python-234.tar.gz (53kB)
100% |████████████████████████████████| 61kB 458kB/s
Complete output from command python setup.py egg_info:
Cannot find libsystemd or libsystemd-journal:
Package libsystemd was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsystemd.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsystemd' found
Package libsystemd-journal was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsystemd-journal.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsystemd-journal' found
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-uktheja8/systemd-python/
And trying to use it:
$ ./lastwake.py
Wake/Sleep Time SystemD Journal Analyzer
Boot under analysis: current boot
Traceback (most recent call last):
File "./lastwake.py", line 92, in <module>
bootTime = j.get_next()['__REALTIME_TIMESTAMP']
KeyError: '__REALTIME_TIMESTAMP'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./lastwake.py", line 94, in <module>
print("\n Warning: no entries in the Journal found for boot: " + bootId + " (script terminated)\n")
TypeError: must be str, not NoneType
Hello, thanks for the useful utility!
In Ubuntu 22.04 (kernel 5.15, systemd 249.11) the sleep wake up message looks like the following:
ACPI: PM: Waking up from system sleep state S3
But this package expects the following string, which worked in Ubuntu 21.10 (kernel 5.13, systemd 248.3):
ACPI: Waking up from system sleep state S3
It's easy to change the match string to make this work, but I can't verify if not including the ACPI:
or PM:
prefix in the match string is fine on all systems.
Traceback (most recent call last):
File "/tmp/lastwake.py/./lastwake.py", line 173, in <module>
secondsSinceLastWakeUp = (end - start).total_seconds()
~~~~^~~~~~~
TypeError: can't subtract offset-naive and offset-aware datetimes
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.