hyprmsn/scripts/load_config.sh
2023-07-07 13:34:47 +03:00

19 lines
No EOL
385 B
Bash
Executable file

#! /bin/bash
config=$HOME/.config/hyprmsn/config.ini
section() {
section_name=$1
sed -n "/\[$section_name\]/,/^$/p" $config | sed -E "s/\[.*\]//g" | sed '/^[[:space:]]*$/d'
}
# daemon section
section daemon > /dev/null
# SOURCING
# support comments
sed "s/;/#/g" $config | grep -Ev "\[.*\]" | source /dev/stdin
# remove spaces
source <(grep = $config | sed 's/ *= */=/g')