-
Notifications
You must be signed in to change notification settings - Fork 214
[Desklet] Add Cartomancy Vibe (@vibe)#1730
[Desklet] Add Cartomancy Vibe (@vibe)#1730porquenelosdos wants to merge 1 commit intolinuxmint:masterfrom
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new Cinnamon desklet called "Cartomancy Vibe" that provides a card-pulling experience for cartomancy (fortune-telling with playing cards). Users can click on the desklet to draw a random playing card, which displays the card image along with a poetic interpretation. The desklet also plays sound effects when cards are drawn.
Changes:
- Added a new desklet with required file structure (info.json, metadata.json, README.md, desklet.js, icon, screenshot)
- Implemented card drawing functionality with 52 playing cards and corresponding poetic interpretations
- Included card images (PNG files) for all standard playing cards plus jokers
- Added sound effects (shuffle and flip sounds) for enhanced user experience
Reviewed changes
Copilot reviewed 4 out of 62 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| cartomancy@vibe/info.json | Contains author information for the spice |
| cartomancy@vibe/README.md | Project documentation with installation instructions and features |
| cartomancy@vibe/screenshot.png | Screenshot demonstrating the desklet in action |
| cartomancy@vibe/files/cartomancy@vibe/metadata.json | Desklet metadata including UUID, name, and description |
| cartomancy@vibe/files/cartomancy@vibe/desklet.js | Main JavaScript implementation with UI setup and card drawing logic |
| cartomancy@vibe/files/cartomancy@vibe/icon.png | Desklet icon |
| cartomancy@vibe/files/cartomancy@vibe/images/*.png | 52 playing card images plus joker cards (54 total) |
| cartomancy@vibe/files/cartomancy@vibe/sounds/*.wav | Sound effect files for shuffle and flip actions |
| { | ||
| "uuid": "cartomancy@vibe", | ||
| "name": "Cartomancy Vibe", | ||
| "description": "Click to draw a card", | ||
| "prevent-resizing": false, | ||
| "icon": "icon" | ||
| } |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The metadata.json file is missing a "version" field, which is present in other desklets in the repository. It's recommended to add a "version" field to track versioning, for example: "version": "1.0"
| }); | ||
|
|
||
| this.label.clutter_text.line_wrap = true; | ||
| this.label.clutter_text.line_wrap_mode = 2; |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The line_wrap_mode value is hardcoded as 2. This should use the Pango constant instead for clarity and maintainability. The proper way to set this would be to import and use: imports.gi.Pango.WrapMode.WORD (which equals 2). While the code will work, using the constant makes the intent clearer.
| GLib.spawn_command_line_async('paplay ' + soundPath + 'flip.wav'); | ||
| return false; | ||
| }); | ||
| } catch(e) {} |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The empty catch block silently swallows all errors when playing sounds. While this may be intentional to prevent crashes if sound isn't available, it makes debugging difficult. Consider at least logging the error with global.logError(e) so administrators can diagnose issues if sounds aren't working.
| } catch(e) {} | |
| } catch(e) { | |
| global.logError('Error while playing card sounds: ' + e); | |
| } |
| "King_spade": "A powerful man with stern command,\nWho rules with law across the land.\nHe judges all with iron truth,\nFrom aged man to reckless youth." | ||
| }; | ||
|
|
||
| let cardTitle = n + " of " + s + "s"; |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The card title generation at line 117 creates grammatically incorrect plurals for some suits. For example, "2 of diamonds" is correct, but the code will generate "2 of diamonds" (which is actually correct). However, for face cards like "King of hearts", it should be "King of Hearts" (capitalized). Consider capitalizing the suit name or using a proper pluralization: s.charAt(0).toUpperCase() + s.slice(1) + 's'
| let cardTitle = n + " of " + s + "s"; | |
| let displayName = n.charAt(0).toUpperCase() + n.slice(1); | |
| let displaySuit = s.charAt(0).toUpperCase() + s.slice(1) + "s"; | |
| let cardTitle = displayName + " of " + displaySuit; |
| 3. Right-click your desktop -> **Add Desklets** -> Find **Cartomancy Desklet** and click **+**. | ||
|
|
||
| ## License | ||
| This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The README references a LICENSE file that doesn't exist in the PR. Either the LICENSE file should be added, or this line should be removed/modified.
| This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. | |
| This project is licensed under the MIT License. |
| A vibe-heavy coding project built to bring the art of cartomancy to the Cinnamon desktop. This desklet displays [describe what it does, e.g., daily card pulls, mystical quotes, or tarot meanings]. | ||
|
|
||
| ## Features | ||
| * **Daily Insights:** Get a new card pull every time you start your desk. |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling: "desk" should be "desktop" in the context "every time you start your desk". The sentence should read "every time you start your desktop" or better yet, should be rewritten to describe the actual click-to-draw functionality.
| * **Daily Insights:** Get a new card pull every time you start your desk. | |
| * **Daily Insights:** Draw a new card with a simple click on the desklet. |
| GLib.spawn_command_line_async('paplay ' + soundPath + 'shuffle.wav'); | ||
| GLib.timeout_add(GLib.PRIORITY_DEFAULT, 250, () => { | ||
| GLib.spawn_command_line_async('paplay ' + soundPath + 'flip.wav'); |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sound file paths are constructed without proper shell escaping. If the metadata.path contains spaces or special characters, the command could fail or behave unexpectedly. Use GLib.shell_quote() to properly escape the path: 'paplay ' + GLib.shell_quote(soundPath + 'shuffle.wav')
| GLib.spawn_command_line_async('paplay ' + soundPath + 'shuffle.wav'); | |
| GLib.timeout_add(GLib.PRIORITY_DEFAULT, 250, () => { | |
| GLib.spawn_command_line_async('paplay ' + soundPath + 'flip.wav'); | |
| GLib.spawn_command_line_async('paplay ' + GLib.shell_quote(soundPath + 'shuffle.wav')); | |
| GLib.timeout_add(GLib.PRIORITY_DEFAULT, 250, () => { | |
| GLib.spawn_command_line_async('paplay ' + GLib.shell_quote(soundPath + 'flip.wav')); |
| @@ -0,0 +1,21 @@ | |||
| # Cartomancy Desklet for Linux Mint | |||
|
|
|||
| A vibe-heavy coding project built to bring the art of cartomancy to the Cinnamon desktop. This desklet displays [describe what it does, e.g., daily card pulls, mystical quotes, or tarot meanings]. | |||
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description contains placeholder text "[describe what it does, e.g., daily card pulls, mystical quotes, or tarot meanings]" that should be replaced with actual content describing what the desklet does.
| A vibe-heavy coding project built to bring the art of cartomancy to the Cinnamon desktop. This desklet displays [describe what it does, e.g., daily card pulls, mystical quotes, or tarot meanings]. | |
| A vibe-heavy coding project built to bring the art of cartomancy to the Cinnamon desktop. This desklet displays a daily cartomancy card draw with a brief mystical interpretation directly on your desktop. |
| A vibe-heavy coding project built to bring the art of cartomancy to the Cinnamon desktop. This desklet displays [describe what it does, e.g., daily card pulls, mystical quotes, or tarot meanings]. | ||
|
|
||
| ## Features | ||
| * **Daily Insights:** Get a new card pull every time you start your desk. |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The feature description "Get a new card pull every time you start your desk" is misleading. Based on the code, clicking the desklet draws a random card, not starting the desktop. This should be corrected to accurately describe the click-to-draw functionality.
| * **Daily Insights:** Get a new card pull every time you start your desk. | |
| * **Daily Insights:** Click the desklet to pull a new random card whenever you like. |
| const poems = { | ||
| "ace_heart": "A house of warmth, a cup filled high,\nNew love beneath a summer sky.\nThe hearth is lit, the door is wide,\nWith peace and joy to dwell inside.", | ||
| "2_heart": "Two paths converge, two hearts align,\nA promise made by ancient design.\nIn quiet trust and shared delight,\nYour burdens now are feeling light.", | ||
| "3_heart": "Raise up the glass, the news is sweet,\nA circle of friends is now complete.\nA celebration, a happy song,\nTo the place where you belong.", | ||
| "4_heart": "Roots grow deep in fertile ground,\nWhere quiet, steady love is found.\nA solid base, a home so dear,\nNo storms of doubt shall venture near.", | ||
| "5_heart": "The scenery shifts, the road is new,\nA different world comes into view.\nLeave the familiar far behind,\nFor treasures that you've yet to find.", | ||
| "6_heart": "A ghost of kindness from the past,\nA childhood shadow, long and cast.\nA hand reached out from yesterday,\nTo guide you on your current way.", | ||
| "7_heart": "A thousand dreams within your reach,\nMore than any book can teach.\nBut pick with care the path you tread,\nLest you follow whims instead.", | ||
| "8_heart": "The party fades, the candles die,\nYou walk away without a sigh.\nFor though the room was filled with grace,\nYou seek a more profound place.", | ||
| "9_heart": "The Star of Wishes, bright and clear,\nBrings the thing you hold most dear.\nA victory won, a dream made real,\nThe turning of the fortune wheel.", | ||
| "10_heart": "The family gathered 'round the flame,\nNo more to worry, no more to blame.\nA legacy of love so deep,\nA promise that the heavens keep.", | ||
| "Jack_heart": "A youth with eyes of summer blue,\nWho brings a message, bright and true.\nA romantic spirit, kind and bold,\nWhose loyalty is pure as gold.", | ||
| "Queen_heart": "The Mother-Spirit, soft and mild,\nWho treats the stranger as her child.\nWith intuition as her guide,\nShe keeps the flame of love inside.", | ||
| "King_heart": "The gentle ruler, wise and fair,\nWith silver in his noble hair.\nHe offers counsel, strength, and rest,\nA shelter for the weary guest.", | ||
| "ace_diamond": "A spark of light, a letter sent,\nTo tell you where the fire went.\nNew ventures bloom like desert flowers,\nIn these, your most productive hours.", | ||
| "2_diamond": "A coin for you, a coin for me,\nIn balanced, fair prosperity.\nA business deal, a debt repaid,\nThe foundations of your wealth are laid.", | ||
| "3_diamond": "The work begins to show its worth,\nA small sprout breaks the frozen earth.\nThough full success is yet to come,\nYou hear the beat of Fortune's drum.", | ||
| "4_diamond": "The vault is locked, the plan is set,\nYou have no reason for regret.\nWith discipline and careful hand,\nYou rule the riches of your land.", | ||
| "5_diamond": "A magnetism, sharp and bright,\nThat draws the people to your light.\nBut watch your words and keep your head,\nLest reckless things are done and said.", | ||
| "6_diamond": "The green-eyed ghost begins to peer,\nAt what you hold and keep so dear.\nLet go of spite and jealous thought,\nOr lose the peace that you have bought.", | ||
| "7_diamond": "The harvest moon is rising high,\nAcross the quiet autumn sky.\nFor every seed you dared to sow,\nA golden reward begins to show.", | ||
| "8_diamond": "Lay by a stone for rainy days,\nIn quiet, thrifty, humble ways.\nFor though the sun is shining now,\nThe winter waits behind the plow.", | ||
| "9_diamond": "A windfall comes from hands unknown,\nA seed of wealth you haven't sown.\nAn open door, a sudden gain,\nTo wash away the financial strain.", | ||
| "10_diamond": "The treasury is overflowing,\nWith every sign of success showing.\nSecurity for all your years,\nAnd end to all your earthly fears.", | ||
| "Jack_diamond": "A messenger of spirit's light,\nWho walks the halls of deep insight.\nA student of the hidden way,\nWho brings the news of a better day.", | ||
| "Queen_diamond": "With razor wit and steady gaze,\nShe navigates the worldly maze.\nAn independent, brilliant mind,\nThe smartest soul that you will find.", | ||
| "King_diamond": "The master of the golden trade,\nBy whom the great fortunes are made.\nRenown and honor, power and skill,\nA man of iron, glass, and will.", | ||
| "ace_club": "The ink is dry, the contract signed,\nA masterwork of human mind.\nA business starts, a seed is cast,\nA legacy that's built to last.", | ||
| "2_club": "Two hands that pull the heavy oar,\nTo reach a distant, golden shore.\nIn cooperation, work is light,\nAnd every future goal is bright.", | ||
| "3_club": "Look out across the wine-dark sea,\nTo see what your results shall be.\nThe ships are coming, sails are full,\nAgainst the tides of life they pull.", | ||
| "4_club": "A resting place, a stable wall,\nA structure that will never fall.\nThe community is gathered near,\nWith nothing left to doubt or fear.", | ||
| "5_club": "New faces join the table-round,\nNew alliances are quickly found.\nIn social circles, wide and vast,\nYou find a friend to hold at last.", | ||
| "6_club": "The banners wave, the trumpets sound,\nYour victory is now renowned.\nRecognition for the work you've done,\nBeneath the bright and midday sun.", | ||
| "7_club": "Against the world you take your stand,\nWith steady heart and steady hand.\nThough many challenge, you are right,\nA pillar in the darkest night.", | ||
| "8_club": "The arrow flies, the message speeds,\nTo satisfy your greatest needs.\nFast progress comes, a journey starts,\nTo gladden all our weary hearts.", | ||
| "9_club": "The barns are full of ripened grain,\nA shield against the wind and rain.\nMaterial gain and comfort deep,\nA promise that the earth will keep.", | ||
| "10_club": "A milestone reached, a journey's end,\nWith many miles around the bend.\nSuccess in travel, trade, and toil,\nUpon this rich and ancient soil.", | ||
| "Jack_club": "A youth of dark and steady eye,\nOn whom your trust can well rely.\nThrough thick and thin, through storm and gale,\nHis loyalty will never fail.", | ||
| "Queen_club": "A helpful hand, a dark-haired grace,\nWith kindness written on her face.\nShe manages the world with ease,\nAnd brings the spirit to its knees.", | ||
| "King_club": "A man of shadow, deep and strong,\nWho knows where every part belongs.\nA stable force, a quiet power,\nA refuge in a troubled hour.", | ||
| "ace_spade": "The winter's breath, a sharp decree,\nA sudden change sets spirit free.\nThe old must fall, the new must rise,\nWith honest sight and open eyes.", | ||
| "2_spade": "Two blades are crossed in silent truce,\nA temporary, fragile noose.\nSeek the peace while time allows,\nBefore the breaking of the vows.", | ||
| "3_spade": "Sharp words are spoken, hearts are torn,\nLike roses hidden by the thorn.\nA mental stress, a clouded mind,\nWith jagged edges left behind.", | ||
| "4_spade": "Lay down the sword, the fight is done,\nBeneath the cold and setting sun.\nA time for rest, a time to heal,\nUntil the turning of the wheel.", | ||
| "5_spade": "Accept the loss and walk away,\nTo fight upon another day.\nThere is no shame in leaving fast,\nWhen shadows of the past are cast.", | ||
| "6_spade": "The boat moves through the quiet mist,\nAway from all that does persist.\nTo calmer waters, shores of peace,\nWhere all the heavy tempests cease.", | ||
| "7_spade": "A secret plan, a hidden scheme,\nA shadow in a waking dream.\nUse caution now, and watch your back,\nAlong the lonely, winding track.", | ||
| "8_spade": "The iron bars are in your mind,\nNo other shackles do you find.\nStep forward through the open door,\nAnd be a prisoner no more.", | ||
| "9_spade": "A midnight fear, a sleepless eye,\nBeneath a dark and heavy sky.\nThe anxiety that haunts the soul,\nMust yield to spirit's self-control.", | ||
| "10_spade": "The lowest point, the end of pain,\nThere is no further loss to gain.\nFrom here the only way is up,\nTo drink from a different, brighter cup.", | ||
| "Jack_spade": "A clever youth with shifty glance,\nWho takes a wild and dangerous chance.\nA mind of mercury and steel,\nWho turns the secret, hidden wheel.", | ||
| "Queen_spade": "A lonely queen on marble throne,\nWho rules her kingdom all alone.\nAmbitious, sharp, and cold as ice,\nShe's paid a heavy, bitter price.", | ||
| "King_spade": "A powerful man with stern command,\nWho rules with law across the land.\nHe judges all with iron truth,\nFrom aged man to reckless youth." | ||
| }; |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The poems dictionary includes entries for all 52 playing cards, but the code references a "black_joker.png" file which exists in the images folder but has no corresponding poem entry. If a user were able to draw this card (though they currently can't based on the names/suits arrays), it would display "A card of mystery." Consider either removing the unused black_joker.png and red_joker.png files, or adding them to the drawable cards if they serve a purpose.