From 70ca3fef77ee8bdc6e3ac28589a6fa08c024cc69 Mon Sep 17 00:00:00 2001 From: AlexanderCurl Date: Sat, 18 Apr 2026 17:46:06 +0100 Subject: Replaced file structures for themes in the correct format --- .../quickshell/Widgets/SystemLogo.qml | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Widgets/SystemLogo.qml (limited to 'raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Widgets/SystemLogo.qml') diff --git a/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Widgets/SystemLogo.qml b/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Widgets/SystemLogo.qml new file mode 100644 index 0000000..19922e5 --- /dev/null +++ b/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Widgets/SystemLogo.qml @@ -0,0 +1,84 @@ +import QtQuick +import QtQuick.Effects +import Quickshell +import Quickshell.Widgets +import qs.Common +import qs.Widgets + +Item { + id: root + + property string colorOverride: "" + property real brightnessOverride: 0.5 + property real contrastOverride: 1 + + readonly property bool hasColorOverride: colorOverride !== "" + + property bool useNerdFont: false + property string nerdFontIcon: "" + + IconImage { + id: iconImage + anchors.fill: parent + visible: !root.useNerdFont + + smooth: true + asynchronous: true + layer.enabled: hasColorOverride + + layer.effect: MultiEffect { + colorization: 1 + colorizationColor: colorOverride + brightness: brightnessOverride + contrast: contrastOverride + } + } + + DankNFIcon { + id: nfIcon + anchors.centerIn: parent + visible: root.useNerdFont + name: root.nerdFontIcon + size: Math.min(root.width, root.height) + color: hasColorOverride ? colorOverride : Theme.surfaceText + } + + Component.onCompleted: { + Proc.runCommand(null, ["sh", "-c", ". /etc/os-release && echo $NAME"], (nameOutput, nameExitCode) => { + if (nameExitCode === 0 && nameOutput.trim() === "RaveOS") { + iconImage.source = "file://" + Theme.shellDir + "/assets/raveos-logo.svg" + return + } + + Proc.runCommand(null, ["sh", "-c", ". /etc/os-release && echo $ID"], (output, exitCode) => { + if (!root || exitCode !== 0 || !output) return + const distroId = output.trim() + if (!distroId) return + + const supportedDistroNFs = ["debian", "arch", "archcraft", "fedora", "nixos", "ubuntu", "guix", "gentoo", "endeavouros", "manjaro", "opensuse"] + if (supportedDistroNFs.includes(distroId)) { + if (!root) return + root.useNerdFont = true + root.nerdFontIcon = distroId + return + } + + Proc.runCommand(null, ["sh", "-c", ". /etc/os-release && echo $LOGO"], (logoOutput, logoExitCode) => { + if (!root || !iconImage || logoExitCode !== 0 || !logoOutput) return + const logo = logoOutput.trim() + if (!logo) return + + if (logo === "cachyos") { + iconImage.source = "file:///usr/share/icons/cachyos.svg" + return + } + if (logo === "guix-icon") { + iconImage.source = "file:///run/current-system/profile/share/icons/hicolor/scalable/apps/guix-icon.svg" + return + } + iconImage.source = Quickshell.iconPath(logo, true) + }, 0) + }, 0) + }, 0) + } +} -- cgit v1.3