i am using the sway compositor and i just discovered this awesome command so i want to make an alias of it. i add these lines on my ~/.bashrc:
_swayfloat()
exec swaymsg -t get_tree |jq -r '..|try select(.type=="floating_con")|"\(.rect.width)x\(.rect.height) \t\(.id)\t\(.name)"'
alias swfl='_swayfloat'
yet it seems it doesnt work cause every time i open a new kitty window i get this error:
bash: /home/systemdeeznuts/.bashrc: line [--]: syntax error near unexpected token `exec'
bash: /home/systemdeeznuts/.bashrc: line [--]: `exec swaymsg -t get_tree |jq -r '..|try select(.type=="floating_con")|"\(.rect.width)x\(.rect.height) \t\(.id)\t\(.name)"''
i tried some other variations yet i always get a syntax error.
if i just type on a terminal,
[systemdeeznuts@hostname ~]$ exec swaymsg -t get_tree |jq -r '..|try select(.type=="floating_con")|"\(.rect.width)x\(.rect.height) \t\(.id)\t\(.name)"'
it works perfectly fine.
is there a workaround for these types of syntax errors?