You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
139 lines
4.5 KiB
Bash
139 lines
4.5 KiB
Bash
7 years ago
|
edit_mkinitcpio(){
|
||
|
nano "${MOUNTPOINT}/etc/mkinitcpio.conf"
|
||
|
dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "${_MMRunMkinit}?" 0 0 && {
|
||
|
run_mkinitcpio 2>$ERR
|
||
|
check_for_error "run_mkinitcpio" "$?"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
edit_configs() {
|
||
|
local PARENT="$FUNCNAME"
|
||
|
# Clear the file variables
|
||
|
local options=() functions=("-") i=0 f='' choice=0 fn=''
|
||
|
|
||
|
for f in ${MOUNTPOINT}/home/*/.extend.xinitrc; do
|
||
|
((i++))
|
||
|
options+=( $i ".extend.xinitrc ($(echo "$f"|cut -d'/' -f4 ))" )
|
||
|
functions+=( "nano ${f}" )
|
||
|
done
|
||
|
for f in ${MOUNTPOINT}/home/*/.xinitrc; do
|
||
|
((i++))
|
||
|
options+=( $i ".xinitrc ($(echo "$f"|cut -d'/' -f4 ))" )
|
||
|
functions+=( "nano ${f}" )
|
||
|
done
|
||
|
for f in ${MOUNTPOINT}/home/*/.extend.Xresources; do
|
||
|
((i++))
|
||
|
options+=( $i ".extend.Xresources ($(echo "$f"|cut -d'/' -f4 ))" )
|
||
|
functions+=( "nano ${f}" )
|
||
|
done
|
||
|
for f in ${MOUNTPOINT}/home/*/.Xresources; do
|
||
|
((i++))
|
||
|
options+=( $i ".Xresources ($(echo "$f"|cut -d'/' -f4 ))" )
|
||
|
functions+=( "nano ${f}" )
|
||
|
done
|
||
|
if [[ -e ${MOUNTPOINT}/etc/crypttab ]]; then
|
||
|
((i++))
|
||
|
options+=( $i "crypttab" )
|
||
|
functions+=( "nano ${MOUNTPOINT}/etc/crypttab" )
|
||
|
fi
|
||
|
if [[ -e ${MOUNTPOINT}/etc/fstab ]]; then
|
||
|
((i++))
|
||
|
options+=( $i "fstab" )
|
||
|
functions+=( "nano ${MOUNTPOINT}/etc/fstab" )
|
||
|
fi
|
||
|
if [[ -e ${MOUNTPOINT}/etc/hostname ]]; then
|
||
|
((i++))
|
||
|
options+=( $i "hostname" )
|
||
|
functions+=( "nano ${MOUNTPOINT}/etc/hostname" )
|
||
|
fi
|
||
|
if [[ -e ${MOUNTPOINT}/etc/hosts ]]; then
|
||
|
((i++))
|
||
|
options+=( $i "hosts" )
|
||
|
functions+=( "nano ${MOUNTPOINT}/etc/hosts" )
|
||
|
fi
|
||
|
if [[ -e ${MOUNTPOINT}/etc/systemd/journald.conf ]]; then
|
||
|
((i++))
|
||
|
options+=( $i "journald" )
|
||
|
functions+=( "nano ${MOUNTPOINT}/etc/systemd/journald.conf" )
|
||
|
fi
|
||
|
if [[ -e ${MOUNTPOINT}/etc/conf.d/keymaps ]]; then
|
||
|
((i++))
|
||
|
options+=( $i "keymaps" )
|
||
|
functions+=( "nano ${MOUNTPOINT}/etc/conf.d/keymaps" )
|
||
|
fi
|
||
|
if [[ -e ${MOUNTPOINT}/etc/locale.conf ]]; then
|
||
|
((i++))
|
||
|
f=$(grep -o "=.*$" ${MOUNTPOINT}/etc/locale.conf -m 1)
|
||
|
options+=( $i "locales (${f:1})" )
|
||
|
functions+=( "nano ${MOUNTPOINT}/etc/locale.conf" )
|
||
|
fi
|
||
|
if [[ -e ${MOUNTPOINT}/etc/lightdm/lightdm.conf ]]; then
|
||
|
((i++))
|
||
|
options+=( $i "lightdm" )
|
||
|
functions+=( "nano ${MOUNTPOINT}/etc/lightdm/lightdm.conf" )
|
||
|
fi
|
||
|
if [[ -e ${MOUNTPOINT}/etc/lxdm/lxdm.conf ]]; then
|
||
|
((i++))
|
||
|
options+=( $i "lxdm" )
|
||
|
functions+=( "nano ${MOUNTPOINT}/etc/lxdm/lxdm.conf" )
|
||
|
fi
|
||
|
if [[ -e ${MOUNTPOINT}/etc/mkinitcpio.conf ]]; then
|
||
|
((i++))
|
||
|
options+=( $i "mkinitcpio" )
|
||
|
functions+=( "edit_mkinitcpio" )
|
||
|
fi
|
||
|
if [[ -e ${MOUNTPOINT}/etc/rc.conf ]]; then
|
||
|
((i++))
|
||
|
options+=( $i "openrc" )
|
||
|
functions+=( "nano ${MOUNTPOINT}/etc/rc.conf" )
|
||
|
fi
|
||
|
if [[ -e ${MOUNTPOINT}/etc/pacman.conf ]]; then
|
||
|
((i++))
|
||
|
options+=( $i "pacman" )
|
||
|
functions+=( "nano ${MOUNTPOINT}/etc/pacman.conf" )
|
||
|
fi
|
||
|
if [[ -e ${MOUNTPOINT}/etc/sddm.conf ]]; then
|
||
|
((i++))
|
||
|
options+=( $i "sddm" )
|
||
|
functions+=( "nano ${MOUNTPOINT}/etc/sddm.conf" )
|
||
|
fi
|
||
|
if [[ -e ${MOUNTPOINT}/etc/sudoers.conf ]]; then
|
||
|
((i++))
|
||
|
options+=( $i "sudoers" )
|
||
|
functions+=( "nano ${MOUNTPOINT}/etc/sudoers.conf" )
|
||
|
fi
|
||
|
if [[ -e ${MOUNTPOINT}/etc/default/grub ]]; then
|
||
|
((i++))
|
||
|
options+=( $i "grub" )
|
||
|
functions+=( "nano ${MOUNTPOINT}/etc/default/grub" )
|
||
|
fi
|
||
|
if [[ -e ${MOUNTPOINT}/boot/syslinux/syslinux.cfg ]]; then
|
||
|
((i++))
|
||
|
options+=( $i "syslinux" )
|
||
|
functions+=( "nano ${MOUNTPOINT}/boot/syslinux/syslinux.cfg" )
|
||
|
fi
|
||
|
if [[ -e ${MOUNTPOINT}/etc/vconsole.conf ]]; then
|
||
|
((i++))
|
||
|
options+=( $i "vconsole" )
|
||
|
functions+=( "nano ${MOUNTPOINT}/etc/vconsole.conf" )
|
||
|
fi
|
||
|
((i++))
|
||
|
options+=( $i "$_Back" )
|
||
|
functions+=( "return 0" )
|
||
|
|
||
|
while ((1)); do
|
||
|
submenu 13
|
||
|
DIALOG " $_SeeConfOptTitle " --default-item ${HIGHLIGHT_SUB} --menu "$_SeeConfOptBody" 0 0 $i \
|
||
|
"${options[@]}" 2>${ANSWER}
|
||
|
HIGHLIGHT_SUB=$(<${ANSWER})
|
||
|
choice="${HIGHLIGHT_SUB:-0}"
|
||
|
|
||
|
case "$choice" in
|
||
|
0) break ;; # btn cancel
|
||
|
*)
|
||
|
fn="${functions[$choice]}" # find attach working function in array
|
||
|
[ -n "$fn" ] && $fn
|
||
|
esac
|
||
|
done
|
||
|
}
|