Skip to content

Instantly share code, notes, and snippets.

View TimBozeman's full-sized avatar

Tim Bozeman TimBozeman

View GitHub Profile
@TimBozeman
TimBozeman / superH
Created May 19, 2014 20:34
A script you can bind to a hotkey that toggles the Hamster Time Tracker window
#!/bin/bash
# @File Switch between current window and Hamster Time Tracker
# get current window
hamster="Time Tracker"
currentWindow=$(xprop -id $(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2) _NET_WM_NAME|cut -d'"' -f2)
if [ "${currentWindow}" != "$hamster" ]
# write the title of the current window to a file and switch to hamster
then echo "${currentWindow}" > /tmp/hamster.dat && wmctrl -Fa "$hamster"
# read window temp file and switch to it