Skip to content

Instantly share code, notes, and snippets.

@r2dev2
Created September 25, 2020 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r2dev2/ab47be1f5977caa59990a7c568cdf7ce to your computer and use it in GitHub Desktop.
Save r2dev2/ab47be1f5977caa59990a7c568cdf7ce to your computer and use it in GitHub Desktop.
This is my bash script for WSL2 for retrieving saved zoom links from a json. It opens the zoom link in firefox.
#!/bin/bash
hjelp="
Zoom link helper program\n
\n
Usage:\n
\t./zoomselector.bash class\n
\n
Subcommands:\n
\tinit:\n
\t\tInstalls dependencies\n
\tprint:\n
\t\tPrints all zoom classes\n
"
case $1 in
print)
cat ~/zooms.json | jq
;;
init)
echo Installing jq
sudo apt install jq
echo Please fill out ~/zooms.json with class: zoom link
;;
"")
echo Please provide a first argument, see --help
;;
-h|--help|help)
echo $hjelp | sed 's/\\n/\n/g' | sed 's/\\t/\t/g'
;;
*)
url=$(jq .$1 ~/zooms.json | sed 's/"//g')
printf "\033[1;35m%s\033[0m\n" $url
printf $url | powershell.exe -c clip
powershell.exe -c "& \"C:\\Program Files\\Mozilla Firefox\\firefox.exe\" $url"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment