Skip to content

Instantly share code, notes, and snippets.

@budRich
Last active March 23, 2017 19:03
Show Gist options
  • Save budRich/0d8a14c81c35c9276c2300e0d6815904 to your computer and use it in GitHub Desktop.
Save budRich/0d8a14c81c35c9276c2300e0d6815904 to your computer and use it in GitHub Desktop.
i3ass-rcl
#!/bin/bash
eval $(xdotool getmouselocation --shell)
wname="$(xdotool getwindowname $WINDOW)"
if [ "$wname" = "i3" ]; then
notify-send "hello"
fi
# getmouselocation [--shell]
# Outputs the x, y, screen, and window id of the mouse cursor. Screen
# numbers will be nonzero if you have multiple monitors and are not
# using Xinerama.
# --shell
# This makes getmouselocation output shell data you can eval.
# Example:
# % xdotool getmouselocation --shell
# X=880
# Y=443
# SCREEN=0
# WINDOW=16777250
# % eval $(xdotool getmouselocation --shell)
# % echo $X,$Y
# 714,324
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment