Last active
June 24, 2024 11:07
-
-
Save zax4r0/ff818396b8fcca92ade4174606608995 to your computer and use it in GitHub Desktop.
scripts
This file contains hidden or 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/sh | |
############### | |
# Cycle windows | |
# (C) 2024 zax4r0 <[email protected]> | |
# GNU General Public License v3.0 | |
############### | |
timer_file=$(dirname $(realpath "$0"))"/alt_tab_timer.txt" | |
if [[ $(( $(date +%s%N | cut -b1-13 ) - $(cat "$timer_file") )) -ge 1000 ]] | |
then | |
xdotool keydown alt | |
fi | |
date +%s%N | cut -b1-13 > "$timer_file" | |
case "$@" in | |
shift) | |
xdotool key Shift+Tab | |
;; | |
*) | |
xdotool key Tab | |
;; | |
esac | |
sleep 1 | |
if [[ $(( $(date +%s%N | cut -b1-13) - $(cat "$timer_file") )) -ge 1000 ]] | |
then | |
xdotool keyup alt | |
fi |
This file contains hidden or 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
1715926185780 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment