Feature: Icon does not appear unless installed
This commit is contained in:
@@ -16,12 +16,14 @@ RowLayout {
|
|||||||
{
|
{
|
||||||
name: "Bitwarden",
|
name: "Bitwarden",
|
||||||
icon: Qt.resolvedUrl("../../assets/bitwarden.png"),
|
icon: Qt.resolvedUrl("../../assets/bitwarden.png"),
|
||||||
|
binary: "bitwarden",
|
||||||
launch: ["bitwarden"],
|
launch: ["bitwarden"],
|
||||||
|
secondary: ["pkill", "bitwarden"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Sunshine",
|
name: "Sunshine",
|
||||||
|
|
||||||
icon: Qt.resolvedUrl("../../assets/sunshine.svg"),
|
icon: Qt.resolvedUrl("../../assets/sunshine.svg"),
|
||||||
|
binary: "sunshine",
|
||||||
launch: ["systemctl", "--user", "start", "app-dev.lizardbyte.app.Sunshine.service"],
|
launch: ["systemctl", "--user", "start", "app-dev.lizardbyte.app.Sunshine.service"],
|
||||||
secondary: ["xdg-open", "https://xol.twhomelab.local:47990"],
|
secondary: ["xdg-open", "https://xol.twhomelab.local:47990"],
|
||||||
},
|
},
|
||||||
@@ -44,10 +46,18 @@ RowLayout {
|
|||||||
required property var modelData
|
required property var modelData
|
||||||
readonly property var trayItem: root.findTrayItem(modelData.name)
|
readonly property var trayItem: root.findTrayItem(modelData.name)
|
||||||
readonly property bool running: trayItem !== null
|
readonly property bool running: trayItem !== null
|
||||||
|
property bool installed: false // Application installation check
|
||||||
|
|
||||||
|
visible: slot.installed
|
||||||
implicitWidth: Appearance.iconSize
|
implicitWidth: Appearance.iconSize
|
||||||
implicitHeight: Appearance.iconSize
|
implicitHeight: Appearance.iconSize
|
||||||
|
|
||||||
|
Process {
|
||||||
|
running: true
|
||||||
|
command: ["which", slot.modelData.binary]
|
||||||
|
onExited: (exitCode) => slot.installed = exitCode === 0
|
||||||
|
}
|
||||||
|
|
||||||
IconImage {
|
IconImage {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
source: slot.running
|
source: slot.running
|
||||||
|
|||||||
Reference in New Issue
Block a user