feat: updates, work on qs

This commit is contained in:
Kat Inskip 2025-12-05 10:37:39 -08:00
parent 5686454354
commit 4be1b9f090
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
30 changed files with 773 additions and 74 deletions

View file

@ -0,0 +1,49 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Niri 0.1
import "root:/DataSources"
import "root:/Helpers"
RowLayout {
id: root
property string title: get_text()
property string icon_path: get_icon()
property string app_id: get_app_id()
function get_app_id() {
var app_id = niri.focusedWindow?.appId;
return app_id
}
function get_text() {
var full_title = niri.focusedWindow?.title ?? "";
var shortened_title = full_title.substring(0, 20);
if (full_title.length > 20) {
shortened_title += "…"
}
return shortened_title
}
function get_icon() {
var icon = ThemeIcons.iconForAppId(app_id);
if (icon && icon !== "") {
return icon
}
}
spacing: 10
Image {
anchors.verticalCenter: parent.verticalCenter
source: icon_path
visible: title != ""
sourceSize.width: 24
sourceSize.height: 24
smooth: true
}
Text {
text: title
color: Settings.defaultFg
}
}