cmschuetz / btops

bspwm desktop management
MIT License
72 stars 8 forks source link

Allow specifying BSPWM socket #6

Open MyNameIsCosmo opened 5 years ago

MyNameIsCosmo commented 5 years ago

Currently, btops hard-codes the BSPWM_SOCKET path to /tmp/bspwm_0_0-socket https://github.com/cmschuetz/btops/blob/master/ipc/ipc.go#L11

bspwm allows for the BSPWM_SOCKET environment variable to be set, which will set the unix socket for bspwm to output to. https://github.com/baskerville/bspwm/blob/ab7e5abc260bfa555bc8407d7820b5dfafadf46e/doc/bspwm.1.asciidoc#environment-variables

This may change per user configuration, whether by the user passing an environment, or by the system configuration: /tmp/bspwm<host_name>_<display_number>_<screen_number>-socket

One solution would simply be to allow the user to set the BSPWM_SOCKET via environment variables. Reference: https://gobyexample.com/environment-variables