tuteken / Keypirinha-Plugin-Ditto

This plugin for Keypirinha provides access to saved items in Ditto Clipboard Manager.
15 stars 2 forks source link

Default database file setting to default Ditto database file path #2

Closed ueffel closed 3 years ago

ueffel commented 7 years ago

It would be nice if the ditto package would work out of the box with a default ditto installation without any configuration. My suggestion would be to set the default database path to the default path of the ditto database with the following code changes:

ditto.py:

...
import os
...
DEFAULT_DATABASE_FILE = "{}/Ditto/Ditto.db".format(os.environ.get('APPDATA'))

ditto.ini:

...
[main]
...
#database_file = ${env:APPDATA}/Ditto/Ditto.db

Think about it :)

polyvertex commented 7 years ago

If I may and since environment vars are not always reliable, something along those lines would be safer and slightly more pedantic (untested so there might be a typo):

ditto.py:

import keypirinha_wintypes as kpwt
import os.path

DEFAULT_DATABASE_FILE = os.path.join(kpwt.get_known_folder_path(kpwt.FOLDERID.RoamingAppData),
                                     "Ditto", "Ditto.db")

ditto.ini:

[main]
#database_file = ${var:KNOWNFOLDER_ROAMINGAPPDATA}
tuteken commented 3 years ago

Thank you for your interest in this project. I have stopped using Keypirinha and will be archiving this repository.