-
Notifications
You must be signed in to change notification settings - Fork 29
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
macOS application bundle for qStudio.app is available #102
Comments
@ryanhamilton The qStudio "macOS app" seems to be working well for me. I've reported a couple "infelicities" elsewhere, but I'm pretty happy. One fussy comment: The macOS bundle displays the qStudio icon in the dock as desired. But when it launches, macOS swaps the logo for the generic Java application icon. Here's a screen shot: I asked Mr. ChatGPT how to substitute the icon, and found this... Q: How can a java program show a different icon in the macOS dock? A: To set a custom icon in the macOS Dock for a Java application, you can use the 1. Ensure the Mac-Specific Libraries Are AvailableEnsure you are using a JVM that includes Apple's macOS-specific extensions. Modern OpenJDK distributions (like AdoptOpenJDK or Zulu) generally support these extensions on macOS. 2. Set the Dock IconYou can set the icon using the following code: import com.apple.eawt.Application;
import javax.swing.ImageIcon;
import java.awt.Image;
public class DockIconExample {
public static void main(String[] args) {
// Load the image for the dock icon
ImageIcon icon = new ImageIcon("path/to/icon.png");
Image image = icon.getImage();
// Get the Application instance (macOS-specific)
Application app = Application.getApplication();
// Set the Dock icon
app.setDockIconImage(image);
}
} 3. Add the Image to Your ProjectEnsure that the 4. Package and Run the ApplicationMake sure the application is run in a macOS environment. This call is a no-op in non-macOS systems, meaning it won’t affect behavior on Windows or Linux. Notes:
This method works well for Java applications that require a custom Dock icon on macOS. |
@ryanhamilton I'm beginning to think that it's not necessary to fiddle with the application icon when the app is running. Using the macOS application bundle (above) on macOS 15.1, the icon remains as the stylized "Q". No further work required... |
Apple
has bamboozled us... They makemakes it hard to get a signed binary (you actually do have to buy into their entire development environment, and buy - as in pay money - to become a Developer).But anyone can create a double-clickable macOS application bundle that contains all the bits and pieces required to run qStudio and execute PRQL queries. On first launch, you will have to click through a "unverified developer" warning, but after that, it works great. (Thanks, ChatGPT for removing so many of the mysteries).
The Create qStudio macOS app repo has a main script that assembles the bits and pieces - downloading the specified versions of qStudio and prqlc from their own repo's, then adding and tweaking a few more resources to make the complete bundle.
The script is not dependent on macOS. In fact, my most recent bundle was built on a RPi4 running Ubuntu 24.04. The resulting bundle, when copied back to a Mac, works fine on both Intel and Apple Silicon.
Perhaps this could become part of the qStudio release system so that Mac users can get their own binary that is just double-clickable.
Note: The current build of the macOS bundle is at: https://randomneuronsfiring.com/wp-content/uploads/qStudio.zip
The text was updated successfully, but these errors were encountered: