Last active
October 24, 2016 01:48
-
-
Save justbuchanan/0b7ef521049bfd38b8ee9ed67aeacc38 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[test] | |
command=$SCRIPT_DIR/test.py | |
interval=persist | |
signal=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import signal | |
import time | |
import sys | |
# call reload() when RTMIN+1 signal is received | |
def reload(sig, hdl): | |
print('reload') | |
sys.stdout.flush() | |
with open('signallog', 'w') as f: | |
f.write("received signal 1") | |
signal.signal(signal.SIGRTMIN+1, reload) | |
# wait | |
while True: | |
time.sleep(10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
SCRIPT_DIR=$(pwd) i3blocks -c config -vv > blocklog 2>&1 & | |
pkill -RTMIN+1 -f 'i3blocks -c config -vv' | |
sleep 5 | |
$EDITOR blocklog |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment