Created
February 5, 2024 02:32
-
-
Save lidgnulinux/33a28be6a1352cb84d7c6c8b63b5a5c2 to your computer and use it in GitHub Desktop.
How to get cursor's coordinate on wayland.
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 | |
# Dependencies : | |
# - slurp (https://wayland.emersion.fr/slurp/). | |
# - awk. | |
# - cut. | |
# - sed. | |
# - Wayland compositor with layer_shell support. | |
# How to use : | |
# - Run this script on terminal ! | |
# - Click wherever spot you want ! | |
coordinate=$(slurp -b 00000000 -p | awk '{print $1}') | |
x_cord=$(echo $coordinate | cut -d ',' -f 1) | |
y_cord=$(echo $coordinate | sed -e 's/^.*,//g') | |
echo "$x_cord" "$y_cord" |
You may only need to run $> slurp -p
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Credit for @jgmdev (https://github.com/jgmdev/wl-color-picker).