Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Paste
P384
Terminator plugin
Active
Public
Actions
Authored by
Duranzed
on Mon, Feb 23, 16:11.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F24497302: Terminator plugin
Mon, Feb 23, 16:11
2026-02-23 16:11:56 (UTC+0)
Subscribers
Duranzed
User-Duranzed
from
terminatorlib.plugin
import
URLHandler
import
subprocess
import
os
AVAILABLE
=
[
'ResolveHashURLHandler'
]
class
ResolveHashURLHandler
(
URLHandler
):
capabilities
=
[
'url_handler'
]
handler_name
=
'resolve_hash'
name
=
'Nasqueron Resolve Hash'
# REGEX to detect hashes
match
=
r'\b[0-9a-f]{7,40}\b'
def
callback
(
self
,
url
):
hash_value
=
url
.
strip
()
try
:
#We define the path to resolve-hash module
script_path
=
os
.
path
.
expanduser
(
"~/bin/resolve-hash"
)
result
=
subprocess
.
check_output
(
[
script_path
,
hash_value
],
stderr
=
subprocess
.
STDOUT
,
text
=
True
)
#We clean the result
final_url
=
result
.
strip
()
# Terminator only opens a navigator is the URL is correct
if
final_url
.
startswith
(
'http'
):
return
final_url
except
Exception
as
e
:
#if error we return none for terminator to ignore the clic
return
None
return
None
Event Timeline
Duranzed
created this paste.
Mon, Feb 23, 16:11
2026-02-23 16:11:56 (UTC+0)
Duranzed
mentioned this in
T1695: Write a Terminator plugin to resolve hashes
.
Log In to Comment