You are not logged in.

#1 2022-07-07 08:07:59

John Path
Member
Registered: 2021-10-15
Posts: 57

bspc command not working with echo

Hi,

Just ran into a problem with bspc and echo

following command shows error

➜  bspc node -z $(echo "right -20 0")
node -z: Not enough arguments.

but the following command get executed successfully

➜  bspc node -z right -20 0

I am trying to do the following in my sxhkd conf but solving the above problem will solve the problem below.

# Expand/contract a window by moving one of its side outward/inward
super + alt +{h,j,k,l}
    STEP=20; SELECTION={1,2,3,4}; \
    bspc node -z $(echo "left -$STEP 0,bottom 0 $STEP,top 0 -$STEP,right $STEP 0" | cut -d',' -f$SELECTION) || \
    bspc node -z $(echo "right -$STEP 0,top 0 $STEP,bottom 0 -$STEP,left $STEP 0" | cut -d',' -f$SELECTION)

Offline

#2 2022-07-07 08:38:34

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,552

Re: bspc command not working with echo

bspc node -z {left,bottom,top,right} -$STEP 0 || bspc node -z {right,top,bottom,left} $STEP 0

?

Offline

#3 2022-07-08 07:40:40

John Path
Member
Registered: 2021-10-15
Posts: 57

Re: bspc command not working with echo

seth wrote:
bspc node -z {left,bottom,top,right} -$STEP 0 || bspc node -z {right,top,bottom,left} $STEP 0

?

It also shows not enough arguments

node -z: Not enough arguments.

Even though it would have been successful as you have passed  "-$STEP 0" and "$STEP 0", it is actually X-axis and Y-axis (kinda) and you are passing Y as 0 in all argument.
Hope you understand it.

The problem is still not solved.

Offline

#4 2022-07-08 08:20:31

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,552

Re: bspc command not working with echo

What if you hardcode the step?

bspc node -z {left,bottom,top,right} -20 0 || bspc node -z {right,top,bottom,left} 20 0

Offline

#5 2022-07-08 13:59:20

John Path
Member
Registered: 2021-10-15
Posts: 57

Re: bspc command not working with echo

seth wrote:

What if you hardcode the step?

bspc node -z {left,bottom,top,right} -20 0 || bspc node -z {right,top,bottom,left} 20 0

Its not doing anything on my machine. its not showing any error message as well.

super + alt + {h,j,k,l}
    bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0} || \
     bspc node -z {right -20 0,top 0 20,bottom 0 -20, left 20 0}

Above hard coding works but not properly.
Like imagine i have 4 window open
          |         
    1    |    2
-------------------
     3   |   4         
          |

where 1,2,3 and 4 represent a window.

i can resize my window 1 with super + alt + {h,j,l} {decrease size of window in x direction, increase size of window in x direction and increase size of window in y direction} works as expected
but while i use super + alt + k it decrease the window size in x direction instead of decreasing window size in y direction.

Also i can increase the size window 2 in x direction but cannot decrease the size of window in x direction. I can increase the size of window 2 in y direction but pressing super + alt + k does nothing on window 2

I know it is confusing it should be clear after rereading it and also thanks for trying to help me out.

Offline

Board footer

Powered by FluxBB