mirror of
https://github.com/He4eT/dotfiles.git
synced 2026-05-05 07:57:23 +00:00
binSeekCursor: working area reset
This commit is contained in:
parent
308626aabe
commit
5a82861304
1 changed files with 11 additions and 4 deletions
|
|
@ -1,5 +1,14 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
temp_file="/tmp/binSeekCursor"
|
||||||
|
|
||||||
|
# Reset working area
|
||||||
|
|
||||||
|
if [ "$1" == "reset" ]; then
|
||||||
|
rm $temp_file
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Fail fast: Check 'direction' parameter
|
# Fail fast: Check 'direction' parameter
|
||||||
|
|
||||||
if [ "$1" != "up" ] && [ "$1" != "right" ] && [ "$1" != "down" ] && [ "$1" != "left" ]; then
|
if [ "$1" != "up" ] && [ "$1" != "right" ] && [ "$1" != "down" ] && [ "$1" != "left" ]; then
|
||||||
|
|
@ -7,10 +16,6 @@ if [ "$1" != "up" ] && [ "$1" != "right" ] && [ "$1" != "down" ] && [ "$1" != "l
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Init
|
|
||||||
|
|
||||||
temp_file="/tmp/binSeekCursor"
|
|
||||||
|
|
||||||
# Current cursor position: $X and $Y
|
# Current cursor position: $X and $Y
|
||||||
|
|
||||||
eval $(xdotool getmouselocation --shell)
|
eval $(xdotool getmouselocation --shell)
|
||||||
|
|
@ -51,6 +56,7 @@ move_cursor_to_horizontal_center() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set the working area borders based on the direction
|
# Set the working area borders based on the direction
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"up")
|
"up")
|
||||||
working_area_down=$Y
|
working_area_down=$Y
|
||||||
|
|
@ -71,6 +77,7 @@ case "$1" in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Write timestamp and working area to the temporary file
|
# Write timestamp and working area to the temporary file
|
||||||
|
|
||||||
echo "" > $temp_file
|
echo "" > $temp_file
|
||||||
echo "working_area_left=$working_area_left" >> $temp_file
|
echo "working_area_left=$working_area_left" >> $temp_file
|
||||||
echo "working_area_top=$working_area_top" >> $temp_file
|
echo "working_area_top=$working_area_top" >> $temp_file
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue