Coder Social home page Coder Social logo

lastwake.py's People

Contributors

arigit avatar bebehei avatar electricrcaircraftguy avatar f0rki avatar oliverpool avatar stunkymonkey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lastwake.py's Issues

Can't install or use 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

Sleep wake up detection in Ubuntu 22.04 Jammy

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.

After upgrading to Debian 12, script stops working

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.