You are not logged in.

#1 2016-01-09 20:02

bobby
Member
From: Nevada, USA
Registered: 2015-12-24
Posts: 459
Website

Please Help me merge BASH and KDIALOG Script

Tip: for those who don't already know. sudo apt-get install kdebase-bin will install kdialog on Q4os

-----------------

I had errors trying to use dialog scripting program Zenity with Q4OS. it gave me a GTK error but, KDIALOG does not produce same error in Q4OS.

How do I pass the Kdialog variable u  to the Bash script u ?   (so apt-get will run upon selection)

Currently,  the u is passed to the terminal screen and ? appears.  I then must press enter and apt-get update will run.

snap-kdialog-bash-menu.png

#!/bin/bash
# simple menu to do various functions

kdialog --menu "Select a language:" u "Apt-get update" b French d "Oz' English"

while [ answer != "0" ] 
do
clear


read -p " ?" answer




    case $answer in
       0) break ;;
       1) sudo apt-get install gdebi
       ;;
       u) echo "Updating Debian Jessie Package List Databases:"
      sudo apt-get update
       ;;
       3) google-chrome-stable http://q4os.net
       ;;
       4) break ;;
       
       y)sudo apt-get update
       ;;
       A|a) echo "enter zip archive name (eyymmdd)"
       read name
       cd /disks/E/
       zip -r /disks/G/$name.zip *
       cd ~/
       ;;
       *) break ;;
   esac 
   echo
   echo
   echo "press RETURN for menu"



   read key
done
clear 0

echo "Please visit the Q4os Learning Poratl @ http://q4os.net"
echo
exit

Last edited by bobby (2016-01-09 20:41)


No Longer Using Q4OS

Offline

#2 2016-01-09 21:24

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,492
Website

Re: Please Help me merge BASH and KDIALOG Script

#!/bin/bash
# simple script to print selected item

READV=$( kdialog --menu "Select a language:" u "Apt-get update" b French d "Oz' English" )
echo $READV

exit

Offline

#3 2016-01-09 23:05

bobby
Member
From: Nevada, USA
Registered: 2015-12-24
Posts: 459
Website

Re: Please Help me merge BASH and KDIALOG Script

See code & video below.  Logo will be changed from the Q4OS logo so to prevent any confusion these are my Get Installers for Q4OS.

I found another away to "Q4OS Shortcut --> Kdialog Message "Yes / No" --> sudo apt-get update --> Kdialog Message "Success" --> Exit.

Now able to make terminal action scripts for package installs; display system info, etc to dramatically reduce the learning curve for previous windooos users as they move over to Q4OS.

I am so happy today !  I am so Thankful for you guys for developing Q4OS and for providing help, can't do it without you and others help.

THANK YOU SO MUCH !   

#!/bin/bash 
# lauch yes or no apt-get-update
# by Bobby Cooper / http://q4os.net

#!/bin/bash

kdialog --title "Bobby's Apt Update ?" --yesno "Apt Repository Database \
.\n Do you want to update now?"

if [ $? = 0 ]; then
./apt-get-update.sh
fi

exit 0

q4os-auto-apt-get.png

Last edited by bobby (2016-01-09 23:06)


No Longer Using Q4OS

Offline

Board footer

Powered by FluxBB