dotfiles/.local/bin/tools/hover
Alexander Bocken 6907760e58
various changes
modified:   .config/coc/history.json
	modified:   .config/gtk-2.0/gtkfilechooser.ini
	modified:   .config/newsboat/config
	modified:   .config/nvim/init.vim
	modified:   .config/qutebrowser/autoconfig.yml
	modified:   .config/qutebrowser/qsettings/QtProject.conf
	modified:   .config/zsh/.zshrc
	modified:   .local/bin/castscreen
	modified:   .local/bin/dmenuvpn
	modified:   .local/bin/statusbar/internet
	deleted:    .local/bin/tools/bright
	modified:   .local/bin/tools/ce
	modified:   .local/bin/tools/hover
	modified:   .local/bin/tools/ripper
	modified:   .local/bin/tools/startmpv
	modified:   .zprofile
2020-10-28 13:48:43 +01:00

19 lines
878 B
Bash
Executable File

#!/bin/sh
[ -z "$1" ] && exit # If $1 is left, hovers in the bottom left, if right, the bottom right
current=$(xdotool getwindowfocus)
newwidth=$(( 2 * $(xdotool getdisplaygeometry | awk '{print $1}') / 5))
newheight=$(( 2 * $(xdotool getdisplaygeometry | awk '{print $2}') / 5))
borderwidth=1
case "$1" in
left) horizontal=borderwidth;
vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newheight - 2 * borderwidth )) ;;
right) horizontal=$(($(xdotool getdisplaygeometry | awk '{print $1}') - newwidth - 2 * borderwidth ))
vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newheight - 2 * borderwidth )) ;;
esac
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$horizontal,$vertical,$newwidth,$newheight
#xdotool windowsize "$current" $newwidth $newheight
#xdotool windowmove "$current" $horizontal $vertical