resize 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. coded_by='
  3. In the name of Allah, the most Gracious, the most Merciful.
  4. ▓▓▓▓▓▓▓▓▓▓
  5. ░▓ Author ▓ Abdullah <https://abdullah.today>
  6. ░▓▓▓▓▓▓▓▓▓▓
  7. ░░░░░░░░░░
  8. ░█▀▄░█▀▀░█▀▀░▀█▀░▀▀█░█▀▀░░░█░█░▀█▀░█▀█░█▀▄░█▀█░█░█░█▀▀
  9. ░█▀▄░█▀▀░▀▀█░░█░░▄▀░░█▀▀░░░█▄█░░█░░█░█░█░█░█░█░█▄█░▀▀█
  10. ░▀░▀░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀▀▀░░░▀░▀░▀▀▀░▀░▀░▀▀░░▀▀▀░▀░▀░▀▀▀
  11. '
  12. if bspc query -N -n focused.floating > /dev/null; then
  13. step=50
  14. else
  15. step=100
  16. fi
  17. case "$1" in
  18. west) dir=right; falldir=left; x="-$step"; y=0;;
  19. east) dir=right; falldir=left; x="$step"; y=0;;
  20. north) dir=top; falldir=bottom; x=0; y="-$step";;
  21. south) dir=top; falldir=bottom; x=0; y="$step";;
  22. esac
  23. bspc node -z "$dir" "$x" "$y" || bspc node -z "$falldir" "$x" "$y"
  24. # vim: ft=sh