summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2026-01-08 16:13:14 -0500
committerFreya Murphy <freya@freyacat.org>2026-01-08 16:13:14 -0500
commit814d2f336c6a56e53412201bf99ca69753bda71b (patch)
treedd793d6efe906b30ced51152f377f9907f1ab06f
parentclean up lock screen (diff)
downloadcaelestia-shell-814d2f336c6a56e53412201bf99ca69753bda71b.tar.gz
caelestia-shell-814d2f336c6a56e53412201bf99ca69753bda71b.tar.bz2
caelestia-shell-814d2f336c6a56e53412201bf99ca69753bda71b.zip
remove themes and configs from launcher
-rw-r--r--config/Config.qml2
-rw-r--r--config/LauncherConfig.qml110
-rw-r--r--modules/controlcenter/launcher/Settings.qml18
-rw-r--r--modules/launcher/AppList.qml78
-rw-r--r--modules/launcher/Content.qml18
-rw-r--r--modules/launcher/ContentList.qml38
-rw-r--r--modules/launcher/WallpaperList.qml97
-rw-r--r--modules/launcher/items/ActionItem.qml70
-rw-r--r--modules/launcher/items/CalcItem.qml123
-rw-r--r--modules/launcher/items/SchemeItem.qml105
-rw-r--r--modules/launcher/items/VariantItem.qml81
-rw-r--r--modules/launcher/items/WallpaperItem.qml98
-rw-r--r--modules/launcher/services/Actions.qml52
-rw-r--r--modules/launcher/services/M3Variants.qml85
-rw-r--r--modules/launcher/services/Schemes.qml88
15 files changed, 8 insertions, 1055 deletions
diff --git a/config/Config.qml b/config/Config.qml
index b875eef..40ca036 100644
--- a/config/Config.qml
+++ b/config/Config.qml
@@ -272,7 +272,6 @@ Singleton {
hiddenApps: launcher.hiddenApps,
useFuzzy: {
apps: launcher.useFuzzy.apps,
- actions: launcher.useFuzzy.actions,
schemes: launcher.useFuzzy.schemes,
variants: launcher.useFuzzy.variants,
wallpapers: launcher.useFuzzy.wallpapers
@@ -283,7 +282,6 @@ Singleton {
wallpaperWidth: launcher.sizes.wallpaperWidth,
wallpaperHeight: launcher.sizes.wallpaperHeight
},
- actions: launcher.actions
};
}
diff --git a/config/LauncherConfig.qml b/config/LauncherConfig.qml
index 9d9c50c..ea55838 100644
--- a/config/LauncherConfig.qml
+++ b/config/LauncherConfig.qml
@@ -6,8 +6,6 @@ JsonObject {
property int maxShown: 7
property int maxWallpapers: 9 // Warning: even numbers look bad
property string specialPrefix: "@"
- property string actionPrefix: ">"
- property bool enableDangerousActions: false // Allow actions that can cause losing data, like shutdown, reboot and logout
property int dragThreshold: 50
property bool vimKeybinds: false
property list<string> hiddenApps: []
@@ -16,7 +14,6 @@ JsonObject {
component UseFuzzy: JsonObject {
property bool apps: false
- property bool actions: false
property bool schemes: false
property bool variants: false
property bool wallpapers: false
@@ -28,111 +25,4 @@ JsonObject {
property int wallpaperWidth: 280
property int wallpaperHeight: 200
}
-
- property list<var> actions: [
- {
- name: "Calculator",
- icon: "calculate",
- description: "Do simple math equations (powered by Qalc)",
- command: ["autocomplete", "calc"],
- enabled: true,
- dangerous: false
- },
- {
- name: "Scheme",
- icon: "palette",
- description: "Change the current colour scheme",
- command: ["autocomplete", "scheme"],
- enabled: true,
- dangerous: false
- },
- {
- name: "Wallpaper",
- icon: "image",
- description: "Change the current wallpaper",
- command: ["autocomplete", "wallpaper"],
- enabled: true,
- dangerous: false
- },
- {
- name: "Variant",
- icon: "colors",
- description: "Change the current scheme variant",
- command: ["autocomplete", "variant"],
- enabled: true,
- dangerous: false
- },
- {
- name: "Transparency",
- icon: "opacity",
- description: "Change shell transparency",
- command: ["autocomplete", "transparency"],
- enabled: false,
- dangerous: false
- },
- {
- name: "Random",
- icon: "casino",
- description: "Switch to a random wallpaper",
- command: ["caelestia", "wallpaper", "-r"],
- enabled: true,
- dangerous: false
- },
- {
- name: "Light",
- icon: "light_mode",
- description: "Change the scheme to light mode",
- command: ["setMode", "light"],
- enabled: true,
- dangerous: false
- },
- {
- name: "Dark",
- icon: "dark_mode",
- description: "Change the scheme to dark mode",
- command: ["setMode", "dark"],
- enabled: true,
- dangerous: false
- },
- {
- name: "Shutdown",
- icon: "power_settings_new",
- description: "Shutdown the system",
- command: ["systemctl", "poweroff"],
- enabled: true,
- dangerous: true
- },
- {
- name: "Reboot",
- icon: "cached",
- description: "Reboot the system",
- command: ["systemctl", "reboot"],
- enabled: true,
- dangerous: true
- },
- {
- name: "Logout",
- icon: "exit_to_app",
- description: "Log out of the current session",
- command: ["loginctl", "terminate-user", ""],
- enabled: true,
- dangerous: true
- },
- {
- name: "Lock",
- icon: "lock",
- description: "Lock the current session",
- command: ["loginctl", "lock-session"],
- enabled: true,
- dangerous: false
- },
- {
- name: "Sleep",
- icon: "bedtime",
- description: "Suspend then hibernate",
- command: ["systemctl", "suspend-then-hibernate"],
- enabled: true,
- dangerous: false
- }
- ]
}
diff --git a/modules/controlcenter/launcher/Settings.qml b/modules/controlcenter/launcher/Settings.qml
index 161221e..0b842e9 100644
--- a/modules/controlcenter/launcher/Settings.qml
+++ b/modules/controlcenter/launcher/Settings.qml
@@ -55,15 +55,6 @@ ColumnLayout {
Config.save();
}
}
-
- ToggleRow {
- label: qsTr("Enable dangerous actions")
- checked: Config.launcher.enableDangerousActions
- toggle.onToggled: {
- Config.launcher.enableDangerousActions = checked;
- Config.save();
- }
- }
}
SectionHeader {
@@ -131,15 +122,6 @@ ColumnLayout {
}
ToggleRow {
- label: qsTr("Actions")
- checked: Config.launcher.useFuzzy.actions
- toggle.onToggled: {
- Config.launcher.useFuzzy.actions = checked;
- Config.save();
- }
- }
-
- ToggleRow {
label: qsTr("Schemes")
checked: Config.launcher.useFuzzy.schemes
toggle.onToggled: {
diff --git a/modules/launcher/AppList.qml b/modules/launcher/AppList.qml
index 7f7b843..aab0299 100644
--- a/modules/launcher/AppList.qml
+++ b/modules/launcher/AppList.qml
@@ -50,23 +50,9 @@ StyledListView {
state: {
const text = search.text;
- const prefix = Config.launcher.actionPrefix;
- if (text.startsWith(prefix)) {
- for (const action of ["calc", "scheme", "variant"])
- if (text.startsWith(`${prefix}${action} `))
- return action;
-
- return "actions";
- }
-
return "apps";
}
- onStateChanged: {
- if (state === "scheme" || state === "variant")
- Schemes.reload();
- }
-
states: [
State {
name: "apps"
@@ -76,38 +62,6 @@ StyledListView {
root.delegate: appItem
}
},
- State {
- name: "actions"
-
- PropertyChanges {
- model.values: Actions.query(search.text)
- root.delegate: actionItem
- }
- },
- State {
- name: "calc"
-
- PropertyChanges {
- model.values: [0]
- root.delegate: calcItem
- }
- },
- State {
- name: "scheme"
-
- PropertyChanges {
- model.values: Schemes.query(search.text)
- root.delegate: schemeItem
- }
- },
- State {
- name: "variant"
-
- PropertyChanges {
- model.values: M3Variants.query(search.text)
- root.delegate: variantItem
- }
- }
]
transitions: Transition {
@@ -222,36 +176,4 @@ StyledListView {
visibilities: root.visibilities
}
}
-
- Component {
- id: actionItem
-
- ActionItem {
- list: root
- }
- }
-
- Component {
- id: calcItem
-
- CalcItem {
- list: root
- }
- }
-
- Component {
- id: schemeItem
-
- SchemeItem {
- list: root
- }
- }
-
- Component {
- id: variantItem
-
- VariantItem {
- list: root
- }
- }
}
diff --git a/modules/launcher/Content.qml b/modules/launcher/Content.qml
index c085976..be9fb91 100644
--- a/modules/launcher/Content.qml
+++ b/modules/launcher/Content.qml
@@ -79,25 +79,13 @@ Item {
topPadding: Appearance.padding.larger
bottomPadding: Appearance.padding.larger
- placeholderText: qsTr("Type \"%1\" for commands").arg(Config.launcher.actionPrefix)
+ placeholderText: "Search programs"
onAccepted: {
const currentItem = list.currentList?.currentItem;
if (currentItem) {
- if (list.showWallpapers) {
- if (Colours.scheme === "dynamic" && currentItem.modelData.path !== Wallpapers.actualCurrent)
- Wallpapers.previewColourLock = true;
- Wallpapers.setWallpaper(currentItem.modelData.path);
- root.visibilities.launcher = false;
- } else if (text.startsWith(Config.launcher.actionPrefix)) {
- if (text.startsWith(`${Config.launcher.actionPrefix}calc `))
- currentItem.onClicked();
- else
- currentItem.modelData.onClicked(list.currentList);
- } else {
- Apps.launch(currentItem.modelData);
- root.visibilities.launcher = false;
- }
+ Apps.launch(currentItem.modelData);
+ root.visibilities.launcher = false;
}
}
diff --git a/modules/launcher/ContentList.qml b/modules/launcher/ContentList.qml
index b2a9c77..1b77420 100644
--- a/modules/launcher/ContentList.qml
+++ b/modules/launcher/ContentList.qml
@@ -18,15 +18,13 @@ Item {
required property StyledTextField search
required property int padding
required property int rounding
-
- readonly property bool showWallpapers: search.text.startsWith(`${Config.launcher.actionPrefix}wallpaper `)
- readonly property Item currentList: showWallpapers ? wallpaperList.item : appList.item
+ readonly property Item currentList: appList.item
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
clip: true
- state: showWallpapers ? "wallpapers" : "apps"
+ state: "apps"
states: [
State {
@@ -43,15 +41,6 @@ Item {
anchors.right: root.parent.right
}
},
- State {
- name: "wallpapers"
-
- PropertyChanges {
- root.implicitWidth: Math.max(Config.launcher.sizes.itemWidth * 1.2, wallpaperList.implicitWidth)
- root.implicitHeight: Config.launcher.sizes.wallpaperHeight
- wallpaperList.active: true
- }
- }
]
Behavior on state {
@@ -87,23 +76,6 @@ Item {
}
}
- Loader {
- id: wallpaperList
-
- active: false
-
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
-
- sourceComponent: WallpaperList {
- search: root.search
- visibilities: root.visibilities
- panels: root.panels
- content: root.content
- }
- }
-
Row {
id: empty
@@ -117,7 +89,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter
MaterialIcon {
- text: root.state === "wallpapers" ? "wallpaper_slideshow" : "manage_search"
+ text: "manage_search"
color: Colours.palette.m3onSurfaceVariant
font.pointSize: Appearance.font.size.extraLarge
@@ -128,14 +100,14 @@ Item {
anchors.verticalCenter: parent.verticalCenter
StyledText {
- text: root.state === "wallpapers" ? qsTr("No wallpapers found") : qsTr("No results")
+ text: qsTr("No results")
color: Colours.palette.m3onSurfaceVariant
font.pointSize: Appearance.font.size.larger
font.weight: 500
}
StyledText {
- text: root.state === "wallpapers" && Wallpapers.list.length === 0 ? qsTr("Try putting some wallpapers in %1").arg(Paths.shortenHome(Paths.wallsdir)) : qsTr("Try searching for something else")
+ text: qsTr("Try searching for something else")
color: Colours.palette.m3onSurfaceVariant
font.pointSize: Appearance.font.size.normal
}
diff --git a/modules/launcher/WallpaperList.qml b/modules/launcher/WallpaperList.qml
deleted file mode 100644
index 4aba436..0000000
--- a/modules/launcher/WallpaperList.qml
+++ /dev/null
@@ -1,97 +0,0 @@
-pragma ComponentBehavior: Bound
-
-import "items"
-import qs.components.controls
-import qs.services
-import qs.config
-import Quickshell
-import QtQuick
-
-PathView {
- id: root
-
- required property StyledTextField search
- required property var visibilities
- required property var panels
- required property var content
-
- readonly property int itemWidth: Config.launcher.sizes.wallpaperWidth * 0.8 + Appearance.padding.larger * 2
-
- readonly property int numItems: {
- const screen = QsWindow.window?.screen;
- if (!screen)
- return 0;
-
- // Screen width - 4x outer rounding - 2x max side thickness (cause centered)
- const barMargins = Math.max(Config.border.thickness, panels.bar.implicitWidth);
- let outerMargins = 0;
- if (panels.popouts.hasCurrent && panels.popouts.currentCenter + panels.popouts.nonAnimHeight / 2 > screen.height - content.implicitHeight - Config.border.thickness * 2)
- outerMargins = panels.popouts.nonAnimWidth;
- if ((visibilities.utilities || visibilities.sidebar) && panels.utilities.implicitWidth > outerMargins)
- outerMargins = panels.utilities.implicitWidth;
- const maxWidth = screen.width - Config.border.rounding * 4 - (barMargins + outerMargins) * 2;
-
- if (maxWidth <= 0)
- return 0;
-
- const maxItemsOnScreen = Math.floor(maxWidth / itemWidth);
- const visible = Math.min(maxItemsOnScreen, Config.launcher.maxWallpapers, scriptModel.values.length);
-
- if (visible === 2)
- return 1;
- if (visible > 1 && visible % 2 === 0)
- return visible - 1;
- return visible;
- }
-
- model: ScriptModel {
- id: scriptModel
-
- readonly property string search: root.search.text.split(" ").slice(1).join(" ")
-
- values: Wallpapers.query(search)
- onValuesChanged: root.currentIndex = search ? 0 : values.findIndex(w => w.path === Wallpapers.actualCurrent)
- }
-
- Component.onCompleted: currentIndex = Wallpapers.list.findIndex(w => w.path === Wallpapers.actualCurrent)
- Component.onDestruction: Wallpapers.stopPreview()
-
- onCurrentItemChanged: {
- if (currentItem)
- Wallpapers.preview(currentItem.modelData.path);
- }
-
- implicitWidth: Math.min(numItems, count) * itemWidth
- pathItemCount: numItems
- cacheItemCount: 4
-
- snapMode: PathView.SnapToItem
- preferredHighlightBegin: 0.5
- preferredHighlightEnd: 0.5
- highlightRangeMode: PathView.StrictlyEnforceRange
-
- delegate: WallpaperItem {
- visibilities: root.visibilities
- }
-
- path: Path {
- startY: root.height / 2
-
- PathAttribute {
- name: "z"
- value: 0
- }
- PathLine {
- x: root.width / 2
- relativeY: 0
- }
- PathAttribute {
- name: "z"
- value: 1
- }
- PathLine {
- x: root.width
- relativeY: 0
- }
- }
-}
diff --git a/modules/launcher/items/ActionItem.qml b/modules/launcher/items/ActionItem.qml
deleted file mode 100644
index e158029..0000000
--- a/modules/launcher/items/ActionItem.qml
+++ /dev/null
@@ -1,70 +0,0 @@
-import "../services"
-import qs.components
-import qs.services
-import qs.config
-import QtQuick
-
-Item {
- id: root
-
- required property var modelData
- required property var list
-
- implicitHeight: Config.launcher.sizes.itemHeight
-
- anchors.left: parent?.left
- anchors.right: parent?.right
-
- StateLayer {
- radius: Appearance.rounding.normal
-
- function onClicked(): void {
- root.modelData?.onClicked(root.list);
- }
- }
-
- Item {
- anchors.fill: parent
- anchors.leftMargin: Appearance.padding.larger
- anchors.rightMargin: Appearance.padding.larger
- anchors.margins: Appearance.padding.smaller
-
- MaterialIcon {
- id: icon
-
- text: root.modelData?.icon ?? ""
- font.pointSize: Appearance.font.size.extraLarge
-
- anchors.verticalCenter: parent.verticalCenter
- }
-
- Item {
- anchors.left: icon.right
- anchors.leftMargin: Appearance.spacing.normal
- anchors.verticalCenter: icon.verticalCenter
-
- implicitWidth: parent.width - icon.width
- implicitHeight: name.implicitHeight + desc.implicitHeight
-
- StyledText {
- id: name
-
- text: root.modelData?.name ?? ""
- font.pointSize: Appearance.font.size.normal
- }
-
- StyledText {
- id: desc
-
- text: root.modelData?.desc ?? ""
- font.pointSize: Appearance.font.size.small
- color: Colours.palette.m3outline
-
- elide: Text.ElideRight
- width: root.width - icon.width - Appearance.rounding.normal * 2
-
- anchors.top: name.bottom
- }
- }
- }
-}
diff --git a/modules/launcher/items/CalcItem.qml b/modules/launcher/items/CalcItem.qml
deleted file mode 100644
index 65489d9..0000000
--- a/modules/launcher/items/CalcItem.qml
+++ /dev/null
@@ -1,123 +0,0 @@
-import qs.components
-import qs.services
-import qs.config
-import Caelestia
-import Quickshell
-import QtQuick
-import QtQuick.Layouts
-
-Item {
- id: root
-
- required property var list
- readonly property string math: list.search.text.slice(`${Config.launcher.actionPrefix}calc `.length)
-
- function onClicked(): void {
- Quickshell.execDetached(["wl-copy", Qalculator.eval(math, false)]);
- root.list.visibilities.launcher = false;
- }
-
- implicitHeight: Config.launcher.sizes.itemHeight
-
- anchors.left: parent?.left
- anchors.right: parent?.right
-
- StateLayer {
- radius: Appearance.rounding.normal
-
- function onClicked(): void {
- root.onClicked();
- }
- }
-
- RowLayout {
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- anchors.margins: Appearance.padding.larger
-
- spacing: Appearance.spacing.normal
-
- MaterialIcon {
- text: "function"
- font.pointSize: Appearance.font.size.extraLarge
- Layout.alignment: Qt.AlignVCenter
- }
-
- StyledText {
- id: result
-
- color: {
- if (text.includes("error: ") || text.includes("warning: "))
- return Colours.palette.m3error;
- if (!root.math)
- return Colours.palette.m3onSurfaceVariant;
- return Colours.palette.m3onSurface;
- }
-
- text: root.math.length > 0 ? Qalculator.eval(root.math) : qsTr("Type an expression to calculate")
- elide: Text.ElideLeft
-
- Layout.fillWidth: true
- Layout.alignment: Qt.AlignVCenter
- }
-
- StyledRect {
- color: Colours.palette.m3tertiary
- radius: Appearance.rounding.normal
- clip: true
-
- implicitWidth: (stateLayer.containsMouse ? label.implicitWidth + label.anchors.rightMargin : 0) + icon.implicitWidth + Appearance.padding.normal * 2
- implicitHeight: Math.max(label.implicitHeight, icon.implicitHeight) + Appearance.padding.small * 2
-
- Layout.alignment: Qt.AlignVCenter
-
- StateLayer {
- id: stateLayer
-
- color: Colours.palette.m3onTertiary
-
- function onClicked(): void {
- Quickshell.execDetached(["app2unit", "--", ...Config.general.apps.terminal, "fish", "-C", `exec qalc -i '${root.math}'`]);
- root.list.visibilities.launcher = false;
- }
- }
-
- StyledText {
- id: label
-
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: icon.left
- anchors.rightMargin: Appearance.spacing.small
-
- text: qsTr("Open in calculator")
- color: Colours.palette.m3onTertiary
- font.pointSize: Appearance.font.size.normal
-
- opacity: stateLayer.containsMouse ? 1 : 0
-
- Behavior on opacity {
- Anim {}
- }
- }
-
- MaterialIcon {
- id: icon
-
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.right
- anchors.rightMargin: Appearance.padding.normal
-
- text: "open_in_new"
- color: Colours.palette.m3onTertiary
- font.pointSize: Appearance.font.size.large
- }
-
- Behavior on implicitWidth {
- Anim {
- easing.bezierCurve: Appearance.anim.curves.emphasized
- }
- }
- }
- }
-}
diff --git a/modules/launcher/items/SchemeItem.qml b/modules/launcher/items/SchemeItem.qml
deleted file mode 100644
index b755c37..0000000
--- a/modules/launcher/items/SchemeItem.qml
+++ /dev/null
@@ -1,105 +0,0 @@
-import "../services"
-import qs.components
-import qs.services
-import qs.config
-import QtQuick
-
-Item {
- id: root
-
- required property Schemes.Scheme modelData
- required property var list
-
- implicitHeight: Config.launcher.sizes.itemHeight
-
- anchors.left: parent?.left
- anchors.right: parent?.right
-
- StateLayer {
- radius: Appearance.rounding.normal
-
- function onClicked(): void {
- root.modelData?.onClicked(root.list);
- }
- }
-
- Item {
- anchors.fill: parent
- anchors.leftMargin: Appearance.padding.larger
- anchors.rightMargin: Appearance.padding.larger
- anchors.margins: Appearance.padding.smaller
-
- StyledRect {
- id: preview
-
- anchors.verticalCenter: parent.verticalCenter
-
- border.width: 1
- border.color: Qt.alpha(`#${root.modelData?.colours?.outline}`, 0.5)
-
- color: `#${root.modelData?.colours?.surface}`
- radius: Appearance.rounding.full
- implicitWidth: parent.height * 0.8
- implicitHeight: parent.height * 0.8
-
- Item {
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.right: parent.right
-
- implicitWidth: parent.implicitWidth / 2
- clip: true
-
- StyledRect {
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.right: parent.right
-
- implicitWidth: preview.implicitWidth
- color: `#${root.modelData?.colours?.primary}`
- radius: Appearance.rounding.full
- }
- }
- }
-
- Column {
- anchors.left: preview.right
- anchors.leftMargin: Appearance.spacing.normal
- anchors.verticalCenter: parent.verticalCenter
-
- width: parent.width - preview.width - anchors.leftMargin - (current.active ? current.width + Appearance.spacing.normal : 0)
- spacing: 0
-
- StyledText {
- text: root.modelData?.flavour ?? ""
- font.pointSize: Appearance.font.size.normal
- }
-
- StyledText {
- text: root.modelData?.name ?? ""
- font.pointSize: Appearance.font.size.small
- color: Colours.palette.m3outline
-
- elide: Text.ElideRight
- anchors.left: parent.left
- anchors.right: parent.right
- }
- }
-
- Loader {
- id: current
-
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
-
- active: `${root.modelData?.name} ${root.modelData?.flavour}` === Schemes.currentScheme
- asynchronous: true
-
- sourceComponent: MaterialIcon {
- text: "check"
- color: Colours.palette.m3onSurfaceVariant
- font.pointSize: Appearance.font.size.large
- }
- }
- }
-}
diff --git a/modules/launcher/items/VariantItem.qml b/modules/launcher/items/VariantItem.qml
deleted file mode 100644
index a161aa8..0000000
--- a/modules/launcher/items/VariantItem.qml
+++ /dev/null
@@ -1,81 +0,0 @@
-import "../services"
-import qs.components
-import qs.services
-import qs.config
-import QtQuick
-
-Item {
- id: root
-
- required property M3Variants.Variant modelData
- required property var list
-
- implicitHeight: Config.launcher.sizes.itemHeight
-
- anchors.left: parent?.left
- anchors.right: parent?.right
-
- StateLayer {
- radius: Appearance.rounding.normal
-
- function onClicked(): void {
- root.modelData?.onClicked(root.list);
- }
- }
-
- Item {
- anchors.fill: parent
- anchors.leftMargin: Appearance.padding.larger
- anchors.rightMargin: Appearance.padding.larger
- anchors.margins: Appearance.padding.smaller
-
- MaterialIcon {
- id: icon
-
- text: root.modelData?.icon ?? ""
- font.pointSize: Appearance.font.size.extraLarge
-
- anchors.verticalCenter: parent.verticalCenter
- }
-
- Column {
- anchors.left: icon.right
- anchors.leftMargin: Appearance.spacing.larger
- anchors.verticalCenter: icon.verticalCenter
-
- width: parent.width - icon.width - anchors.leftMargin - (current.active ? current.width + Appearance.spacing.normal : 0)
- spacing: 0
-
- StyledText {
- text: root.modelData?.name ?? ""
- font.pointSize: Appearance.font.size.normal
- }
-
- StyledText {
- text: root.modelData?.description ?? ""
- font.pointSize: Appearance.font.size.small
- color: Colours.palette.m3outline
-
- elide: Text.ElideRight
- anchors.left: parent.left
- anchors.right: parent.right
- }
- }
-
- Loader {
- id: current
-
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
-
- active: root.modelData?.variant === Schemes.currentVariant
- asynchronous: true
-
- sourceComponent: MaterialIcon {
- text: "check"
- color: Colours.palette.m3onSurfaceVariant
- font.pointSize: Appearance.font.size.large
- }
- }
- }
-}
diff --git a/modules/launcher/items/WallpaperItem.qml b/modules/launcher/items/WallpaperItem.qml
deleted file mode 100644
index 9fdac3f..0000000
--- a/modules/launcher/items/WallpaperItem.qml
+++ /dev/null
@@ -1,98 +0,0 @@
-import qs.components
-import qs.components.effects
-import qs.components.images
-import qs.services
-import qs.config
-import Caelestia.Models
-import Quickshell
-import QtQuick
-
-Item {
- id: root
-
- required property FileSystemEntry modelData
- required property PersistentProperties visibilities
-
- scale: 0.5
- opacity: 0
- z: PathView.z ?? 0
-
- Component.onCompleted: {
- scale = Qt.binding(() => PathView.isCurrentItem ? 1 : PathView.onPath ? 0.8 : 0);
- opacity = Qt.binding(() => PathView.onPath ? 1 : 0);
- }
-
- implicitWidth: image.width + Appearance.padding.larger * 2
- implicitHeight: image.height + label.height + Appearance.spacing.small / 2 + Appearance.padding.large + Appearance.padding.normal
-
- StateLayer {
- radius: Appearance.rounding.normal
-
- function onClicked(): void {
- Wallpapers.setWallpaper(root.modelData.path);
- root.visibilities.launcher = false;
- }
- }
-
- Elevation {
- anchors.fill: image
- radius: image.radius
- opacity: root.PathView.isCurrentItem ? 1 : 0
- level: 4
-
- Behavior on opacity {
- Anim {}
- }
- }
-
- StyledClippingRect {
- id: image
-
- anchors.horizontalCenter: parent.horizontalCenter
- y: Appearance.padding.large
- color: Colours.tPalette.m3surfaceContainer
- radius: Appearance.rounding.normal
-
- implicitWidth: Config.launcher.sizes.wallpaperWidth
- implicitHeight: implicitWidth / 16 * 9
-
- MaterialIcon {
- anchors.centerIn: parent
- text: "image"
- color: Colours.tPalette.m3outline
- font.pointSize: Appearance.font.size.extraLarge * 2
- font.weight: 600
- }
-
- CachingImage {
- path: root.modelData.path
- smooth: !root.PathView.view.moving
- cache: true
-
- anchors.fill: parent
- }
- }
-
- StyledText {
- id: label
-
- anchors.top: image.bottom
- anchors.topMargin: Appearance.spacing.small / 2
- anchors.horizontalCenter: parent.horizontalCenter
-
- width: image.width - Appearance.padding.normal * 2
- horizontalAlignment: Text.AlignHCenter
- elide: Text.ElideRight
- renderType: Text.QtRendering
- text: root.modelData.relativePath
- font.pointSize: Appearance.font.size.normal
- }
-
- Behavior on scale {
- Anim {}
- }
-
- Behavior on opacity {
- Anim {}
- }
-}
diff --git a/modules/launcher/services/Actions.qml b/modules/launcher/services/Actions.qml
deleted file mode 100644
index 5c1cb6b..0000000
--- a/modules/launcher/services/Actions.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-pragma Singleton
-
-import ".."
-import qs.services
-import qs.config
-import qs.utils
-import Quickshell
-import QtQuick
-
-Searcher {
- id: root
-
- function transformSearch(search: string): string {
- return search.slice(Config.launcher.actionPrefix.length);
- }
-
- list: variants.instances
- useFuzzy: Config.launcher.useFuzzy.actions
-
- Variants {
- id: variants
-
- model: Config.launcher.actions.filter(a => (a.enabled ?? true) && (Config.launcher.enableDangerousActions || !(a.dangerous ?? false)))
-
- Action {}
- }
-
- component Action: QtObject {
- required property var modelData
- readonly property string name: modelData.name ?? qsTr("Unnamed")
- readonly property string desc: modelData.description ?? qsTr("No description")
- readonly property string icon: modelData.icon ?? "help_outline"
- readonly property list<string> command: modelData.command ?? []
- readonly property bool enabled: modelData.enabled ?? true
- readonly property bool dangerous: modelData.dangerous ?? false
-
- function onClicked(list: AppList): void {
- if (command.length === 0)
- return;
-
- if (command[0] === "autocomplete" && command.length > 1) {
- list.search.text = `${Config.launcher.actionPrefix}${command[1]} `;
- } else if (command[0] === "setMode" && command.length > 1) {
- list.visibilities.launcher = false;
- Colours.setMode(command[1]);
- } else {
- list.visibilities.launcher = false;
- Quickshell.execDetached(command);
- }
- }
- }
-}
diff --git a/modules/launcher/services/M3Variants.qml b/modules/launcher/services/M3Variants.qml
deleted file mode 100644
index 963a4d4..0000000
--- a/modules/launcher/services/M3Variants.qml
+++ /dev/null
@@ -1,85 +0,0 @@
-pragma Singleton
-
-import ".."
-import qs.config
-import qs.utils
-import Quickshell
-import QtQuick
-
-Searcher {
- id: root
-
- function transformSearch(search: string): string {
- return search.slice(`${Config.launcher.actionPrefix}variant `.length);
- }
-
- list: [
- Variant {
- variant: "vibrant"
- icon: "sentiment_very_dissatisfied"
- name: qsTr("Vibrant")
- description: qsTr("A high chroma palette. The primary palette's chroma is at maximum.")
- },
- Variant {
- variant: "tonalspot"
- icon: "android"
- name: qsTr("Tonal Spot")
- description: qsTr("Default for Material theme colours. A pastel palette with a low chroma.")
- },
- Variant {
- variant: "expressive"
- icon: "compare_arrows"
- name: qsTr("Expressive")
- description: qsTr("A medium chroma palette. The primary palette's hue is different from the seed colour, for variety.")
- },
- Variant {
- variant: "fidelity"
- icon: "compare"
- name: qsTr("Fidelity")
- description: qsTr("Matches the seed colour, even if the seed colour is very bright (high chroma).")
- },
- Variant {
- variant: "content"
- icon: "sentiment_calm"
- name: qsTr("Content")
- description: qsTr("Almost identical to fidelity.")
- },
- Variant {
- variant: "fruitsalad"
- icon: "nutrition"
- name: qsTr("Fruit Salad")
- description: qsTr("A playful theme - the seed colour's hue does not appear in the theme.")
- },
- Variant {
- variant: "rainbow"
- icon: "looks"
- name: qsTr("Rainbow")
- description: qsTr("A playful theme - the seed colour's hue does not appear in the theme.")
- },
- Variant {
- variant: "neutral"
- icon: "contrast"
- name: qsTr("Neutral")
- description: qsTr("Close to grayscale, a hint of chroma.")
- },
- Variant {
- variant: "monochrome"
- icon: "filter_b_and_w"
- name: qsTr("Monochrome")
- description: qsTr("All colours are grayscale, no chroma.")
- }
- ]
- useFuzzy: Config.launcher.useFuzzy.variants
-
- component Variant: QtObject {
- required property string variant
- required property string icon
- required property string name
- required property string description
-
- function onClicked(list: AppList): void {
- list.visibilities.launcher = false;
- Quickshell.execDetached(["caelestia", "scheme", "set", "-v", variant]);
- }
- }
-}
diff --git a/modules/launcher/services/Schemes.qml b/modules/launcher/services/Schemes.qml
deleted file mode 100644
index dbb2dac..0000000
--- a/modules/launcher/services/Schemes.qml
+++ /dev/null
@@ -1,88 +0,0 @@
-pragma Singleton
-
-import ".."
-import qs.config
-import qs.utils
-import Quickshell
-import Quickshell.Io
-import QtQuick
-
-Searcher {
- id: root
-
- property string currentScheme
- property string currentVariant
-
- function transformSearch(search: string): string {
- return search.slice(`${Config.launcher.actionPrefix}scheme `.length);
- }
-
- function selector(item: var): string {
- return `${item.name} ${item.flavour}`;
- }
-
- function reload(): void {
- getCurrent.running = true;
- }
-
- list: schemes.instances
- useFuzzy: Config.launcher.useFuzzy.schemes
- keys: ["name", "flavour"]
- weights: [0.9, 0.1]
-
- Variants {
- id: schemes
-
- Scheme {}
- }
-
- Process {
- id: getSchemes
-
- running: true
- command: ["caelestia", "scheme", "list"]
- stdout: StdioCollector {
- onStreamFinished: {
- const schemeData = JSON.parse(text);
- const list = Object.entries(schemeData).map(([name, f]) => Object.entries(f).map(([flavour, colours]) => ({
- name,
- flavour,
- colours
- })));
-
- const flat = [];
- for (const s of list)
- for (const f of s)
- flat.push(f);
-
- schemes.model = flat.sort((a, b) => (a.name + a.flavour).localeCompare((b.name + b.flavour)));
- }
- }
- }
-
- Process {
- id: getCurrent
-
- running: true
- command: ["caelestia", "scheme", "get", "-nfv"]
- stdout: StdioCollector {
- onStreamFinished: {
- const [name, flavour, variant] = text.trim().split("\n");
- root.currentScheme = `${name} ${flavour}`;
- root.currentVariant = variant;
- }
- }
- }
-
- component Scheme: QtObject {
- required property var modelData
- readonly property string name: modelData.name
- readonly property string flavour: modelData.flavour
- readonly property var colours: modelData.colours
-
- function onClicked(list: AppList): void {
- list.visibilities.launcher = false;
- Quickshell.execDetached(["caelestia", "scheme", "set", "-n", name, "-f", flavour]);
- }
- }
-}