I wrote a small program using gtkdialog to quickly check the activated modules and activate/deactivate modules. This is especially helpful when load= and noload= cheatcodes have been used, so even the porteus/modules directory may not have all modules loaded.
Code: Select all
#! /bin/bash
export NUMENTRIES=0
export LOADEDENTRIES=0
export MODULE_LOAD_DIR="/mnt/live/memory/images"
export TMPFILE="/tmp/port_modules"
function load_modules
{
NUMENTRIES=0
LOADEDENTRIES=0
local PORTMODULES="$(find $PORTDIR -name "*.xzm" | sort)"
for PORTMODULE in $PORTMODULES
do
local MODNAME="$(basename -a $PORTMODULE)"
local MODDIR="$(basename -a $(dirname $PORTMODULE))"
local OUT="${MODNAME}|${MODDIR}"
if [ -e "${MODULE_LOAD_DIR}/${MODNAME}" ]; then
echo "gtk-yes|${OUT}" >> "$TMPFILE"
LOADEDENTRIES=$((LOADEDENTRIES+1))
else
echo "gtk-no|${OUT}" >> "$TMPFILE"
fi
NUMENTRIES=$((NUMENTRIES+1))
done
}
function activate_module
{
local MODULE="$(find $PORTDIR -name $1)"
local MODNAME="$(basename -a $MODULE)"
if [ -e "${MODULE_LOAD_DIR}/${MODNAME}" ]; then
deactivate "$MODULE"
else
activate "$MODULE"
fi
rm -f "$TMPFILE"
load_modules
}
export -f load_modules
export -f activate_module
load_modules
export MODULES_MAIN='
<window window_position="1" title="Porteus Modules ('$NUMENTRIES')" default-height="550" default-width="400" icon-name="cdr" resizable="true">
<vbox>
<tree selection-mode="1" file-monitor="true">
<variable>ENTRY</variable>
<label>"Module Name |Containing Directory "</label>
<input file icon_column="0">'$TMPFILE'</input>
<action signal="row-activated">"activate_module $ENTRY"</action>
<action signal="file-changed" type="refresh">ENTRY</action>
</tree>
<hseparator default-width="300"></hseparator>
<hbox>
<button space-fill="true">
<label>Exit</label>
<action>exit:0</action>
</button>
</hbox>
</vbox>
</window>
'
gtkdialog --program=MODULES_MAIN -c
rm -f $TMPFILE
I also have an gtkdialog question on the above. The
Code: Select all
title="Porteus Modules ('$NUMENTRIES')
Code: Select all
title="Porteus Modules ('$LOADEDENTRIES'/'$NUMENTRIES')
Thanks!