From a980a1c44ab9a4245df2fbde2d5e7379e4e26b06 Mon Sep 17 00:00:00 2001 From: Marcus Date: Sun, 22 Oct 2023 16:54:14 +0200 Subject: [PATCH] first steps with nanodesk-installer-gxm gxmessage --- nanodesk-files/usr/bin/nanodesk-installer-gxm | 75 +++++++++++++++++++ .../nanodesk-installer-gxm.desktop | 8 ++ 2 files changed, 83 insertions(+) create mode 100755 nanodesk-files/usr/bin/nanodesk-installer-gxm create mode 100644 nanodesk-files/usr/share/applications/nanodesk-installer-gxm.desktop diff --git a/nanodesk-files/usr/bin/nanodesk-installer-gxm b/nanodesk-files/usr/bin/nanodesk-installer-gxm new file mode 100755 index 0000000..714db04 --- /dev/null +++ b/nanodesk-files/usr/bin/nanodesk-installer-gxm @@ -0,0 +1,75 @@ +#!/bin/bash + +TITLE="nanodesk-installer-gxm" +VERSION=$(cat /usr/share/nanodesk/version) + +GXMCMD="gxmessage -name $TITLE -center -geometry 669x420 -wrap -font mono,10 -file -" +DOCROOT="/usr/share/doc/nanodesk-installer" +DILLOCMD="dillo -f -g 640x480 $DOCROOT" + +# initialize RETURN with a high value +RETURN=255 + + +##### +# +# DIALOGES +# +##### + +abort() { + + gxmessage -font mono,16 -name $TITLE -buttons "Close" "INSTALLATION ABORTED!!" + exit 1 +} + +welcome() { + echo " ----==== nanodesk-installer-gxm ====---- + +This is a gxmessage based Installation assistant for nanodesk. + +To install nanodesk you need a partitioned and formated drive. +You can do the partioning and formating with 'GParted'. + +If you need help how to do so, click on 'Help'. + +When you are done partitioning and your installation target is formated, +go ahead with 'Install'." | + $GXMCMD -buttons "Abort:1,Help:2,GParted:10,Install:0" + return $? +} + +##### +# +# HELP +# +##### + +help-gparted() { + + echo "help-gparted" | $GXMCMD + } + +##### +# +# EXEC +# +##### + +exec-gparted() { + pkexec /usr/sbin/gparted +} + + +while [ $RETURN -gt 0 ] +do + welcome + RETURN=$? + echo CODE $RETURN + case $RETURN in + 1) abort ;; + 2) help-gparted ;; + 10) exec-gparted ;; + esac + +done diff --git a/nanodesk-files/usr/share/applications/nanodesk-installer-gxm.desktop b/nanodesk-files/usr/share/applications/nanodesk-installer-gxm.desktop new file mode 100644 index 0000000..987a580 --- /dev/null +++ b/nanodesk-files/usr/share/applications/nanodesk-installer-gxm.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=nanodesk-installer-gxm +Comment=installer gxmessage script for nanodesk live +Exec=/usr/bin/nanodesk-installer-gxm +Icon=/usr/share/icons/Tango/scalable/apps/system-installer.svg +Terminal=true +Type=Application +Categories=ConsoleOnly;System;