mirror of
https://github.com/FAUSheppy/config
synced 2025-12-06 23:21:34 +01:00
added irc hightlight support
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
import hl_utils
|
import hl_utils
|
||||||
|
import string
|
||||||
|
|
||||||
sep = " | "
|
sep = " | "
|
||||||
|
|
||||||
@@ -74,13 +75,20 @@ def battery():
|
|||||||
return ""
|
return ""
|
||||||
|
|
||||||
def irc():
|
def irc():
|
||||||
|
if hl_utils.is_cip():
|
||||||
|
ret_string = "IRC ERROR"
|
||||||
try:
|
try:
|
||||||
fname = hl_utils.hlpath("irc.log")
|
fname = hl_utils.hlpath("irc.log")
|
||||||
tmp = "error"
|
tmp = []
|
||||||
with open(fname) as f:
|
with open(fname) as f:
|
||||||
pass
|
for l in f:
|
||||||
#handle pipe
|
tmp+=[l]
|
||||||
return color_panel(PM,RED)
|
if len(tmp) == 0:
|
||||||
|
return ""
|
||||||
|
msg = " ".join(tmp[-1].split(" ")[2:])[:50]
|
||||||
|
user = tmp[-1].split(" ")[1][:15]
|
||||||
|
ret_string = "MSG FROM: "+user+"-> "+msg.rstrip('\n')+" - [ "+str(len(tmp))+" total ]"
|
||||||
|
return color_panel(ret_string,RED)
|
||||||
except(IOError):
|
except(IOError):
|
||||||
return ""
|
return ""
|
||||||
print(guthaben(),battery())
|
print(irc(),guthaben(),battery())
|
||||||
|
|||||||
Reference in New Issue
Block a user