File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,21 @@ export XAUTHORITY=$HOME/.Xauthority
1111# Check status of screensaver - if it's running, do nothing.
1212if gnome-screensaver-command -q | grep inactive > /dev/null; then
1313 # If the screensaver isn't running, log the title of the active window
14- xwininfo -id ` xdotool getactivewindow` | grep Window\ id | logger
15- # This command lists the tabs that have been opened in the current firefox session.
16- # grep -Eo '"entries":\[{"url":"[^"]*"' /home/jgilmore/.mozilla/firefox/*.default/sessionstore.js | sed 's/^.*:"//; s/"$//'
17- # Saved here for possible future reference
14+ ACTIVE=` xdotool getactivewindow`
15+ TITLE=` xwininfo -id $ACTIVE | grep ' xwininfo:' | cut -c 32-`
16+ if echo " $TITLE " | grep ' "Minecraft"' ; then
17+ # If minecraft is being played via my launch script (which displays the usename in the titlebar of the shell)
18+ # Log that instead of the active window's title
19+ MINE=` xdotool search --title ' minecraft being played by\:' `
20+ if [ -n " $MINE " ]; then
21+ # If we can't figure out which user, just log "Minecraft"
22+ TITLE=` xwininfo -id $MINE | grep ' xwininfo:' | cut -c 32-`
23+ fi
24+ # This command lists the tabs that have been opened in the current firefox session.
25+ # grep -Eo '"entries":\[{"url":"[^"]*"' /home/jgilmore/.mozilla/firefox/*.default/sessionstore.js | sed 's/^.*:"//; s/"$//'
26+ # Saved here for possible future reference
27+ fi
28+ logger -t activitylog -p local4.info -- " $TITLE "
1829fi
1930
2031
You can’t perform that action at this time.
0 commit comments