linuxmint / sticky

A sticky notes app for the linux desktop
GNU General Public License v2.0
182 stars 38 forks source link

Command Line Options? #3

Open ChristianSilvermoon opened 3 years ago

ChristianSilvermoon commented 3 years ago

It would be pretty nice if it were possible to pass arguments to the program for a variety of functions.

Being able to create, remove, get the contents of, and set the contents of sticky notes, (and groups?) as well as possibly positioning them from command-line arguments would allow users to script certain things.

Imagine, for example, a script that automatically updates a sticky note with a checklist?

This would be very, very useful, in my opinion.

collinss commented 3 years ago

So, what exactly would be the use case for this? Because the notes are stored in plain text (json), so you could just as easily write a script to edit the file where the notes are stored if all you want is to create a new note with certain contents. Are you looking at having this script running on a timer or do you just want to be able to create a new note from a template, or is it something else entirely?

ChristianSilvermoon commented 3 years ago

Oh, I see! I actually didn't know that (I'm not really versed in the language it's written in or anything, I just noted the lack of any command-line arguments and thought 'hmm, but if it had them, it could be useful')

I'm thinking mostly in theoretical uses, but mostly just some way to read/create/update notes from an external program

Use cases I could imagine would be:

A script reacting to sticky notes is already possible by periodically reading the notes.json, but Sticky doesn't seem to respond to any changes written to notes.json.

Admittedly, if it did, that would basically open the door to exactly what I was thinking

Just seems very handy to possibly be able to give check boxes on sticky notes functionality through scripting, or to be able to have say... a script maybe display the last time a particular thing was completed.

I do hope I'm not being a bother with this (I'm very new to issues and such on repos other than my own), it just seemed like a neat idea

EDIT: I just realized calling it again maintains a singular instance of Sticky while updating all the notes from notes.json so I guess this is already possible. Huh,

collinss commented 3 years ago

I do hope I'm not being a bother with this (I'm very new to issues and such on repos other than my own), it just seemed like a neat idea

No worries, I'm just hesitant to implement command-line arguments because it's not very accessible to the average user. The automatic creation of notes, for example, is something I can see others wanting, who may not know how to write a script. If that feature is written directly into the code (or perhaps as a plugin), then it potentially serves more users.

Sticky doesn't seem to respond to any changes written to notes.json.

Yeah, I intentionally didn't implement a listener because, so far i haven't needed it, and I didn't want the extra overhead if I didn't need it.

ChristianSilvermoon commented 3 years ago

That makes a lot of sense and I can totally understand that. I might be a little overly technical sometimes, but yeah, that's not really what the average user's going to need/want.

I personally tend to use a mix of both graphical and command-line programs and tend to really enjoy automating things, so the idea of being able to interact with sticky notes via a shell or script always seems appealing to me

areographe commented 3 years ago

hey, i see in #8 there's an issue for a keybinding. i often use global shortcut super+N on windows to create a new note using onenote's desktop app, and i was hoping to recreate that in cinnamon. when sticky is minimised to tray, if there was a way to call sticky from the command-line with a flag that would raise it and create a new note and focus that, i could bind the keyboard shortcut to that command. otherwise if it's hard to find a default keybinding to implement the shortcut in sticky itself, could the function be implemented but switched off by default and just left for the user to set their actual custom key combination, so it won't interfere with any user except one like myself who needs that feature?

Iss-in commented 2 years ago

I would love cli options to be able to

it would really helps a lot for automating this tool to work better with the workflow.

Sticky Notes imo should be something that could be accessed and discarded in a fly, that's the biggest appeal of them, otherwise I would rather use a note taking app instead. pls look into implementing this, these cli options are present in every other sticky notes ( xpad, indiacator-stickynotes etc ) . I love the ui/ux of this app, best of all the sticky apps I've used, without cli options, app feels a bit handicapped

ChristianSilvermoon commented 2 years ago

I would love cli options to be able to

* toggle notes, like `sticky --toggle` to show and hide all the sticky notes opened

* open a new note, like 'sticky --new' to create a new note on fly anytime you want

* notes should reflect all the changes written in notes.json, will help in automating a lots of tasks, can update date/time, other routines info autimatically

it would really helps a lot for automating this tool to work better with the workflow. sticky Notes imo should be something that could be accessed and discarded in a fly, that's the biggest appeal of them, otherwise I would rather use a note taking app instead. pls look into implementing this, these cli options which are present in every other sticky notes ( xpad, indiacator-stickynotes etc ) . I love the ui/ux of this app, best of all the sticky apps I've used, without them, app feels a bit handicapped

Actually, now that you mention it, this would also be really great for mapping Keyboard Shortcuts using Cinnamon's Settings Panel too.

63BeetleSmurf commented 2 years ago

Had a bit of free time so implemented the suggested toggle and new options: https://github.com/63BeetleSmurf/sticky/tree/dev_command_line

It is actually quite handy having the keyboard shortcuts setup.

The exact behaviour may need tweaked as currently; Calling sticky --new when it's not running opens everything up. Should it start sticky with everything hidden, just the manager window hidden or is it right to show all? Calling --new if the note are hidden shows only the new note. Should it bring all the hidden notes back?

Also are there any other commands that would be useful to have?

@collinss what's your thoughts on this in general, is it worth perusing?

benyaminl commented 1 year ago

@collinss I think most of useful way to make it useful for average user is, make the sticky hidden or show using keyboard shortcut, via cli, is that against the linux mint use? Thank you

collinss commented 1 year ago

I think I would prefer to do it over dbus rather than cli. It seems like a more elegant solution to me as it would still allow cli commands (eg. via dbus-send), but would also allow the commands to be sent directly over dbus as well. It would also allow the sender to ensure that the app is connected before sending the command, which might be useful in some cases.