I want netbeans to automatically opens terminal,
maybe run some shell script, watch some files with Compass.
Is this possible and how?
This could be a duplicate of: Run terminal command on startup of netbeans in mac osx
It might be your best solution, just writing a script that runs another script, and then opens Netbeans, or vice versa.
Related
I set LSMultipleInstancesProhibited to YES, but if launch executable file(/Contents/MacOS/) in terminal, the macOS app can be run multiplely. for example: first terminal can run first executable file, second terminal can run second executable file. Please help. Thanks in advance.
You could get the information of your own app and check if there is already running instance in the system.
Programmatically check if a process is running on Mac
I have a C/C++ project which is imported to an eclipse based IDE (STM32CubeIDE) on Win 11.
Inorder to compile the project, I have to enter some commands in git-bash. so for simplicity I wrote them into an .sh which is named build.sh and put it in the project folder, since then I just need to run this bash like this:
source build.sh
in git-bash, and here is its content:
#!/bin/sh
source Q:/stm32.sh
cd Q:/dev/my_project
make build_all
Right now, I want this script to be called, whenever I press the Build button of the IDE.
I found out that for this I have to change the build command from Propertise->C/C++ Build, uncheck the use default build command and then enter the proper command for running the script.
But I could have not do this by now.
I've tried to solve this problem by entering this
${workspace_loc:/${ProjName}/build.sh}
into the build command, which didn't work.
So my question is that what should I enter here to run the build.sh?
Do you know a better solution for my problem?
A little while ago I updated to the newest version of bash on my macbook (all went smoothly there,) and decided to try out the oh-my-bash framework. I had previously used oh-my-zsh, so I was familiar with the installation; however, I'm running into an annoying problem with oh-my-bash.
When I open the terminal the framework doesn't launch automatically. It only launches if I run exec bash in the command line. I've checked in system preferences and bash is set as default, and running bash --version confirms that I am running the correct version of bash when the terminal starts up.
It's more of an inconvenience than anything else, but I'm learning scripting and my burning curiosity wants to find the solution. I'm out of ideas short of a fresh install of the framework; what do you guys think?
My solution is this:
Run this code in terminal
mv $HOME/.bashrc $HOME/bash_profile
Restart your terminal
In linux, bash run command file is .bashrc, but in MacOS is .bash_profile.
I'm trying to launch Blender directly from PyCharm Terminal on Windows. I first use cd 'C:\Program Files\Blender Foundation\Blender 3.1\' to get into the directory containing the executable I need, and this works okay. Then I call blender.exe and expect it to launch Blender executable from the directory I am currently in. But for some reason it launches the older (2.93) version from another folder. The same steps work just right when I do all the same in the Windows cmd.exe. I've thought that the problem could be with the Python interpreter, but I use Python interpreter that goes with Blender 3.1 in the PyCharm project settings. What am I doing wrong and how can I run the exact executable I need?
P.S. I know that I can write a simple script in Python, use subprocess module, and get almost the same result, but anyway I'd like to use the launch from the Terminal if it is possible.
I am distributing a Java program where I want a double-clickable file to run
java -cp MyProgram.jar;MyLib.jar my.program.Main
On Windows I simply distribute a .bat file, for *nix an executable .sh file. Problem is, double-clicking the .sh file just opens it up in a text editor on Mac. What should I do for Mac?
On mac, there is a specific extension for executing shell scripts by double clicking them: this is .command.
For Java applications on Mac, you really should use Apple's Jar Bundler (in the Developer Tools/Applications/Utilities folder; really a symlink to /usr/share/java/Tools/Jar Bundler). It lets you make a proper OS X double-clickable app, including setting preferences for e.g. using the Mac toolbar, JVM version, graphics system, OS X app metadata and classpath/resources.
You can use a .sh (Shell Script), after all MacOSX is Unix!
The answer about using the Jar Bundler tool is correct, but if you want to use a .sh file, make sure the unix permissions are set properly to something like 755 with CHMOD, and make sure the first line contains the path to a shell installed by default on Mac OS X. Also note that even with the +x bit set, it may still ask the user whether they want to open it or run it.