From e9405efd3829f4193c7e0c1524a9abcc45c258f6 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Thu, 12 Jan 2017 11:48:32 +0100 Subject: [PATCH] Add a tiny script to launch Thyme in some case --- README.md | 13 +++++++++++++ launch_thyme | 17 +++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100755 launch_thyme diff --git a/README.md b/README.md index fedbd20..61e43fc 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,13 @@ Some useful scripts (for me) that can be added to $PATH :) * firewall: A script shell to set some iptables rules. * update-dynmotd.d/: scripts to update the motd (via the /etc/update-motd.d directory). * flac_to_mp3: convert all flac files of a directory into mp3. +* launch_thyme : Launch Thyme - apps tracker. * num_circle: Transform a number into a digit with a circle. * pomodoro: Print a task and a timer in a file. Try to apply Pomodoro Technique! * snapsend.sh: Send a ZFS snapshot to a remote host. * tag_photo.sh : Add an exif tag to images. * test_ssl3: Test if a website supportes the SSLV3 protocol. +* thyme : Automatically track which applications you use and for how long. * veille.sh: Kill every sensitive process and files then lock the screen. * vimmanpager: Tiny script can be used as PAGER, it will call VIM! * weblink: Tiny Python script that run a small webserver to share files. @@ -58,6 +60,10 @@ flac_to_mp3 /media/data/bisounours_land_v2 flac_to_mp3 /media/data/makarena.flac ``` +### Launch_thyme +A tiny script to launch Thyme (apps tracker) to be sure to avoid recording when the screen is lock,… + + ### Num_circle Tiny Bash script that take a number between 0 and 20 as argument and transform it into a digit with into a circle. ```sh @@ -130,6 +136,13 @@ You could also use a nmap command: nmap --script ssl-enum-ciphers -p 443 ldap.tld.org | grep "SSLv3: No supported ciphers found" ``` +### Thyme +A tracker to know which applications you use and for how long. It's just the binary from the [Github's repository][thyme repo]. + +I launch it with `launch_thyme` to avoid to record when the screen is lock. Everything is called with a Systemd unit (service and timer). + +[thyme repo]: https://github.com/sourcegraph/thyme + ## Weblink Python program that run a small webserver (BaseHTTPServer) to easily share some files. * eg: diff --git a/launch_thyme b/launch_thyme new file mode 100755 index 0000000..cf26d73 --- /dev/null +++ b/launch_thyme @@ -0,0 +1,17 @@ +#!/bin/sh + +# Thyme : track which applications you use and for how long +# https://github.com/sourcegraph/thyme + +THYME_PATH="/usr/local/bin/thyme" +THYME_LOG="${HOME}/.thyme/$(date +%Y%m%d).json" + +SCREEN_LOCKER="i3lock" + +if [ "$(pidof "${SCREEN_LOCKER}")" ]; then + exit 0 +else + "${THYME_PATH}" track -o "${THYME_LOG}" +fi + +exit 0