diff --git a/misc/userscripts/tor_identity b/misc/userscripts/tor_identity index 7eada7fbf..1b0e317ca 100755 --- a/misc/userscripts/tor_identity +++ b/misc/userscripts/tor_identity @@ -38,5 +38,8 @@ password = sys.argv[1] with Controller.from_port(port=9051) as controller: controller.authenticate(password) controller.signal(Signal.NEWNYM) - with open(os.environ['QUTE_FIFO'], 'w') as f: - f.write('message-info "Tor identity changed."') + if os.getenv('QUTE_FIFO'): + with open(os.environ['QUTE_FIFO'], 'w') as f: + f.write('message-info "Tor identity changed."') + else: + print('Tor identity changed.')