added icons + README, MVP finished
45
README.md
Normal file
@ -0,0 +1,45 @@
|
||||
kpsync
|
||||
======
|
||||
|
||||
A small util to launch keepassXC while the database file is on a remote webDAV server (e.g. Nextcloud).
|
||||
|
||||
# Usage
|
||||
|
||||
1. simply start `kpsync`
|
||||
2. On first start a example config in `~/.config/kpsync.json` will be created, probably needs to be edited
|
||||
3. Afterwards start it again
|
||||
|
||||
# Functionality
|
||||
|
||||
kpsync starts by downloading the latest db file from the webDAV to the (configured) temp directory
|
||||
(if there already exists a local file, matching with the server version (via ETag), the download will be skipped)
|
||||
|
||||
If teh download fails, teh user gets the option to open a local (fallback) file (e.g. if the computer has no network)
|
||||
|
||||
Then KeepassXC is launched.
|
||||
|
||||
The temp directory is being watched (inotify) and on file changes they are uploaded to the server.
|
||||
|
||||
If there are conflicts (e.g. two clients editing the file at the same time) we ask the user what to do (via `notify-send`)
|
||||
|
||||
# Prerequisites
|
||||
|
||||
Tested on Linux + Arch + KDE.
|
||||
|
||||
Needs `notify-send` to send desktop notifications.
|
||||
Needs `inotify` to watch the directory for changes.
|
||||
Needs `keepassxc` to be installed. duh.
|
||||
|
||||
# Config (example)
|
||||
|
||||
```json
|
||||
{
|
||||
"webdav_url": "https://cloud.example.com/remote.php/dav/files/YourUser/example.kdbx",
|
||||
"webdav_user": "user",
|
||||
"webdav_pass": "hunter2",
|
||||
"local_fallback": "/home/user/example.kdbx",
|
||||
"work_dir": "/tmp/kpsync",
|
||||
"debounce": 3500,
|
||||
"terminal_emulator": "konsole -e"
|
||||
}
|
||||
```
|
25
app/tray.go
@ -16,20 +16,28 @@ func (app *Application) initTray() {
|
||||
|
||||
systray.SetIcon(assets.IconInit)
|
||||
systray.SetTitle("KeepassXC Sync")
|
||||
app.currSysTrayTooltip = "Initializing..."
|
||||
app.currSysTrayTooltip = "KPSync | " + "Initializing..."
|
||||
systray.SetTooltip(app.currSysTrayTooltip)
|
||||
|
||||
miSync := systray.AddMenuItem("Sync Now (checked)", "")
|
||||
miSyncForce := systray.AddMenuItem("Sync Now (forced)", "")
|
||||
miShowLogFifo := systray.AddMenuItem("Show Log (fifo)", "")
|
||||
miShowLogFile := systray.AddMenuItem("Show Log (file)", "")
|
||||
systray.AddMenuItem("", "")
|
||||
|
||||
systray.AddMenuItem("", "").Disable()
|
||||
|
||||
app.trayItemChecksum = systray.AddMenuItem("Checksum: {...}", "")
|
||||
app.trayItemETag = systray.AddMenuItem("ETag: {...}", "")
|
||||
app.trayItemLastModified = systray.AddMenuItem("LastModified: {...}", "")
|
||||
systray.AddMenuItem("", "")
|
||||
|
||||
systray.AddMenuItem("", "").Disable()
|
||||
|
||||
miQuit := systray.AddMenuItem("Quit", "")
|
||||
|
||||
app.trayItemChecksum.Disable()
|
||||
app.trayItemETag.Disable()
|
||||
app.trayItemLastModified.Disable()
|
||||
|
||||
app.LogDebug("SysTray initialized")
|
||||
app.LogLine()
|
||||
|
||||
@ -87,7 +95,8 @@ func (app *Application) setTrayState(txt string, icon []byte) func() {
|
||||
defer app.masterLock.Unlock()
|
||||
|
||||
systray.SetIcon(icon)
|
||||
systray.SetTooltip(txt)
|
||||
app.currSysTrayTooltip = "KPSync | " + txt
|
||||
systray.SetTooltip(app.currSysTrayTooltip)
|
||||
|
||||
var finDone = false
|
||||
|
||||
@ -104,7 +113,7 @@ func (app *Application) setTrayState(txt string, icon []byte) func() {
|
||||
}
|
||||
|
||||
systray.SetIcon(assets.IconDefault)
|
||||
app.currSysTrayTooltip = "Sleeping..."
|
||||
app.currSysTrayTooltip = "KPSync | " + "Sleeping..."
|
||||
systray.SetTooltip(app.currSysTrayTooltip)
|
||||
|
||||
finDone = true
|
||||
@ -122,7 +131,9 @@ func (app *Application) setTrayStateDirect(txt string, icon []byte) {
|
||||
defer app.masterLock.Unlock()
|
||||
|
||||
systray.SetIcon(icon)
|
||||
systray.SetTooltip(txt)
|
||||
|
||||
app.currSysTrayTooltip = "KPSync | " + txt
|
||||
systray.SetTooltip(app.currSysTrayTooltip)
|
||||
}
|
||||
|
||||
func (app *Application) setTrayTooltip(txt string) {
|
||||
@ -134,6 +145,6 @@ func (app *Application) setTrayTooltip(txt string) {
|
||||
defer app.masterLock.Unlock()
|
||||
|
||||
systray.SetTooltip(txt)
|
||||
app.currSysTrayTooltip = txt
|
||||
app.currSysTrayTooltip = "KPSync | " + txt
|
||||
systray.SetTooltip(app.currSysTrayTooltip)
|
||||
}
|
||||
|
BIN
assets/icon.xcf
Normal file
Before Width: | Height: | Size: 323 B After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 307 B After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 316 B After Width: | Height: | Size: 905 B |
Before Width: | Height: | Size: 358 B After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 448 B After Width: | Height: | Size: 1.7 KiB |