Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call from command line #65

Open
korbinian90 opened this issue Aug 6, 2024 · 3 comments
Open

call from command line #65

korbinian90 opened this issue Aug 6, 2024 · 3 comments

Comments

@korbinian90
Copy link
Collaborator

When the pwa is installed via chrome as local app, the following alias makes it work via command line:
alias niivue='/usr/bin/google-chrome --app-id=pgienjkbgeffjnbagkbcacejihclfdeg'
Opening images via
niivue test.nii or niivue test1.nii test2.nii

TODO: create explanation somewhere useful

@korbinian90 korbinian90 changed the title call from command line [solved] call from command line Aug 6, 2024
@korbinian90
Copy link
Collaborator Author

This currently only works with absolute paths

@korbinian90
Copy link
Collaborator Author

korbinian90 commented Aug 6, 2024

#!/bin/bash

filePath=$(realpath "$1")

niivue='/usr/bin/google-chrome --app-id=pgienjkbgeffjnbagkbcacejihclfdeg' "$filePath"

@korbinian90
Copy link
Collaborator Author

korbinian90 commented Aug 8, 2024

New version for multiple input images:

Store this file as niivue under /usr/bin (requires sudo) and run sudo chmod +x+r /usr/bin/niivue to make it executable. Afterwards, the command niivue Image1.nii Image2.nii should work

#!/bin/bash

filePaths=""

for filePath in "$@"; do
  absolutePath=$(realpath "$filePath")
  filePaths="$filePaths \"$absolutePath\""
done

eval /usr/bin/google-chrome --app-id=pgienjkbgeffjnbagkbcacejihclfdeg $filePaths

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant