bottomleft/right combined to hover
This commit is contained in:
parent
05f46122b5
commit
40084275f5
3 changed files with 7 additions and 27 deletions
|
@ -155,10 +155,10 @@ bindsym $mod+v exec --no-startup-id $term -e $EDITOR -c "VimwikiIndex"
|
||||||
#bindsym $mod+Shift+v
|
#bindsym $mod+Shift+v
|
||||||
|
|
||||||
bindsym $mod+b bar mode toggle
|
bindsym $mod+b bar mode toggle
|
||||||
bindsym $mod+Shift+b floating toggle; sticky toggle; exec --no-startup-id bottomleft
|
bindsym $mod+Shift+b floating toggle; sticky toggle; exec --no-startup-id hover left
|
||||||
|
|
||||||
bindsym $mod+n exec $term -e newsboat && pkill -RTMIN+6 i3blocks
|
bindsym $mod+n exec $term -e newsboat && pkill -RTMIN+6 i3blocks
|
||||||
bindsym $mod+Shift+n floating toggle; sticky toggle; exec --no-startup-id bottomright
|
bindsym $mod+Shift+n floating toggle; sticky toggle; exec --no-startup-id hover right
|
||||||
|
|
||||||
bindsym $mod+m exec --no-startup-id $term -e ncmpcpp
|
bindsym $mod+m exec --no-startup-id $term -e ncmpcpp
|
||||||
bindsym $mod+Shift+m exec --no-startup-id lmc mute
|
bindsym $mod+Shift+m exec --no-startup-id lmc mute
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# This script move the selected window to the bottom left of the screen.
|
|
||||||
current=$(xdotool getwindowfocus)
|
|
||||||
|
|
||||||
# The window will take up no more than a third of
|
|
||||||
# the width or height of the screen.
|
|
||||||
newwidth=$(($(xdotool getdisplaygeometry | awk '{print $2}') / 3))
|
|
||||||
newheight=$(($(xdotool getdisplaygeometry | awk '{print $1}') / 3))
|
|
||||||
|
|
||||||
xdotool windowsize "$current" $newheight $newwidth
|
|
||||||
|
|
||||||
newsize=$(xdotool getwindowgeometry "$current" | grep Geometry | sed -e 's/x/ /g' | awk '{print $3}')
|
|
||||||
|
|
||||||
height=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize))
|
|
||||||
xdotool windowmove "$current" 0 $height
|
|
|
@ -1,18 +1,14 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
[ -z "$1" ] && exit # If $1 is left, hovers in the bottom left, if right, the bottom right
|
||||||
# This script move the selected window to the bottom left of the screen.
|
|
||||||
current=$(xdotool getwindowfocus)
|
current=$(xdotool getwindowfocus)
|
||||||
|
|
||||||
# The window will take up no more than a third of
|
|
||||||
# the width or height of the screen.
|
|
||||||
newwidth=$(($(xdotool getdisplaygeometry | awk '{print $2}') / 3))
|
newwidth=$(($(xdotool getdisplaygeometry | awk '{print $2}') / 3))
|
||||||
newheight=$(($(xdotool getdisplaygeometry | awk '{print $1}') / 3))
|
newheight=$(($(xdotool getdisplaygeometry | awk '{print $1}') / 3))
|
||||||
|
|
||||||
xdotool windowsize "$current" $newheight $newwidth
|
xdotool windowsize "$current" $newheight $newwidth
|
||||||
|
|
||||||
newsize=$(xdotool getwindowgeometry "$current" | grep Geometry | sed -e 's/x/ /g' | awk '{print $3}')
|
newsize=$(xdotool getwindowgeometry "$current" | grep Geometry | sed -e 's/x/ /g' | awk '{print $3}')
|
||||||
newwidth=$(xdotool getwindowgeometry "$current" | grep Geometry | grep -o " [0-9]*")
|
newwidth=$(xdotool getwindowgeometry "$current" | grep Geometry | grep -o " [0-9]*")
|
||||||
|
|
||||||
vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize))
|
case "$1" in
|
||||||
horizontal=$(($(xdotool getdisplaygeometry | awk '{print $1}') - newwidth))
|
left) horizontal=0; vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize)) ;;
|
||||||
|
right) horizontal=$(($(xdotool getdisplaygeometry | awk '{print $1}') - newwidth)) ; vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize)) ;;
|
||||||
|
esac
|
||||||
xdotool windowmove "$current" $horizontal $vertical
|
xdotool windowmove "$current" $horizontal $vertical
|
Loading…
Reference in a new issue