From 4daea09095fa44dcfc25813a707d34e2a27d5ef1 Mon Sep 17 00:00:00 2001 From: Sheppy Date: Wed, 25 Oct 2017 21:36:03 +0200 Subject: [PATCH] fsad --- herbstluftwm/autostart | 2 +- herbstluftwm/hl_status_deamon.py | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/herbstluftwm/autostart b/herbstluftwm/autostart index 8ae0ecc..8a2e5b2 100755 --- a/herbstluftwm/autostart +++ b/herbstluftwm/autostart @@ -51,7 +51,7 @@ hc spawn ~/.config/herbstluftwm/hl_status_deamon.py # keybindings #client handling -hc keybind $Mod-Shift-q spawn /bin/bash -c "pkill hl_status_deamo & pkill ssh-agent & herbstclient quit" +hc keybind $Mod-Shift-q spawn /bin/bash -c "pkill hl_status_deamo & pkill ssh-agent & ~/.config/other/notify_logout.sh &herbstclient quit" if [[ $HOST =~ atlantis* ]]; then hc keybind $Mod-Shift-p spawn sudo /sbin/poweroff fi diff --git a/herbstluftwm/hl_status_deamon.py b/herbstluftwm/hl_status_deamon.py index 8785fbc..f88083b 100755 --- a/herbstluftwm/hl_status_deamon.py +++ b/herbstluftwm/hl_status_deamon.py @@ -16,17 +16,19 @@ bat_prev = -1 def sigusr1_handler(signum, frame): save() + +def pw(): + pw="NOPE" + try: + with open(hl_utils.hlpath("password.cip",False)) as f: + return f.read().strip("\n") + except: + return "" def cip_logins(): MAX_LOGINS=5 - pw="NOPE" - try: - with open(hl_utils.hlpath("password.cip",False)) as f: - pw=f.read().strip("\n") - except: - return "" - cmd="wget -q -O- --user cip --password "+pw+" 'https://atlantishq.de/cipactive/active_logins'" + cmd="wget -q -O- --user cip --password "+pw()+" 'https://atlantishq.de/cipactive/active_logins'" try: l=hl_utils.shexec(cmd).split("\n") except: @@ -177,9 +179,9 @@ def save(): trace_login() def trace_login(): - if hl_utils.is_cip(): + if hl_utils.is_cip() or True: try: - tmp = hl_utils.shexec("wget --timeout=3 -O- --quiet 'https://atlantishq.de/ciplog/"+socket.gethostname()+"&active&"+str(datetime.now())+"'") + tmp = hl_utils.shexec("wget --timeout=3 -O- --user cip --password "+pw()+"--quiet 'https://atlantishq.de/ciplog/"+socket.gethostname()+"&active&"+str(datetime.now())+"'") except: tmp = "Service Unreachable" with open(hl_utils.hlpath("cip_logins.log"),'w') as f: