vixalien / sticky

A simple sticky notes app for GNOME
https://flathub.org/apps/details/com.vixalien.sticky
MIT License
193 stars 30 forks source link

Feature request: add a 'New Note' entry to Desktop's context menu #126

Open joaocandre opened 4 months ago

joaocandre commented 4 months ago

Gnome Shell's Desktop's context menu is, in my opinion, entirely redundant, and adding a 'New Note' option would add some practical utility to it.

Alternatively, a Gnome Shell extension that placed the '+' button on the panel would also be useful.

vixalien commented 4 months ago

Pull requests are appreciated !!

I believe one just need to edit the desktop file since you can already launch com.vixalien.sticky -n to launch a new note.

On Thu, 23 May 2024 at 03:27, João André @.***> wrote:

Gnome Shell's Desktop's context menu is, in my opinion, entirely redundant, and adding a 'New Note' option would add some practical utility to it.

Alternatively, a Gnome Shell extension that placed the '+' button on the panel would also be useful.

— Reply to this email directly, view it on GitHub https://github.com/vixalien/sticky/issues/126, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJB5FCKPADI6FMM6JORKYMDZDVAZBAVCNFSM6AAAAABIEVRVCGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGMYTCNZVHA3DGMY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

joaocandre commented 4 months ago

I have little to no experience in Gnome development, but I can look into it once I find the time.

(likely will start by reverse engineering some simple extension to implement this)

joaocandre commented 4 months ago

com.vixalien.sticky -n to launch a new note.

after testing, that doesn't seem to work, I only get:

Gjs-Console-Message: 02:44:23.000: Storing Notes at: ~/.local/share/com.vixalien.sticky/notes

the same goes for com.vixalien.sticky -i. I do get a notification of 'Sticky Notes is ready' though.

vixalien commented 4 months ago

I do get a notification of 'Sticky Notes is ready' though.

You probably already have Sticky Notes running.

joaocandre commented 4 months ago

Indeed it does seem the case, but I wasn't sure if that was the planned behavior or a bug; I was able to override the desktop context menu through a simple Gnome Shell extension, but, as it stands, it needs to close all open notes before creating a new one, and as a result the open/closed status of each note is lost:

Screenshot from 2024-06-03 01-47-04

Nevertheless, adding a new note through the '+' button and through the CLI leads to two very different outcomes, which I think can be improved upon.

In any case, I may submit a PR with it or just extend the extension with additional features, such as nautilus integration and a panel indicator.

vixalien commented 4 months ago

The issue seems to arise from how GIO works. When you run the command line command, GTK doesn’t know what instance you’re referring to. It instead recognizes that there is an existing application instance of Sticky Notes and launches that instead.

I’ll be trying to work on this soon.

On Mon, 3 Jun 2024 at 15:54, João André @.***> wrote:

Indeed it does seem the case, but I wasn't sure if that was the planned behavior or a bug; I was able to override the desktop context menu through a simple Gnome Shell extension, but, as it stands, needs to close all open notes before creating a new one, and as a result the open/closed status of each note is lost: Screenshot.from.2024-06-03.01-47-04.png (view on web) https://github.com/vixalien/sticky/assets/1812344/72c24de8-0447-4b6f-8e80-b73da18113da

Nevertheless, adding a new note through the '+' button and through the CLI leads to two very different outcomes, which I think can be improved upon.

In any case, I may submit a PR with it or just extend the extension with additional features, such as nautilus integration and a panel indicator.

— Reply to this email directly, view it on GitHub https://github.com/vixalien/sticky/issues/126#issuecomment-2145265930, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJB5FCJ6DIRBG3TISE6RSJLZFRYQDAVCNFSM6AAAAABIEVRVCGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBVGI3DKOJTGA . You are receiving this because you commented.Message ID: @.***>

joaocandre commented 3 months ago

I submitted a PR to update the desktop file of the app to add the 'New Note' action, but that only updates the extra options on the app launcher (e.g. secondary click on the dash); seems to me that the general/main background context menu is very much WM-dependent, so it's perhaps best to approach this on a case-by-case basis, even this is a GTK app and thus the Gnome ecosystem can be assumed.

In any case, the Gnome extension I mentioned implements this option in the background menu (and moves the note to the cursor position), in addition to other features like a general purpose panel indicator. An extension ends up being simpler to write (no need to delve into the app's extensive code base) and easier to debug.

I haven't thoroughly tested it, but it works well enough at the moment. Naturally you're welcome to review it!

vixalien commented 3 months ago

the general/main background context menu

what does this mean?

joaocandre commented 3 months ago

the context menu you get when you right click on the desktop background; GJS calls it a background menu.

vixalien commented 3 months ago

this thing?

image

joaocandre commented 3 months ago

Yes, that extension updates it to this.