various fixes and migration to python

This commit is contained in:
Sheppy
2017-02-24 23:03:35 +01:00
parent 61d9ea1fc7
commit a8f64b3229
5 changed files with 97 additions and 16 deletions

View File

@@ -5,6 +5,9 @@ import subprocess
import shlex
import re
def hlpath(addition=""):
return os.path.join(os.path.expanduser("~"),".config/herbstluftwm/"+addition)
def color_remove(s):
'''removes colorcodes from inputstring'''
return re.compile(r'(\x9B|\x1B\[)[0-?]*[ -\/]*[@-~]').sub('',s)
@@ -14,7 +17,11 @@ def shexec(s):
def is_cip():
u = os.uname()
return "cip" in u.release or "faui" in u.name or "ircbox" in u.name
return "cip" in u.release or "faui" in u.nodename or "ircbox" in u.nodename
def is_laptop():
u = os.uname()
return "laptop" in u.nodename or "atlantismedion" in u.nodename
def error(s):
with open("herbstlog",'a') as f: