Add opencode fallback and replace SDDM session combobox
This commit is contained in:
parent
973951e2c9
commit
6afb5d37a9
3 changed files with 98 additions and 14 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Window 2.15
|
||||
import SddmComponents 2.0
|
||||
|
||||
Rectangle {
|
||||
|
|
@ -138,16 +139,92 @@ Rectangle {
|
|||
radius: 12
|
||||
color: "#15221dcc"
|
||||
border.width: 1
|
||||
border.color: "#355b4b"
|
||||
border.color: sessionPopup.opened ? "#7fbf4d" : "#355b4b"
|
||||
|
||||
ComboBox {
|
||||
id: session
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 8
|
||||
anchors.rightMargin: 8
|
||||
model: sessionModel
|
||||
opacity: 0.92
|
||||
Text {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 14
|
||||
text: sessionModel.lastIndex >= 0 && sessionModel.rowCount() > 0 ? sessionModel.data(sessionModel.index(session.currentIndex, 0), Qt.DisplayRole) : "Sitzung wählen"
|
||||
color: "#d8e3dc"
|
||||
font.pixelSize: 15
|
||||
elide: Text.ElideRight
|
||||
width: parent.width - 50
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 16
|
||||
text: sessionPopup.opened ? "▴" : "▾"
|
||||
color: "#91a39a"
|
||||
font.pixelSize: 14
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
if (sessionPopup.opened) {
|
||||
sessionPopup.close()
|
||||
} else {
|
||||
sessionPopup.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Popup {
|
||||
id: sessionPopup
|
||||
x: panel.x + 30
|
||||
y: panel.y + 302
|
||||
width: panel.width - 60
|
||||
modal: false
|
||||
focus: true
|
||||
padding: 0
|
||||
background: Rectangle {
|
||||
radius: 12
|
||||
color: "#0d1713f2"
|
||||
border.width: 1
|
||||
border.color: "#355b4b"
|
||||
}
|
||||
|
||||
contentItem: ListView {
|
||||
implicitHeight: Math.min(contentHeight, 220)
|
||||
model: sessionModel
|
||||
clip: true
|
||||
delegate: Rectangle {
|
||||
width: ListView.view.width
|
||||
height: 42
|
||||
color: index === session.currentIndex ? "#7fbf4d22" : sessionItemMouse.containsMouse ? "#ffffff08" : "transparent"
|
||||
|
||||
Text {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 14
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 14
|
||||
text: model.display
|
||||
color: "#d8e3dc"
|
||||
font.pixelSize: 14
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: sessionItemMouse
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
session.currentIndex = index
|
||||
sessionPopup.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: session
|
||||
property int currentIndex: sessionModel.lastIndex >= 0 ? sessionModel.lastIndex : 0
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
|
|
|||
18
install.sh
18
install.sh
|
|
@ -172,19 +172,21 @@ install_optional_pacman_group() {
|
|||
local file="$2"
|
||||
|
||||
if [[ ! -f "$file" ]]; then
|
||||
return
|
||||
return 1
|
||||
fi
|
||||
|
||||
mapfile -t packages < <(grep -v '^\s*$' "$file")
|
||||
if (( ${#packages[@]} == 0 )); then
|
||||
return
|
||||
return 1
|
||||
fi
|
||||
|
||||
if prompt_yes_no "Optionale Pacman-Gruppe installieren: ${label}?"; then
|
||||
log "Installiere optionale Pacman-Gruppe: ${label}"
|
||||
sudo pacman -S --needed --noconfirm "${packages[@]}"
|
||||
return 0
|
||||
else
|
||||
log "Überspringe optionale Pacman-Gruppe: ${label}"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -193,19 +195,21 @@ install_optional_aur_group() {
|
|||
local file="$2"
|
||||
|
||||
if [[ ! -f "$file" ]]; then
|
||||
return
|
||||
return 1
|
||||
fi
|
||||
|
||||
mapfile -t packages < <(grep -v '^\s*$' "$file")
|
||||
if (( ${#packages[@]} == 0 )); then
|
||||
return
|
||||
return 1
|
||||
fi
|
||||
|
||||
if prompt_yes_no "Optionale AUR-Gruppe installieren: ${label}?"; then
|
||||
log "Installiere optionale AUR-Gruppe: ${label}"
|
||||
yay -S --needed --noconfirm --answerclean None --answerdiff None --removemake "${packages[@]}"
|
||||
return 0
|
||||
else
|
||||
log "Überspringe optionale AUR-Gruppe: ${label}"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -215,8 +219,10 @@ setup_optional_dev_ai() {
|
|||
return
|
||||
fi
|
||||
|
||||
install_optional_pacman_group "Dev/AI" "$REPO_DIR/packages/optional-arch-dev-ai.txt"
|
||||
install_optional_aur_group "Dev/AI" "$REPO_DIR/packages/optional-aur-dev-ai.txt"
|
||||
if ! install_optional_pacman_group "Dev/AI" "$REPO_DIR/packages/optional-arch-dev-ai.txt"; then
|
||||
log "Pacman-Dev/AI nicht installiert oder fehlgeschlagen, versuche AUR-Fallback falls konfiguriert"
|
||||
install_optional_aur_group "Dev/AI Fallback" "$REPO_DIR/packages/optional-aur-dev-ai.txt" || true
|
||||
fi
|
||||
|
||||
if command -v systemctl >/dev/null 2>&1; then
|
||||
sudo systemctl enable --now ollama.service >/dev/null 2>&1 || true
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
opencode-bin
|
||||
Loading…
Add table
Reference in a new issue