Package gaiasky.util
Class SysUtils
java.lang.Object
gaiasky.util.SysUtils
Some handy system utilities and constants.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static boolean
static boolean
checkI3()
static boolean
checkKDE()
static boolean
checkLinuxDesktop
(String desktop) static boolean
static boolean
static String
static Path
Returns the default cache directory, for non-essential data.static Path
static Path
Gets a file pointer to the crash reports directory, where crash reports are stored.static Path
Returns the default data directory.static Path
Gets a file pointer to the bookmarks directory.static Path
Gets a file pointer to the camera directory.static Path
Gets a file pointer to the frames directory.static Path
Gets a file pointer to the mappings directory.static Path
Gets a file pointer to the mpcdi directory.static Path
Gets a file pointer to the music directory.static Path
Gets a file pointer to the default screenshots directory.static int[]
Gets the current display resolution.static Path
static double
static Path
static Path
Gets a file pointer to the local data directory where the data files are downloaded and stored.static Path
Gets a file pointer to the log directory, where the log for the last session is stored.static String
static String
static String
static String
static String
static Path
static Path
Gets the path to the file containing the release notes.static Path
Gets the path to the file containing the last shown release notes version.static Path
getTempDir
(String dataLocation) Gets the path to the actual temporary directory in the data folder.static Path
static String
static boolean
Returns whether we are running in an AppImage.static boolean
isAppImagePath
(String path) Checks if the given file path belongs to an AppImage.static boolean
isLinux()
static boolean
isM1Mac()
static boolean
isMac()
static boolean
static boolean
static boolean
isUnix()
static boolean
static boolean
static void
static void
mkdirs()
Initialize directories.static void
saveProceduralPixmap
(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() -
isM1Mac
public static boolean isM1Mac() -
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.
-
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.
-
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.
-