Commit 1b9c300e authored by Gabriel Margiani's avatar Gabriel Margiani

added scripts.

parent 5f5c86c9
#!/bin/sh
pkill -SIGRTMIN+7 i3blocks
case $1 in
"disconnected") # id, nr
twmnc -t "Call $2 Terminated" -c "$3"
;;
"calling") # id, nr
twmnc -t "calling $3" -c "id $2"
;;
"incoming") # id, nr
twmnc -t "Incoming call from $3" -c "id $2"
;;
"confirmed") # id, nr
;;
"dtmf") # id, nr, digit
twmnc -t "'$4' dtmf from $3" -c "id $2"
;;
"auto_busy")
twmnc -t "Rejected call from $2" -c "Reason: $3"
;;
"running") # nr, reason
sleep 2s
pkill -SIGRTMIN+7 i3blocks
;;
"shutdown")
sleep 2s
pkill -SIGRTMIN+7 i3blocks
;;
"registration_change") # regStatus, regStatusText
;;
"busyall_toggle") # state (1/0)
;;
"muteall_toggle") # state (1/0)
;;
"reverse_lookup_result") # nr, name
twmnc -t "Found '$2' to be '$3'"
;;
*)
twmnc -t "$1" -c "call $2, $3"
;;
esac
#!/usr/bin/env python3
import feedparser
import sys
import re
if len(sys.argv) != 2 or sys.argv[1] in ("--help", "-h", "-help", "help"):
print("usage: telreverse [phonenumber], looks up the owner of the number on tel.search.ch")
sys.exit(0)
tel=re.sub(r"[\s@\"\\/&?%#><]+", "", sys.argv[1], flags=re.UNICODE)
url = 'http://tel.search.ch/api/?was='
feed = feedparser.parse(url+tel)
if len(feed.entries) >= 1:
print(feed.entries[0].title)
else:
sys.exit(1);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment