under .config/sway for status bar works, constantly brings up an error message

I made a simple to display date, uptimes, and linux version, loaded it to config, and it works. However, whenever sway reloads (ie. when it reboots), it would bring up an error message. saying the there are invalid commands. For example, it would say that uptime_formatted= $(uptime | cut -d ‘,’ -f1 | cut -d ’ ’ -f4,5) has an invalid command.

Check the script again from where you copied it

To understand better, here is what you shared

uptime_formatted= $(uptime | cut -d ‘,’ -f1 | cut -d ’ ’ -f4,5)

vs what it should be according to that stackexchange

uptime_formatted=$(uptime | cut -d ',' -f1  | cut -d ' ' -f4,5)

see the difference?


Bash is horrible about extra spaces around operators…