phenax / bsp-layout

Manage layouts in bspwm (tall and wide)
MIT License
373 stars 30 forks source link

the once subcommand shows strange behaviour #44

Closed amtoine closed 2 years ago

amtoine commented 2 years ago

still testing the features of the script to understanding it better (@phenax note that my goal is not to open issues really, but to be able to solve the other ones and to tackle the PR reviews :wink:)

bsp-layout once appears to work quite well on the current desktop, but i get the following when trying to change once the layout on another desktop:

~ ❯ bsp-layout once monocle 2
grep: 2$: No such file or directory
bash: Layout [/usr/local/lib/bsp-layout/layouts/monocle.sh] does not exist: No such file or directory
bash: Layout [/usr/local/lib/bsp-layout/layouts/monocle.sh] does not exist: No such file or directory
bash: Layout [/usr/local/lib/bsp-layout/layouts/monocle.sh] does not exist: No such file or directory

which looks suspiciously close to the following real error, as the layout does not exist

~ ❯ bsp-layout once djalwkd 2
grep: 2$: No such file or directory
bash: Layout [/usr/local/lib/bsp-layout/layouts/djalwkd.sh] does not exist: No such file or directory
bash: Layout [/usr/local/lib/bsp-layout/layouts/djalwkd.sh] does not exist: No such file or directory
bash: Layout [/usr/local/lib/bsp-layout/layouts/djalwkd.sh] does not exist: No such file or directory

HOWEVER, even though it is true that /usr/local/lib/bsp-layout/layouts/monocle.sh does not exist, bsp-layout set monocle 2 does work fine :yum:

amtoine commented 2 years ago

And having a closer look at that, it looks like bsp-layout once * 2 is working... but on the current desktop only! 'cause the layout is changing, but on desktop 5 instead of the expected 2.

According to the man page of bsp-layout, this looks like a bug to me :wink:

phenax commented 2 years ago

I am unable to reproduce this issue from my end, can you confirm the script installed correctly and where all the files are installed?

amtoine commented 2 years ago

+ bsp-layout package: i'm not able to get the version from bsp-layout

~ ❯ bsp-layout version

but

~ ❯ pacman -Q | grep bsp-layout
bsp-layout 0.0.10-1

+ the files: below all the files installed with bsp-layout as, if i understood well, they should all go in /usr/

~ ❯ tree $(find bsp-layout /usr/)
 /usr/local/lib/bsp-layout
├──  layouts
│  ├──  even.sh
│  ├──  grid.sh
│  ├──  rgrid.sh
│  ├──  rtall.sh
│  ├──  rwide.sh
│  ├──  tall.sh
│  └──  wide.sh
├──  utils
│  ├──  common.sh
│  ├──  config.sh
│  ├──  desktop.sh
│  ├──  layout.sh
│  └──  state.sh
└──  layout.sh
 /usr/lib/bsp-layout
├──  layouts
│  ├──  even.sh
│  ├──  grid.sh
│  ├──  rgrid.sh
│  ├──  rtall.sh
│  ├──  rwide.sh
│  ├──  tall.sh
│  └──  wide.sh
├──  utils
│  ├──  common.sh
│  ├──  config.sh
│  ├──  desktop.sh
│  ├──  layout.sh
│  └──  state.sh
└──  layout.sh
 /usr/local/bin/bsp-layout -> /usr/local/lib/bsp-layout/layout.sh
 /usr/bin/bsp-layout -> /usr/lib/bsp-layout/layout.sh
 /usr/share/man/man1/bsp-layout.1
 /usr/local/man/man1/bsp-layout.1
phenax commented 2 years ago

@a2n-s let me know if #50 fixes this