Commit 38b924df authored by Roman Alifanov's avatar Roman Alifanov

implemented pfx_properties menu

parent 11589f1c
......@@ -16,6 +16,18 @@ else
PP_default_prefixes_directory="$(cat "$HOME"/.config/PortProton.conf)/prefixes"
fi
pfx_properties() {
local pfx_name="$1"
local pfx_dir="$2"
echo "pfx_name: $pfx_name"
yad --form --image=folder \
--field="$pfx_name:LBL" "" \
--field="Вес префикса: $(du -hs "$pfx_dir" | awk '{print $1}'):LBL" "" \
--field="Местонахождение\: :MDIR" "$pfx_dir"
}
export -f pfx_properties
percent_bar() {
local percentage=$(echo "$1" | sed 's/%//')
local total=$2
......@@ -70,9 +82,9 @@ gui() {
IFS=$'\n'
for pfx in $prefixes_in_mnt ; do
((button_count++))
IFS=$'|' read -r pfx_name pfx_dir <<< "$pfx"
local PPpMGR_BUTTONS[button_count]="--field=$pfx_name:FBTN"
echo "$pfx_name"
PPpMGR_BUTTONS+=(--field="$pfx_name:FBTN" "bash -c \"pfx_properties $pfx_name $pfx_dir\"")
done
echo "$prefixes_in_mnt"
......@@ -83,9 +95,9 @@ gui() {
yad --plug="$PPpMGR_RANDOM" --tabnum=$tab_count --form \
--separator='|' \
--field="Занято на диске $occupancy_percent: \n\
$occupancy_percent_bar:LBL" \
$occupancy_percent_bar:LBL" "" \
\
--field="Тип файловой системы: $mnt_fstype:LBL" \
--field="Тип файловой системы: $mnt_fstype:LBL" ""\
\
\
${PPpMGR_BUTTONS[*]} \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment