From df4831e5d94bc51dd6fb5246e17cff722c162afc Mon Sep 17 00:00:00 2001 From: Sisiutl Date: Sat, 16 Nov 2024 13:21:28 +0100 Subject: hyprland config conversion script --- hyprland-convert-script.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 hyprland-convert-script.sh diff --git a/hyprland-convert-script.sh b/hyprland-convert-script.sh new file mode 100755 index 0000000..8547d62 --- /dev/null +++ b/hyprland-convert-script.sh @@ -0,0 +1,16 @@ +# This horrible, untested sed monstruosity converts your hyprland config to the home-hyprland format. +# Please, check manually what comes out of it first. +# TODO: make it into a scheme script + +echo "(autogenerated 1)" +sed 's/#.*//g ; # remove comments from the old config file + /^[[:space:]]*$/d ; # remove all leading whitespace + s/^ *//g ; y/{}/()/ ; # replace braces with parentheses, for blocks + s/yes, please :)/#t/g ; # feel free to change it back to "yes, please :)" + s/[^(]$/&)/ ; # add leading parentheses to all expressions + s/^[^)]/(&/ ; # same for closing paren + s/[^ ,=()"]\+\( [^ ,=()"]\+\)\+/(&)/g ; # enclose in a list space-separated things like "popin 80%" or "suppressevent maximize" + s/ \?\(=\|,\) *, \?/ () /g ; # empty fields in comma-separated lists get turned into () + s/, \?)/ ())/g ; # same, but for the "end-line" commas + s/, \?/ /g ; # commas get turned into spaces + s/ \?= \?/ /g # equals get removed' $1 -- cgit v1.2.3