-
-
Save mikemcduffie/97bf929032f8112b521c6712a4d7cf19 to your computer and use it in GitHub Desktop.
Revisions
-
valosekj revised this gist
May 11, 2023 . 1 changed file with 15 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,10 +7,18 @@ Below is short manual how to create this shortcut manually. 1. Open terminal (cmd + space --> type `terminal`) 2. Navigate to a directory where you have your code/scripts. For example `~/code` or `/usr/local/bin`: ``` $ cd ~/code ``` or ``` $ cd /usr/local/bin ``` Tip: If such directory does not exist, create it using (`mkdir`). 3. Create a new `sh` script for your selected application you want to run from terminal. In this case, e.g., Google Chrome. I am using `nano` text editor, so type: ``` $ nano chrome @@ -52,6 +60,12 @@ $ chrome <your_webpage> ``` 7. If command above does not work, make sure that your shell config file (`/etc/zshr`, `/etc/bashrc`, etc.) contains line with update of `$PATH` variable, e.g.: ``` export PATH=$PATH:$HOME/code ``` or ``` export PATH=$PATH:/usr/local/bin ``` -
valosekj revised this gist
Nov 10, 2020 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -36,11 +36,13 @@ Then press ctrl + O for save and ctrl + X for exit `nano` text editor. $ chmod 770 chrome ``` 5. Restart your shell, e.g.: ``` $ source /etc/zshr ``` (Modify command above based on your shell (`bashrc`, `zshr`, `bash_profile`,...) and location of your configuration file(`~` or in `etc`)) (Or simply open new terminal) -
valosekj revised this gist
Nov 10, 2020 . 1 changed file with 2 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -36,16 +36,13 @@ Then press ctrl + O for save and ctrl + X for exit `nano` text editor. $ chmod 770 chrome ``` 5. Restart your shell (based on which config file you use (`bashrc`, `zshr`, `bash_profile`,...); this config can be saved in `~` or in `etc` based on your configuration), e.g.: ``` $ source /etc/zshr ``` (Or simply open new terminal) 6. Voila! Now, you can simply start Google Chrome from terminal using `chrome` command: ``` -
valosekj revised this gist
Nov 9, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -47,7 +47,7 @@ or $ source /etc/bashrc ``` 6. Voila! Now, you can simply start Google Chrome from terminal using `chrome` command: ``` $ chrome <your_webpage> ``` -
valosekj revised this gist
Nov 9, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -36,7 +36,7 @@ Then press ctrl + O for save and ctrl + X for exit `nano` text editor. $ chmod 770 chrome ``` 5. Restart your shell (based on which config file you use (`bashrc`, `zshr`, `bash_profile`,...)), e.g.: ``` $ source /etc/zshr ``` @@ -52,7 +52,7 @@ $ source /etc/bashrc $ chrome <your_webpage> ``` 7. If command above does not work, make sure that your shell config file (`/etc/zshr`, `/etc/bashrc`, etc.) contains line with update of `$PATH` variable, e.g.: ``` export PATH=$PATH:/usr/local/bin ``` -
valosekj revised this gist
Nov 9, 2020 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,11 +9,11 @@ Below is short manual how to create this shortcut manually. 2. Navigate to `/usr/local/bin`: ``` $ cd /usr/local/bin ``` 3. Create a new `sh` script for your selected application you want to run from terminal. In this case, e.g., Google Chrome. I am using `nano` text editor, so type: ``` $ nano chrome ``` Then insert following two lines into your editor: @@ -33,23 +33,23 @@ Then press ctrl + O for save and ctrl + X for exit `nano` text editor. 4. Make your script executable: ``` $ chmod 770 chrome ``` 5. Restart your shell (based on which config file you use (bashrc, zshr, bash_profile,...), e.g.: ``` $ source /etc/zshr ``` or ``` $ source /etc/bashrc ``` 6. Voila! Now, you can run simple run `chrome` command in your terminal. ``` $ chrome <your_webpage> ``` 7. If command above does not work, make sure that your `/etc/zshr` or `/etc/bashrc` file contains line with update of `$PATH` variable, e.g.: -
valosekj revised this gist
Nov 9, 2020 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -53,4 +53,6 @@ chrome <your_webpage> ``` 7. If command above does not work, make sure that your `/etc/zshr` or `/etc/bashrc` file contains line with update of `$PATH` variable, e.g.: ``` export PATH=$PATH:/usr/local/bin ``` -
valosekj revised this gist
Nov 9, 2020 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,6 +26,8 @@ Then insert following two lines into your editor: (Pay attention to spaces in path to your app above. Replace them by `\ `) (`$@` is used for paasing all input arguments from your script to your app) Then press ctrl + O for save and ctrl + X for exit `nano` text editor. @@ -50,3 +52,5 @@ source /etc/bashrc chrome <your_webpage> ``` 7. If command above does not work, make sure that your `/etc/zshr` or `/etc/bashrc` file contains line with update of `$PATH` variable, e.g.: export PATH=$PATH:/usr/local/bin -
valosekj revised this gist
Nov 9, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Run arbitrary application from terminal on MacOS Sometimes, it is convenient to have possibility to start/run any application (like your internet browser or text editor) directly from your terminal. Most of these applications however do not create shortcut for easy run from terminal during their installation. Below is short manual how to create this shortcut manually. ## Steps -
valosekj renamed this gist
Nov 9, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
valosekj created this gist
Nov 9, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ # Run arbitrary application from terminal on MacOS Sometimes, it is convenient to have possibility to start/run any application (like your internet browser or text editor) directly from your terminal. Most of these application however does not create shortcut for easy from terminal during their installation. Below is short manual how to create this shortcut manually. ## Steps 1. Open terminal (cmd + space --> type `terminal`) 2. Navigate to `/usr/local/bin`: ``` cd /usr/local/bin ``` 3. Create a new `sh` script for your selected application you want to run from terminal. In this case, e.g., Google Chrome. I am using `nano` text editor, so type: ``` nano chrome ``` Then insert following two lines into your editor: ``` #!/bin/bash /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome $@ ``` (Pay attention to spaces in path to your app above. Replace them by `\ `) Then press ctrl + O for save and ctrl + X for exit `nano` text editor. 4. Make your script executable: ``` chmod 770 chrome ``` 5. Restart your shell: ``` source /etc/zshr ``` or ``` source /etc/bashrc ``` 6. Voila! Now, you can run simple run `chrome` command in your terminal. ``` chrome <your_webpage> ```