Closed jp1995 closed 3 years ago
Since the height of submenus is static, I'll add a fixed height to them with the -lines attribute.
If we display the title of the stream in the submenu, the width should scale depending on the length of that title.
I attempted to do this with the code that currently dynamically scales the expanded view in #7
WIDTH_SUB=$(jq -r ".streams[].channel | select(.display_name==\"$MAIN\") | .status" $MAIN_PATH/followdata.json | while read line; do echo -n "$line" | wc -m ; done | sort -n -u | tail -1) ... -width -$(($WIDTH_SUB + 2))
WIDTH_SUB=$(jq -r ".streams[].channel | select(.display_name==\"$MAIN\") | .status" $MAIN_PATH/followdata.json | while read line; do echo -n "$line" | wc -m ; done | sort -n -u | tail -1)
-width -$(($WIDTH_SUB + 2))
and while I was able to get a value while doing this in the terminal, it didn't work in the script for some reason and the width of the window was always like 10 pixels. I'll try to figure this out but help is welcome.
Since the height of submenus is static, I'll add a fixed height to them with the -lines attribute.
If we display the title of the stream in the submenu, the width should scale depending on the length of that title.
I attempted to do this with the code that currently dynamically scales the expanded view in #7
WIDTH_SUB=$(jq -r ".streams[].channel | select(.display_name==\"$MAIN\") | .status" $MAIN_PATH/followdata.json | while read line; do echo -n "$line" | wc -m ; done | sort -n -u | tail -1)
...-width -$(($WIDTH_SUB + 2))
and while I was able to get a value while doing this in the terminal, it didn't work in the script for some reason and the width of the window was always like 10 pixels. I'll try to figure this out but help is welcome.