file get_updated

This commit is contained in:
2026-06-12 08:05:48 +02:00
parent 84f901a083
commit 71b8cf5ceb
66 changed files with 2916 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/run/current-system/sw/bin/python
import os.path
from datetime import datetime
def get_last_updated():
lock_file = f"{os.path.expanduser('~')}/.dotfiles/flake.lock"
updated = datetime.fromtimestamp(os.path.getmtime(lock_file))
today = datetime.now()
last_updated = (today - updated).days
if last_updated == 1:
print(f'{last_updated} day')
else:
print(f'{last_updated} days')
if __name__ == '__main__':
get_last_updated()