WizardKit/setup/linux/profile_gui/airootfs/etc/skel/.update_conky
2Shirt 118012d7e2
Merge refactored code
NOTE: This was unintentionally squashed so some details were lost

* Major updates to build_linux to support the current archiso scripts
* Most customize_airootfs.sh code has been moved elsewhere
  * Using static files or links where possible
  * Generating other files as needed in build_linux
* Syslinux configuration has been simplified
* Dropped i3
* Dropped rxvt-unicode in favor of termite
  * Font rendering broke one too many times
* Dropped NetworkManager in favor of iwd/systemd-networkd
2021-01-10 19:28:51 -07:00

31 lines
866 B
Bash
Executable file

#!/bin/bash
# vim: sts=2 sw=2 ts=2
CONFIG_BASE="${HOME}/.config/conky/base.conf"
CONFIG_NEW="${HOME}/.config/conky/new.conf"
CONFIG_REAL="${HOME}/.config/conky/conky.conf"
IF_LIST=($(ip l \
| egrep '^[0-9]+:\s+(eth|en|wl)' \
| sed -r 's/^[0-9]+:\s+(\w+):.*/\1/' \
| sort))
# Build new config from the default
rm "${CONFIG_NEW}"
cp "${CONFIG_BASE}" "${CONFIG_NEW}"
# Add interfaces to conkyrc_new
for i in "${IF_LIST[@]}"; do
if [[ "${i:0:1}" == "e" ]]; then
sed -i -r "s/#Network/Wired:\${alignr}\${addr $i}\n#Network/" "${CONFIG_NEW}"
else
sed -i -r "s/#Network/Wireless:\${alignr}\${addr $i}\n#Network/" "${CONFIG_NEW}"
fi
done
sed -i -r "s/#Network//" "${CONFIG_NEW}"
# Replace config if there were changes
if ! diff -q "${CONFIG_NEW}" "${CONFIG_REAL}" >/dev/null 2>&1; then
rm "${CONFIG_REAL}"
cp "${CONFIG_NEW}" "${CONFIG_REAL}"
fi