import QtQuick import Quickshell import qs.Common import qs.Services import qs.Widgets import qs.Modules.Plugins PluginComponent { id: root property var enabledEmojis: pluginData.emojis || ["๐Ÿ˜Š", "๐Ÿ˜ข", "โค๏ธ"] property int cycleInterval: pluginData.cycleInterval || 3000 property int maxBarEmojis: pluginData.maxBarEmojis || 3 property int currentIndex: 0 property var displayedEmojis: [] Timer { interval: root.cycleInterval running: true repeat: true onTriggered: { if (root.enabledEmojis.length > 0) { root.currentIndex = (root.currentIndex + 1) % root.enabledEmojis.length root.updateDisplayedEmojis() } } } function updateDisplayedEmojis() { const maxToShow = Math.min(root.maxBarEmojis, root.enabledEmojis.length) let emojis = [] for (let i = 0; i < maxToShow; i++) { const idx = (root.currentIndex + i) % root.enabledEmojis.length emojis.push(root.enabledEmojis[idx]) } root.displayedEmojis = emojis } Component.onCompleted: { updateDisplayedEmojis() } onEnabledEmojisChanged: updateDisplayedEmojis() onMaxBarEmojisChanged: updateDisplayedEmojis() horizontalBarPill: Component { Row { id: emojiRow spacing: Theme.spacingXS Repeater { model: root.displayedEmojis StyledText { text: modelData font.pixelSize: Theme.fontSizeLarge } } } } verticalBarPill: Component { Column { id: emojiColumn spacing: Theme.spacingXS Repeater { model: root.displayedEmojis StyledText { text: modelData font.pixelSize: Theme.fontSizeMedium anchors.horizontalCenter: parent.horizontalCenter } } } } popoutContent: Component { PopoutComponent { id: popoutColumn headerText: "Emoji Picker" detailsText: "Click an emoji to copy it to clipboard" showCloseButton: true property var allEmojis: [ "๐Ÿ˜€", "๐Ÿ˜ƒ", "๐Ÿ˜„", "๐Ÿ˜", "๐Ÿ˜†", "๐Ÿ˜…", "๐Ÿคฃ", "๐Ÿ˜‚", "๐Ÿ™‚", "๐Ÿ™ƒ", "๐Ÿ˜‰", "๐Ÿ˜Š", "๐Ÿ˜‡", "๐Ÿฅฐ", "๐Ÿ˜", "๐Ÿคฉ", "๐Ÿ˜˜", "๐Ÿ˜—", "๐Ÿ˜š", "๐Ÿ˜™", "๐Ÿ˜‹", "๐Ÿ˜›", "๐Ÿ˜œ", "๐Ÿคช", "๐Ÿ˜", "๐Ÿค‘", "๐Ÿค—", "๐Ÿคญ", "๐Ÿคซ", "๐Ÿค”", "๐Ÿค", "๐Ÿคจ", "๐Ÿ˜", "๐Ÿ˜‘", "๐Ÿ˜ถ", "๐Ÿ˜", "๐Ÿ˜’", "๐Ÿ™„", "๐Ÿ˜ฌ", "๐Ÿคฅ", "๐Ÿ˜Œ", "๐Ÿ˜”", "๐Ÿ˜ช", "๐Ÿคค", "๐Ÿ˜ด", "๐Ÿ˜ท", "๐Ÿค’", "๐Ÿค•", "๐Ÿคข", "๐Ÿคฎ", "๐Ÿคง", "๐Ÿฅต", "๐Ÿฅถ", "๐Ÿ˜ถโ€๐ŸŒซ๏ธ", "๐Ÿ˜ต", "๐Ÿ˜ตโ€๐Ÿ’ซ", "๐Ÿคฏ", "๐Ÿค ", "๐Ÿฅณ", "๐Ÿ˜Ž", "๐Ÿค“", "๐Ÿง", "๐Ÿ˜•", "๐Ÿ˜Ÿ", "๐Ÿ™", "โ˜น๏ธ", "๐Ÿ˜ฎ", "๐Ÿ˜ฏ", "๐Ÿ˜ฒ", "๐Ÿ˜ณ", "๐Ÿฅบ", "๐Ÿ˜ฆ", "๐Ÿ˜ง", "๐Ÿ˜จ", "๐Ÿ˜ฐ", "๐Ÿ˜ฅ", "๐Ÿ˜ข", "๐Ÿ˜ญ", "๐Ÿ˜ฑ", "๐Ÿ˜–", "๐Ÿ˜ฃ", "๐Ÿ˜ž", "๐Ÿ˜“", "๐Ÿ˜ฉ", "๐Ÿ˜ซ", "๐Ÿฅฑ", "๐Ÿ˜ค", "๐Ÿ˜ก", "๐Ÿ˜ ", "๐Ÿคฌ", "โค๏ธ", "๐Ÿงก", "๐Ÿ’›", "๐Ÿ’š", "๐Ÿ’™", "๐Ÿ’œ", "๐Ÿ–ค", "๐Ÿค", "๐ŸคŽ", "๐Ÿ’”", "โค๏ธโ€๐Ÿ”ฅ", "โค๏ธโ€๐Ÿฉน", "๐Ÿ’•", "๐Ÿ’ž", "๐Ÿ’“", "๐Ÿ’—", "๐Ÿ’–", "๐Ÿ’˜", "๐Ÿ’", "๐Ÿ’Ÿ", "๐Ÿ‘", "๐Ÿ‘Ž", "๐Ÿ‘Š", "โœŠ", "๐Ÿค›", "๐Ÿคœ", "๐Ÿคž", "โœŒ๏ธ", "๐ŸคŸ", "๐Ÿค˜", "๐Ÿ‘Œ", "๐ŸคŒ", "๐Ÿค", "๐Ÿ‘ˆ", "๐Ÿ‘‰", "๐Ÿ‘†", "๐Ÿ‘‡", "โ˜๏ธ", "โœ‹", "๐Ÿคš" ] Item { width: parent.width implicitHeight: root.popoutHeight - popoutColumn.headerHeight - popoutColumn.detailsHeight - Theme.spacingXL DankGridView { id: emojiGrid anchors.horizontalCenter: parent.horizontalCenter width: Math.floor(parent.width / 50) * 50 height: parent.height clip: true cellWidth: 50 cellHeight: 50 model: popoutColumn.allEmojis delegate: StyledRect { width: 45 height: 45 radius: Theme.cornerRadius color: emojiMouseArea.containsMouse ? Theme.surfaceContainerHighest : Theme.surfaceContainerHigh border.width: 0 StyledText { anchors.centerIn: parent text: modelData font.pixelSize: Theme.fontSizeXLarge } MouseArea { id: emojiMouseArea anchors.fill: parent hoverEnabled: true cursorShape: Qt.PointingHandCursor onClicked: { Quickshell.execDetached(["sh", "-c", "echo -n '" + modelData + "' | wl-copy"]) ToastService.showInfo("Copied " + modelData + " to clipboard") popoutColumn.closePopout() } } } } } } } popoutWidth: 400 popoutHeight: 500 }