annotate python/window_path.py @ 930:2743f47381e3
default tip
i switched my theme, i guess
| author |
Jeff Hammel <k0scist@gmail.com> |
| date |
Mon, 24 Nov 2025 09:51:55 -0800 |
| parents |
83bc1e6e5b54 |
| children |
|
| rev |
line source |
|
129
|
1 #!/usr/bin/env python
|
|
|
2
|
|
|
3 import os
|
|
|
4 import subprocess
|
|
|
5 import sys
|
|
|
6 import window_title
|
|
|
7
|
|
|
8 def main(filename):
|
|
|
9 title = window_title.active_window_title()
|
|
|
10 path = os.path.expanduser(title)
|
|
|
11 if not os.path.exists(path):
|
|
|
12 return
|
|
|
13 path = os.path.abspath(path)
|
|
|
14 return os.path.join(path, filename)
|
|
|
15
|
|
|
16 if __name__ == '__main__':
|
|
|
17 print main(sys.stdin.read().strip())
|