dotfiles

beau's configuration files
git clone https://git.beauhilton.com/dotfiles.git
Log | Files | Refs | README

hover (846B)


      1 #!/usr/bin/env sh
      2 [ -z "$1" ] && exit # If $1 is left, hovers in the bottom left, if right, the bottom right
      3 current=$(xdotool getwindowfocus)
      4 newwidth=$(($(xdotool getdisplaygeometry | awk '{print $2}') / 3))
      5 newheight=$(($(xdotool getdisplaygeometry | awk '{print $1}') / 3))
      6 xdotool windowsize "$current" $newheight $newwidth
      7 newsize=$(xdotool getwindowgeometry "$current" | grep Geometry | sed -e 's/x/ /g' | awk '{print $3}')
      8 newwidth=$(xdotool getwindowgeometry "$current" | grep Geometry | grep -o " [0-9]*")
      9 
     10 case "$1" in
     11 	left) horizontal=0; vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize)) ;;
     12 	right) horizontal=$(($(xdotool getdisplaygeometry | awk '{print $1}') - newwidth)) ; vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize)) ;;
     13 esac
     14 xdotool windowmove "$current" $horizontal $vertical