2018-11-26 23:01:42 +03:00
|
|
|
#!/usr/bin/python
|
|
|
|
#
|
|
|
|
# Put this in your ~/.Xdefaults:
|
|
|
|
#
|
|
|
|
# URxvt.perl-ext-common: default,matcher
|
|
|
|
# URxvt.url-launcher: /home/dabreegster/abstreet/clickable_links.py
|
|
|
|
# URxvt.matcher.button: 1
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
|
|
|
arg = sys.argv[1]
|
|
|
|
if arg.startswith('http://most/'):
|
2018-11-27 03:04:15 +03:00
|
|
|
os.execvp('urxvt', ['urxvt', '-e', 'sh', '-c', 'most ' + arg[len('http://most/'):]])
|
2018-12-10 00:08:17 +03:00
|
|
|
if arg.startswith('http://tail/'):
|
|
|
|
os.execvp('urxvt', ['urxvt', '-e', 'sh', '-c', 'tail -f ' + arg[len('http://tail/'):]])
|
2018-11-26 23:01:42 +03:00
|
|
|
elif arg.startswith('http://ui/'):
|
2019-09-07 23:09:09 +03:00
|
|
|
os.execvp('urxvt', ['urxvt', '-e', 'sh', '-c', 'cd ~/abstreet/game; cargo run ' + arg[len('http://ui/'):]])
|
2018-11-26 23:01:42 +03:00
|
|
|
else:
|
|
|
|
os.execvp('xdg-open', ['xdg-open', arg])
|