From e486f477bba5df81146eaefa9be3b9c33c35b767 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sat, 2 Jul 2022 18:30:50 +0200 Subject: [PATCH] i3pystatus: make travelynx url configurable to user --- .config/i3pystatus/ice-status.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.config/i3pystatus/ice-status.py b/.config/i3pystatus/ice-status.py index a99d652..902a805 100755 --- a/.config/i3pystatus/ice-status.py +++ b/.config/i3pystatus/ice-status.py @@ -8,6 +8,10 @@ from sys import argv, exit LINK_MODE = False if len(argv) > 1 and argv[1] == '--link': LINK_MODE = True + if len(argv) > 2: + LINK_TARGET = argv[2] + else: + LINK_TARGET = 'travelynx.franzi.business' # bundlewrap.utils.text.format_duration, but trimmed down @@ -49,7 +53,8 @@ try: ice_status = ice_status_req.json() if LINK_MODE: - check_output(['xdg-open', 'https://travelynx.franzi.business/s/{}?train={}%20{}'.format( + check_output(['xdg-open', 'https://{}/s/{}?train={}%20{}'.format( + LINK_TARGET, trip_info['stopInfo']['actualLast'], trip_info['trainType'], trip_info['vzn'],