Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions watermark@mantve/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Watermark
======================

Displays a custom text as a watermark on your desktop

## Changelog

### v1.0.0
* Initial release
* Add watermark font and shadow options
63 changes: 63 additions & 0 deletions watermark@mantve/files/watermark@mantve/desklet.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
const Desklet = imports.ui.desklet;
const St = imports.gi.St;
const Settings = imports.ui.settings;
const Pango = imports.gi.Pango;

class WatermarkDesklet extends Desklet.Desklet {
constructor(metadata, desklet_id) {
super(metadata, desklet_id);

this.settings = new Settings.DeskletSettings(this, this.metadata.uuid, desklet_id);

const onSettingsChanged = this.on_settings_changed.bind(this);
this.settings.bind("title_text", "title_text", onSettingsChanged);
this.settings.bind("subtitle_text", "subtitle_text", onSettingsChanged);
this.settings.bind("font_setting", "font_setting", onSettingsChanged);
this.settings.bind("text_opacity", "text_opacity", onSettingsChanged);
this.settings.bind("subtitle_scale", "subtitle_scale", onSettingsChanged);
this.settings.bind("enable_shadow", "enable_shadow", onSettingsChanged);

this.setupUI();
}

setupUI() {
this.windowContainer = new St.BoxLayout({
vertical: true,
});

this.title_label = new St.Label();
this.subtitle_label = new St.Label();

this.windowContainer.add_actor(this.title_label);
this.windowContainer.add_actor(this.subtitle_label);

this.setContent(this.windowContainer);
this.on_settings_changed();
}

_applyTextStyle(label, text, fontFamily, fontSize) {
const style =
`font-family: '${fontFamily}'; ` +
`font-size: ${fontSize}px; ` +
`color: rgba(255, 255, 255, ${this.text_opacity}); ` +
`${this.enable_shadow ? 'text-shadow: 0 0 2px rgba(0, 0, 0, 0.6);' : ''}`;

label.set_text(text);
label.set_style(style);
}

on_settings_changed() {
const fontDescription = Pango.font_description_from_string(this.font_setting);
const fontFamily = fontDescription.get_family();
const fontSize = fontDescription.get_size() / Pango.SCALE;

this._applyTextStyle(this.title_label, this.title_text, fontFamily, fontSize);

const subtitleSize = Math.round(fontSize * this.subtitle_scale);
this._applyTextStyle(this.subtitle_label, this.subtitle_text, fontFamily, subtitleSize);
}
}

function main(metadata, desklet_id) {
return new WatermarkDesklet(metadata, desklet_id);
}
Binary file added watermark@mantve/files/watermark@mantve/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions watermark@mantve/files/watermark@mantve/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"max-instances": "10",
"description": "Displays a custom text as a watermark",
"name": "Watermark",
"version": "1.0.0",
"uuid": "watermark@mantve",
"author": "mantve",
"prevent-decorations": true
}
54 changes: 54 additions & 0 deletions watermark@mantve/files/watermark@mantve/po/watermark@mantve.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# WATERMARK
# This file is put in the public domain.
# mantve, 2026
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: watermark@mantve 0.1\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-desklets/"
"issues\n"
"POT-Creation-Date: 2026-03-14 23:41+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#. metadata.json->description
msgid "Displays a custom text as a watermark"
msgstr ""

#. metadata.json->name
msgid "Watermark"
msgstr ""

#. settings-schema.json->layout->description
msgid "Text Configuration"
msgstr ""

#. settings-schema.json->title_text->description
msgid "Main title text"
msgstr ""

#. settings-schema.json->subtitle_text->description
msgid "Subtitle text"
msgstr ""

#. settings-schema.json->font_setting->description
msgid "Font and Size"
msgstr ""

#. settings-schema.json->enable_shadow->description
msgid "Enable text shadow"
msgstr ""

#. settings-schema.json->subtitle_scale->description
msgid "Subtitle relative size"
msgstr ""

#. settings-schema.json->text_opacity->description
msgid "Transparency"
msgstr ""
42 changes: 42 additions & 0 deletions watermark@mantve/files/watermark@mantve/settings-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"layout": {
"type": "header",
"description": "Text Configuration"
},
"title_text": {
"type": "entry",
"default": "Activate Linux",
"description": "Main title text"
},
"subtitle_text": {
"type": "entry",
"default": "Go to Settings to activate Linux.",
"description": "Subtitle text"
},
"font_setting": {
"type": "fontchooser",
"default": "Noto Sans 24",
"description": "Font and Size"
},
"enable_shadow": {
"type": "checkbox",
"default": true,
"description": "Enable text shadow"
},
"subtitle_scale": {
"type": "scale",
"default": 0.73,
"min": 0.01,
"max": 1.0,
"step": 0.01,
"description": "Subtitle relative size"
},
"text_opacity": {
"type": "scale",
"default": 0.4,
"min": 0.1,
"max": 1.0,
"step": 0.01,
"description": "Transparency"
}
}
Empty file.
3 changes: 3 additions & 0 deletions watermark@mantve/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"author": "mantve"
}
Binary file added watermark@mantve/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading