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