-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
83 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# Helper script meant to be used to test aw-sync | ||
# Example of a single-entry for cronjobs and the like | ||
|
||
HOSTNAME="Teklas-Air.localdomain" | ||
SYNCDIR="~/ActivityWatchSync/tekla-air-m1" | ||
AWSYNCPARAMS="--port 5601 --sync-dir $SYNCDIR" | ||
HOSTNAME=$(hostnamectl --static) | ||
# TODO: Fetch in a cross-platform way (from aw-client command output?) | ||
AWSERVERCONF=~/.config/activitywatch/aw-server/aw-server.toml | ||
|
||
# trim everything in file AWSERVERCONF before '[server-testing]' section | ||
# grep for the aw-server port in aw-server.toml | ||
PORT=$(sed '/\[server-testing\]/,/\[.*\]/{//!d}' $AWSERVERCONF | grep -oP 'port = "\K[0-9]+') | ||
|
||
SYNCDIR="$HOME/ActivityWatchSync/$HOSTNAME" | ||
AWSYNCPARAMS="--port $PORT --sync-dir $SYNCDIR" | ||
|
||
# TODO: Fix supplying multiple buckets in a single command | ||
# NOTE: Only sync window and AFK buckets, for now | ||
cargo run --bin aw-sync -- $AWSYNCPARAMS sync --buckets aw-watcher-window_$HOSTNAME | ||
cargo run --bin aw-sync -- $AWSYNCPARAMS sync --buckets aw-watcher-afk_$HOSTNAME | ||
cargo run --bin aw-sync -- $AWSYNCPARAMS sync --buckets aw-watcher-window_$HOSTNAME,aw-watcher-afk_$HOSTNAME |