Package gaiasky.util
Class SysUtils
java.lang.Object
gaiasky.util.SysUtils
Some handy system utilities and constants.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic booleanstatic booleancheckI3()static booleancheckKDE()static booleancheckLinuxDesktop(String desktop) static booleanstatic booleanstatic Stringstatic PathReturns the default cache directory, for non-essential data.static Pathstatic PathGets a file pointer to the crash reports directory, where crash reports are stored.static PathGets a pointer to the shader output directory for the crash reports.static PathReturns the default data directory.static PathGets a file pointer to the bookmarks directory.static PathGets a file pointer to the camera directory.static PathGets a file pointer to the frames directory.static PathGets a file pointer to the mappings directory.static PathGets a file pointer to the mpcdi directory.static PathGets a file pointer to the music directory.static PathGets a file pointer to the default screenshots directory.static int[]Gets the current display resolution.static Pathstatic doublestatic Pathstatic PathGets a file pointer to the local data directory where the data files are downloaded and stored.static PathGets a file pointer to the log directory, where the log for the last session is stored.static Stringstatic Stringstatic Stringstatic Stringstatic Stringstatic Pathstatic PathGets the path to the file containing the release notes.static PathGets the path to the file containing the last shown release notes version.static PathReturns the default shader cache directory.static PathgetTempDir(String dataLocation) Gets the path to the actual temporary directory in the data folder.static Pathstatic Stringstatic booleanReturns whether we are running in an AppImage.static booleanisAppImagePath(String path) Checks if the given file path belongs to an AppImage.static booleanstatic booleanisLinux()static booleanisMac()static booleanstatic booleanstatic booleanisUnix()static booleanstatic booleanstatic voidstatic voidmkdirs()Initialize directories.static voidsaveProceduralPixmap(com.badlogic.gdx.graphics.Pixmap p, String name) Saves the given procedurally generated pixmap as a PNG image to disk using the given name and timestamp.
-
Constructor Details
-
SysUtils
public SysUtils()
-
-
Method Details
-
mkdirs
public static void mkdirs()Initialize directories. -
mkdir
-
getXdgDesktop
-
checkLinuxDesktop
-
checkUnity
public static boolean checkUnity() -
checkGnome
public static boolean checkGnome() -
checkKDE
public static boolean checkKDE() -
checkXfce
public static boolean checkXfce() -
checkBudgie
public static boolean checkBudgie() -
checkI3
public static boolean checkI3() -
getOSName
-
getOSFamily
-
isLinux
public static boolean isLinux() -
isWindows
public static boolean isWindows() -
isMac
public static boolean isMac() -
isAppleSiliconMac
public static boolean isAppleSiliconMac() -
isUnix
public static boolean isUnix() -
isSolaris
public static boolean isSolaris() -
isSteamDeck
public static boolean isSteamDeck() -
launchedViaInstall4j
public static boolean launchedViaInstall4j() -
getOSArchitecture
-
getOSVersion
-
getDefaultCameraDir
Gets a file pointer to the camera directory.- Returns:
- A pointer to the Gaia Sky camera directory.
-
getDefaultScreenshotsDir
Gets a file pointer to the default screenshots directory.- Returns:
- A pointer to the Gaia Sky screenshots directory.
-
getDefaultFramesDir
Gets a file pointer to the frames directory.- Returns:
- A pointer to the Gaia Sky frames directory.
-
getDefaultMusicDir
Gets a file pointer to the music directory.- Returns:
- A pointer to the Gaia Sky music directory.
-
getDefaultMappingsDir
Gets a file pointer to the mappings directory.- Returns:
- A pointer to the Gaia Sky mappings directory.
-
getMappingsDirName
-
getDefaultBookmarksDir
Gets a file pointer to the bookmarks directory.- Returns:
- A pointer to the Gaia Sky bookmarks directory.
-
getBookmarksDirName
-
getDefaultMpcdiDir
Gets a file pointer to the mpcdi directory.- Returns:
- A pointer to the Gaia Sky mpcdi directory.
-
getLocalDataDir
Gets a file pointer to the local data directory where the data files are downloaded and stored.- Returns:
- A pointer to the local data directory where the data files are.
-
getCrashReportsDir
Gets a file pointer to the crash reports directory, where crash reports are stored.- Returns:
- A pointer to the crash reports directory.
-
getCrashShadersDir
Gets a pointer to the shader output directory for the crash reports.- Returns:
- A pointer to the shader output directory.
-
getLogDir
Gets a file pointer to the log directory, where the log for the last session is stored.- Returns:
- A pointer to the log directory.
-
getTempDir
Gets the path to the actual temporary directory in the data folder. It needs the location of the user-configured data folder as input.- Parameters:
dataLocation- The user-defined data location.- Returns:
- A path that points to the temporary directory.
-
getDataDir
Returns the default data directory. That is ~/.gaiasky/ in Windows and macOS, and ~/.local/share/gaiasky in Linux.- Returns:
- Default data directory.
-
getCacheDir
Returns the default cache directory, for non-essential data. This is ~/.gaiasky/ in Windows and macOS, and ~/.cache/gaiasky in Linux.- Returns:
- The default cache directory.
-
getShaderCacheDir
Returns the default shader cache directory. This is ~/.gaiasky/shadercache/ in Windows and macOS, and ~/.cache/gaiasky/shadercache/ in Linux.- Returns:
- The default shader cache directory.
-
getConfigDir
-
getHomeDir
-
getUserHome
-
getLocalAppDataTemp
-
getJavaVersion
public static double getJavaVersion() -
getReleaseNotesFile
Gets the path to the file containing the release notes.- Returns:
- Path to the release notes file
-
getReleaseNotesRevisionFile
Gets the path to the file containing the last shown release notes version. This file is typically in the configuration directory.- Returns:
- Path to the release notes revision file
-
getProceduralPixmapDir
-
saveProceduralPixmap
Saves the given procedurally generated pixmap as a PNG image to disk using the given name and timestamp.- Parameters:
p- The pixmap.name- The name of the pixmap.
-
isAppImagePath
Checks if the given file path belongs to an AppImage.- Parameters:
path- The path to check.- Returns:
- Whether the path to the file belongs to an AppImage or not.
-
isAppImage
public static boolean isAppImage()Returns whether we are running in an AppImage.- Returns:
- True if we are in an AppImage package.
-
getDisplayResolution
public static int[] getDisplayResolution()Gets the current display resolution.- Returns:
- The display resolution in an array with [width, height], or null if the resolution could not be determined.
-