From 57a264bbef5f1d301507a2745adeb365228dc95a Mon Sep 17 00:00:00 2001 From: sevi-kun Date: Thu, 5 May 2022 19:50:40 +0200 Subject: [PATCH] Start migration to python --- motd.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 motd.py diff --git a/motd.py b/motd.py new file mode 100755 index 0000000..0b0619d --- /dev/null +++ b/motd.py @@ -0,0 +1,22 @@ +#!/bin/python + +import os + +modpath = os.path.dirname(__file__) +cachefile = "/tmp/waifu.cache" +resolution = 256 +center = True +lolcat = False +unameArg = "-sr" +uptimeArg = "--pretty" +terminal = os.get_terminal_size() +minTermW = 200 +#unameColor = "\033[1;38;5;93m" +#uptimeColor = "\033[1;38;5;99m" + +#print len([name for name in os.listdir(f'{modpath}/waifus') if os.path.isfile(name)]) +DIR=modpath + '/waifus' +print(len([name for name in os.listdir(DIR) if os.path.isfile(os.path.join(DIR, name))])) + +print(modpath) +