https://github.com/3ynm/window_activity
Captures window activity and saves to a SQLite database
https://github.com/3ynm/window_activity
activity-log activity-logger logger
Last synced: 3 months ago
JSON representation
Captures window activity and saves to a SQLite database
- Host: GitHub
- URL: https://github.com/3ynm/window_activity
- Owner: 3ynm
- License: unlicense
- Created: 2017-11-08T14:02:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-08T14:03:52.000Z (over 7 years ago)
- Last Synced: 2024-08-18T04:15:01.785Z (9 months ago)
- Topics: activity-log, activity-logger, logger
- Language: Shell
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# window_activity.sh
```
./window_activity.sh
```Captures window activity and saves to a SQLite database.
## Requirements
- xprop
- [SQLite](https://sqlite.org)## Configuration
### Environment variables
- `WINDOW_ACTIVITY_DATABASE_PATH` defaults to `$HOME/.window_activity.sqlite`: Set database path
## Installation
It's a good idea to copy it in a place in your `$PATH`, like `/usr/local/bin`.
## Wishlist
- Save last window activity, it's lost because data is captured on active windows changes
- Detect changes in titles, as it's captured by active window change, title changes (Eg. browser tab change) are in the same window, so not detected
- Wayland support?## Useful SQL queries
### Count seconds per window in a date range
```
SELECT process_name as Process, window_title as Window,
SUM(until - since) as Seconds
FROM activity
WHERE since >= strftime('%s','2017-10-01 00:00:00')
AND until < strftime('%s','2017-11-01 00:00:00')
GROUP BY Window
ORDER BY Seconds DESC;
```