Advertisement
Guest User

Untitled

a guest
Aug 29th, 2018
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.63 KB | None | 0 0
  1. #!/bin/zsh
  2.  
  3. dir=$(bspc query -T -n focused | jshon -e presel | jshon -e splitDir | tr -d \")
  4. ratio=$(bspc query -T -n focused | jshon -e presel | jshon -e splitRatio)
  5.  
  6. case "$dir" in
  7.         west|east)
  8.         cur=$(bspc query -T -n focused | jshon -e rectangle | jshon -e width)
  9.         bspc node @east -r -$((${cur}-${cur}*${ratio})) || bspc node @west -r +$((${cur}-${cur}*${ratio}))
  10.         ;;
  11.  
  12.         north|south)
  13.         cur=$(bspc query -T -n focused | jshon -e rectangle | jshon -e height)
  14.         bspc node @south -r -$((${cur}-${cur}*${ratio})) || bspc node @north -r +$((${cur}-${cur}*${ratio}))
  15. esac
  16.  
  17. cancel_presels
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement