added pracct deamon

This commit is contained in:
Sheppy
2017-02-24 16:55:07 +01:00
parent ff74c8b72d
commit 2916f38011
3 changed files with 32 additions and 0 deletions

View File

@@ -1,6 +1,20 @@
import datetime
import sys
import os
import subprocess
import shlex
import re
def color_remove(s):
'''removes colorcodes from inputstring'''
return re.compile(r'(\x9B|\x1B\[)[0-?]*[ -\/]*[@-~]').sub('',s)
def shexec(s):
return subprocess.check_output(shlex.split(s)).decode()
def is_cip():
u = os.uname()
return "cip" in u.release or "faui" in u.name or "ircbox" in u.name
def error(s):
with open("herbstlog",'a') as f: