From b01d3808b71c8fd428bf3a85c0d839dd8f6dc5aa Mon Sep 17 00:00:00 2001 From: Tykayn Date: Sun, 15 Oct 2023 11:41:49 +0200 Subject: [PATCH] add arbtt --- assets/arbtt/categorize.cfg | 25 +++++++++++++++++++++++++ assets/arbtt/update | 23 +++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 assets/arbtt/categorize.cfg create mode 100755 assets/arbtt/update diff --git a/assets/arbtt/categorize.cfg b/assets/arbtt/categorize.cfg new file mode 100644 index 0000000..e146fe5 --- /dev/null +++ b/assets/arbtt/categorize.cfg @@ -0,0 +1,25 @@ +-- -*- mode: haskell; -*- +$idle > 60 ==> tag inactive, +current window $program == ["urxvt", "Konsole"] ==> tag Graph:term, +current window $program == "emacs" && current window $title =~ /\.py/ ==> tag Graph:code-python, +current window $program == "emacs" && current window $title =~ /\.hs/ ==> tag Graph:code-haskell, +current window $program == "emacs" && current window $title =~ /\.rb/ ==> tag Graph:code-ruby, +current window $program == "emacs" && current window $title =~ /\.js|\.html|\.css/ ==> tag Graph:code-web, +current window $program == "emacs" && current window $title =~ /\.org|\.md|\.tex|\.txt/ ==> tag Graph:write, +current window $title =~ [/.*MATLAB.*/, /.*Figure.*/] ==> tag Graph:code-matlab, +current window $title =~ [m!Facebook!, m!Google+!, m!Twitter!] ==> tag Graph:social, +current window $title =~ [/.*Hacker News.*/, /.*Less Wrong.*/, /.*reddit.*/, /.*Reddit.*/, /.*GitHub.*/, /.*Ask.fm.*/, /.*Goodreads.*/, /.*Mastodon*/] ==> tag Graph:communities, +current window $title =~ /.*Ino[Rr]eader.*/ ==> tag Graph:read-rss, +current window $title =~ /Gmail|mutt|Protonmail/ ==> tag Graph:mail, +current window $title =~ [m!YouTube!, m!Vimeo!, m!videoplayback!, m!invidious!] ==> tag Graph:tv-web, +current window $program == ["Navigator", "chromium"] && !(current window $title =~ [m!YouTube!, m!Vimeo!, m!Facebook!, m!Google+!, m!Twitter!, /.*Hacker News.*/, /.*Less Wrong.*/, /.*[Rr]eddit.*/, /.*Goodreads.*/, /.*GitHub.*/, /.*Ask.fm.*/, /.*Ino[Rr]eader.*/, /.*Gmail.*/, /.*New\ Tab.*/]) ==> tag Graph:browsing, +current window $title =~ [/.*irssi.*/, /.*WeeChat.*/] ==> tag Graph:irc, +current window $title =~ /.*pdf.*/ ==> tag Graph:read-pdf, +current window $title =~ /.*djvu.*/ ==> tag Graph:read-djvu, +current window $title =~ /.*epub.*/ ==> tag Graph:read-epub, +current window $title =~ /.*mobi.*/ ==> tag Graph:read-mobi, +current window $title =~ /.*azw3.*/ ==> tag Graph:read-azw3, +current window $title =~ [m!mp4!, m!mkv!, m!avi!] ==> tag Graph:tv-local + + + diff --git a/assets/arbtt/update b/assets/arbtt/update new file mode 100755 index 0000000..6bded6d --- /dev/null +++ b/assets/arbtt/update @@ -0,0 +1,23 @@ +#!/bin/sh + +CATEGORIZE_FILE="./categorize.cfg" +CATEGORY="Graph" +FILTER="\$sampleage <= 2922:00" # Last 4 months + +arbtt-stats --categorizefile=$CATEGORIZE_FILE \ + --for-each=day \ + --output-format=CSV \ + --category=$CATEGORY \ + --min-percentage=0.1 \ + --filter="$FILTER" \ + > "/home/tykayn/Nextcloud/ressources/gestion de l information/arbtt/daily.csv" + +arbtt-stats --categorizefile=$CATEGORIZE_FILE \ + --for-each=minute \ + --output-format=CSV \ + --category=$CATEGORY \ + --min-percentage=0.1 \ + --filter="$FILTER" \ + > "/home/tykayn/Nextcloud/ressources/gestion de l information/arbtt/minute.csv" + +python3 readArbttStats.py -c 'misc' -d /tmp/daily.csv -m /tmp/minute.csv