Skip to content

Instantly share code, notes, and snippets.

@jose-lopes
Created January 27, 2020 23:22
Show Gist options
  • Save jose-lopes/0e0aa1d7576ba113418d0287d068f6ac to your computer and use it in GitHub Desktop.
Save jose-lopes/0e0aa1d7576ba113418d0287d068f6ac to your computer and use it in GitHub Desktop.
Rofi menu to start/stop hamster tracker
#!/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