Skip to content

Commit 860bf85

Browse files
feat: rice selector with two-step rice+wallpaper picker
Adds a dedicated RiceSelector to the Quickshell launcher that lets the user pick a rice and one of its own wallpapers in two guided steps before applying. Triggered with "> rice " in the launcher. Backend: - dots-appearance list now includes wallpapers[] per rice - dots-appearance apply supports --wallpaper <path> flag Launcher (new): - RiceWallpaperItem.qml: carousel item for plain string paths - RiceSelector.qml: two-step component (rice list → wallpaper carousel) Launcher (updated): - ContentList: "riceSelector" state + Loader - Content: Enter/Escape handling for both steps - AppearanceItem: 40×22px preview.png thumbnail - AppearancesSection: 56×32px preview.png thumbnail in Control Center Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat/rice-selector: feat(launcher): add preview.png thumbnails to appearance items feat(launcher): integrate RiceSelector into ContentList and Content feat(launcher): add RiceSelector two-step rice+wallpaper picker feat(launcher): add RiceWallpaperItem for RiceSelector carousel feat(launcher): expose preview and wallpapers in Appearances service feat(appearance): add --wallpaper flag to dots-appearance apply feat(appearance): add wallpapers[] array to dots-appearance list output
2 parents eb2bb01 + a3c44d3 commit 860bf85

11 files changed

Lines changed: 632 additions & 55 deletions

File tree

home/dot_config/quickshell/modules/controlcenter/appearance/sections/AppearancesSection.qml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import "../../../launcher/services"
55
import qs.components
66
import qs.components.controls
77
import qs.components.containers
8+
import qs.components.images
89
import qs.services
910
import qs.config
1011
import Quickshell
@@ -65,6 +66,24 @@ CollapsibleSection {
6566

6667
spacing: Appearance.spacing.normal
6768

69+
Loader {
70+
active: (modelData.preview ?? "") !== ""
71+
Layout.alignment: Qt.AlignVCenter
72+
73+
sourceComponent: StyledClippingRect {
74+
implicitWidth: 56
75+
implicitHeight: 32
76+
radius: Appearance.rounding.small
77+
color: Colours.tPalette.m3surfaceContainer
78+
79+
CachingImage {
80+
anchors.fill: parent
81+
path: modelData.preview ?? ""
82+
cache: true
83+
}
84+
}
85+
}
86+
6887
MaterialIcon {
6988
text: Appearances.styleIcon(modelData.style || "")
7089
font.pointSize: Appearance.font.size.large

home/dot_config/quickshell/modules/launcher/Content.qml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,24 @@ Item {
8282
placeholderText: qsTr("Type \"%1\" for commands").arg(Config.launcher.actionPrefix)
8383

8484
onAccepted: {
85+
if (list.showRiceSelector) {
86+
const rs = list.riceSelector;
87+
if (!rs)
88+
return;
89+
if (rs.step === "wallpapers") {
90+
const wp = rs.currentWallpaperPath;
91+
if (wp) {
92+
if (Colours.scheme === "dynamic")
93+
Wallpapers.previewColourLock = true;
94+
Quickshell.execDetached(["dots-appearance", "apply", rs.selectedRice.id, "--wallpaper", wp]);
95+
root.visibilities.launcher = false;
96+
}
97+
} else {
98+
rs.confirmCurrentRice();
99+
}
100+
return;
101+
}
102+
85103
const currentItem = list.currentList?.currentItem;
86104
if (currentItem) {
87105
if (list.showWallpapers) {
@@ -104,7 +122,12 @@ Item {
104122
Keys.onUpPressed: list.currentList?.decrementCurrentIndex()
105123
Keys.onDownPressed: list.currentList?.incrementCurrentIndex()
106124

107-
Keys.onEscapePressed: root.visibilities.launcher = false
125+
Keys.onEscapePressed: {
126+
if (list.showRiceSelector && list.riceSelector?.step === "wallpapers")
127+
list.riceSelector.goBack();
128+
else
129+
root.visibilities.launcher = false;
130+
}
108131

109132
Keys.onPressed: event => {
110133
if (!Config.launcher.vimKeybinds)

home/dot_config/quickshell/modules/launcher/ContentList.qml

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@ Item {
1919
required property int padding
2020
required property int rounding
2121

22+
readonly property bool showRiceSelector: search.text.startsWith(`${Config.launcher.actionPrefix}rice `)
2223
readonly property bool showWallpapers: search.text.startsWith(`${Config.launcher.actionPrefix}wallpaper `)
23-
readonly property Item currentList: showWallpapers ? wallpaperList.item : appList.item
24+
readonly property Item currentList: showRiceSelector ? riceSelectorLoader.item?.currentList ?? null : showWallpapers ? wallpaperList.item : appList.item
25+
readonly property var riceSelector: riceSelectorLoader.item
2426

2527
anchors.horizontalCenter: parent.horizontalCenter
2628
anchors.bottom: parent.bottom
2729

2830
clip: true
29-
state: showWallpapers ? "wallpapers" : "apps"
31+
state: showRiceSelector ? "riceSelector" : showWallpapers ? "wallpapers" : "apps"
3032

3133
states: [
3234
State {
@@ -51,6 +53,15 @@ Item {
5153
root.implicitHeight: Config.launcher.sizes.wallpaperHeight
5254
wallpaperList.active: true
5355
}
56+
},
57+
State {
58+
name: "riceSelector"
59+
60+
PropertyChanges {
61+
root.implicitWidth: riceSelectorLoader.item?.implicitWidth ?? Config.launcher.sizes.itemWidth
62+
root.implicitHeight: Math.min(root.maxHeight, riceSelectorLoader.item?.implicitHeight ?? Config.launcher.sizes.wallpaperHeight)
63+
riceSelectorLoader.active: true
64+
}
5465
}
5566
]
5667

@@ -104,6 +115,21 @@ Item {
104115
}
105116
}
106117

118+
Loader {
119+
id: riceSelectorLoader
120+
121+
active: false
122+
123+
anchors.fill: parent
124+
125+
sourceComponent: RiceSelector {
126+
search: root.search
127+
visibilities: root.visibilities
128+
panels: root.panels
129+
content: root.content
130+
}
131+
}
132+
107133
Row {
108134
id: empty
109135

@@ -117,7 +143,7 @@ Item {
117143
anchors.verticalCenter: parent.verticalCenter
118144

119145
MaterialIcon {
120-
text: root.state === "wallpapers" ? "wallpaper_slideshow" : "manage_search"
146+
text: root.state === "wallpapers" ? "wallpaper_slideshow" : root.state === "riceSelector" ? "palette" : "manage_search"
121147
color: Colours.palette.m3onSurfaceVariant
122148
font.pointSize: Appearance.font.size.extraLarge
123149

@@ -128,7 +154,7 @@ Item {
128154
anchors.verticalCenter: parent.verticalCenter
129155

130156
StyledText {
131-
text: root.state === "wallpapers" ? qsTr("No wallpapers found") : qsTr("No results")
157+
text: root.state === "wallpapers" ? qsTr("No wallpapers found") : root.state === "riceSelector" ? qsTr("No appearances found") : qsTr("No results")
132158
color: Colours.palette.m3onSurfaceVariant
133159
font.pointSize: Appearance.font.size.larger
134160
font.weight: 500

0 commit comments

Comments
 (0)