Created
January 27, 2020 23:22
-
-
Save jose-lopes/0e0aa1d7576ba113418d0287d068f6ac to your computer and use it in GitHub Desktop.
Rofi menu to start/stop hamster tracker
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
#!/bin/bash | |
current=$(hamster current | sed 's|^[^ ]\+ [^ ]\+ \(.*\) [^ ]\+$|\1|' | sed 's|@Unsorted|@|') | |
selected=$(hamster activities | rofi -dmenu -i -select "$current" -p "Select task") | |
[ -z "$selected" ] && exit | |
if [ "$current" == "$selected" ]; then | |
hamster stop | |
dunstify -a "hamster" "Stop activity $selected" | |
else | |
hamster start "$selected" | |
dunstify -a "hamster" "Start activity $selected" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment