Add a tiny script to launch Thyme in some case

This commit is contained in:
Jeremy Gardais 2017-01-12 11:48:32 +01:00
parent d1db289e2a
commit e9405efd38
2 changed files with 30 additions and 0 deletions

View File

@ -10,11 +10,13 @@ Some useful scripts (for me) that can be added to $PATH :)
* firewall: A script shell to set some iptables rules. * firewall: A script shell to set some iptables rules.
* update-dynmotd.d/: scripts to update the motd (via the /etc/update-motd.d directory). * 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. * 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. * 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! * 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. * snapsend.sh: Send a ZFS snapshot to a remote host.
* tag_photo.sh: Add an exif tag to images. * tag_photo.sh: Add an exif tag to images.
* test_ssl3: Test if a website supportes the SSLV3 protocol. * 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. * veille.sh: Kill every sensitive process and files then lock the screen.
* vimmanpager: Tiny script can be used as PAGER, it will call VIM! * vimmanpager: Tiny script can be used as PAGER, it will call VIM!
* weblink: Tiny Python script that run a small webserver to share files. * 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 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 ### 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. Tiny Bash script that take a number between 0 and 20 as argument and transform it into a digit with into a circle.
```sh ```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" 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 ## Weblink
Python program that run a small webserver (BaseHTTPServer) to easily share some files. Python program that run a small webserver (BaseHTTPServer) to easily share some files.
* eg: * eg:

17
launch_thyme Executable file
View File

@ -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