phenax / bsp-layout

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

reloading bsp-layout with no layout raises an error #43

Open amtoine opened 2 years ago

amtoine commented 2 years ago

I am testing out the script right now.

without any layout set with bsp-layout, running bsp-layout reload gives the following error:

ls: cannot access '/tmp/bsp-layout.state/desktops': No such file or directory

i think it would be nice to have a proper error message for the user! :yum:

what about something like the following? :slightly_smiling_face:

$ bsp-layout
No layout is currently registered by `bsp-layout` ('/tmp/bsp-layout.state/desktops' does not exist).
Try to register your first layout with `bsp-layout set`.
If the problem persists, please report the issue on https://github.com/phenax/bsp-layout/issues.
Terminating...
amtoine commented 2 years ago

that is an appropriate priority level :yum:

darkelectron commented 2 years ago

I think the error message might be too long. How about:

No layout is currently registered. Try to register your first layout with `bsp-layout set`.

If more info is required, like the tmp file path, verbose (does not exist yet) can be used.

amtoine commented 2 years ago

@darkelectron

I think the error message might be too long. How about:

yes you're right :thinking:

If more info is required, like the tmp file path, verbose (does not exist yet) can be used.

i like the idea of the --verbose flag :+1: