# If you'd like to omit non-matching lines from the result; add ';d' to the end of the expression.
sed -E 's/set \$(\w+)\s+([^\s]+)/\1="\2"/gm;t' <<< "#========= Variables =========
set $win Mod4
set $alt Mod1
set $ws1 \"1\"
set $ws2 \"2\"
set $ws3 \"3\"
set $ws4 \"4\"
set $ws5 \"5\"
set $ws6 \"6\"
set $ws7 \"7\"
set $ws8 \"8\"
set $ws9 \"9\"
set $ws0 \"0\"
set $bar $HOME/.config/polybar/launch.sh
set $locker i3lock -i $HOME/.config/i3/bg.png
set $term kitty
set $menu dmenu -i -l 10
set $browser qutebrowser
set $filemanager kitty -e ranger
set $launcher dmenu_run
set $notify_daemon dunst
set $notify_bar_program xob
set $notify_bar /tmp/xobpipe
set $script $HOME/.config/i3/scripts
set $last_action /tmp/i3/last_action
set $counter /tmp/i3/counter
set $windows /tmp/i3/windows
set $current_workspace i3-msg -t get_workspaces | jq -r '.[] | select(.focused==true).name'
#============================
#======== Autostart =========
exec nm-applet
exec kotatogram-desktop
exec $browser
exec --no-startup-id dunst
#============================"
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for SED, please visit: https://www.gnu.org/software/sed/manual/html_node/The-_0022s_0022-Command.html