diff --git a/apps/show-toasts.krk b/apps/show-toasts.krk new file mode 100644 index 00000000..38365329 --- /dev/null +++ b/apps/show-toasts.krk @@ -0,0 +1,44 @@ +#!/bin/kuroko +import kuroko +import os +import fileio +import time + +time.sleep(2) + +try: + let meminfo = {} + + let data + with fileio.open('/proc/meminfo','r') as f: + data = f.readlines() + + for line in data: + if not ':' in line: continue + let bits = line.strip().split(':',1) + meminfo[bits[0].strip()] = bits[1].strip() + + if 'MemTotal' in meminfo: + let kB = int(meminfo['MemTotal']) + if kB < 1000000: + let sock = os.open("/dev/pex/toast",os.O_WRONLY) + let msg = '{"icon":"/usr/share/icons/48/help.png","body":"Low System Memory
At least 1GiB of RAM is
recommended for the Live CD.
' + str(kB//1024) + 'MiB was detected."}' + os.write(sock,msg.encode()) + +try: + let manifest + with fileio.open('/var/msk/manifest','r') as f: + manifest = f.readlines() + + let count = 0 + + for line in manifest: + if line.startswith('['): + count++ + + if count: + let sock = os.open("/dev/pex/toast",os.O_WRONLY) + let msg = '{"icon":"/usr/share/icons/48/package.png","body":"Packages Available
' + str(count) + ' package' + ('s' if count > 1 else '') + ' are available from
the package repository."}' + os.write(sock,msg.encode()) + +return 0 diff --git a/base/home/local/.yutanirc b/base/home/local/.yutanirc index 3a750aa9..c3b1b0d2 100755 --- a/base/home/local/.yutanirc +++ b/base/home/local/.yutanirc @@ -6,4 +6,5 @@ file-browser --wallpaper & toastd --really # Daemonizes cd ~ if not stat -q ~/.tutorial-shown then show-tutorial.sh +show-toasts.krk & exec panel --really