aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt
diff options
context:
space:
mode:
authorJ10a1n15 <45315647+j10a1n15@users.noreply.github.com>2024-10-02 16:45:32 +0200
committerGitHub <noreply@github.com>2024-10-02 16:45:32 +0200
commit140219f75b361fce1d9dec265f78b70202d06d3b (patch)
treeea8dd8ae2427ebb6a74e42d6267dd7847ad858d6 /src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt
parentab7b3269eb8a5b3869331fa94663b1ddfebe80b2 (diff)
downloadskyhanni-140219f75b361fce1d9dec265f78b70202d06d3b.tar.gz
skyhanni-140219f75b361fce1d9dec265f78b70202d06d3b.tar.bz2
skyhanni-140219f75b361fce1d9dec265f78b70202d06d3b.zip
Backend: Alert Clock Offsets (#2623)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Co-authored-by: CalMWolfs <cwolfson58@gmail.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt
index e209e0ce9..5b42c5dc6 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt
@@ -7,6 +7,17 @@ import java.net.URI
object OSUtils {
+ val isWindows: Boolean
+ val isMac: Boolean
+ val isLinux: Boolean
+
+ init {
+ val os = System.getProperty("os.name")
+ isWindows = os.contains("win", ignoreCase = true)
+ isMac = os.contains("mac", ignoreCase = true)
+ isLinux = os.contains("linux", ignoreCase = true)
+ }
+
@JvmStatic
fun openBrowser(url: String) {
val desktopSupported = Desktop.isDesktopSupported()
@@ -17,7 +28,7 @@ object OSUtils {
} catch (e: IOException) {
ErrorManager.logErrorWithData(
e, "Error while opening website.",
- "url" to url
+ "url" to url,
)
}
} else {