forked from kunsi/dotfiles
i3pystatus: make travelynx url configurable to user
This commit is contained in:
parent
cd6ada85d9
commit
e486f477bb
1 changed files with 6 additions and 1 deletions
|
@ -8,6 +8,10 @@ from sys import argv, exit
|
||||||
LINK_MODE = False
|
LINK_MODE = False
|
||||||
if len(argv) > 1 and argv[1] == '--link':
|
if len(argv) > 1 and argv[1] == '--link':
|
||||||
LINK_MODE = True
|
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
|
# bundlewrap.utils.text.format_duration, but trimmed down
|
||||||
|
@ -49,7 +53,8 @@ try:
|
||||||
ice_status = ice_status_req.json()
|
ice_status = ice_status_req.json()
|
||||||
|
|
||||||
if LINK_MODE:
|
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['stopInfo']['actualLast'],
|
||||||
trip_info['trainType'],
|
trip_info['trainType'],
|
||||||
trip_info['vzn'],
|
trip_info['vzn'],
|
||||||
|
|
Loading…
Reference in a new issue