From a486270115b1bee64db8e3038be69a3270276d9a Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Thu, 24 Mar 2022 16:37:21 +0000 Subject: [PATCH] Test scripts. --- scripts/color.sh | 12 ++++++++++++ scripts/entry.sh | 9 +++++++++ scripts/error.sh | 3 +++ scripts/file.sh | 12 ++++++++++++ scripts/info.sh | 3 +++ scripts/notification-listen.sh | 5 +++++ scripts/notification.sh | 5 +++++ scripts/progress.sh | 22 ++++++++++++++++++++++ scripts/question.sh | 3 +++ scripts/warning.sh | 3 +++ 10 files changed, 77 insertions(+) create mode 100755 scripts/color.sh create mode 100755 scripts/entry.sh create mode 100755 scripts/error.sh create mode 100755 scripts/file.sh create mode 100755 scripts/info.sh create mode 100755 scripts/notification-listen.sh create mode 100755 scripts/notification.sh create mode 100755 scripts/progress.sh create mode 100755 scripts/question.sh create mode 100755 scripts/warning.sh diff --git a/scripts/color.sh b/scripts/color.sh new file mode 100755 index 0000000..3023270 --- /dev/null +++ b/scripts/color.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +COLOR=`zenity --color-selection --show-palette` + +case $? in + 0) + echo "You selected $COLOR.";; + 1) + echo "No color selected.";; + -1) + echo "An unexpected error has occurred.";; +esac \ No newline at end of file diff --git a/scripts/entry.sh b/scripts/entry.sh new file mode 100755 index 0000000..aee076e --- /dev/null +++ b/scripts/entry.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +if zenity --entry \ + --title="Add new profile" \ + --text="Enter name of new profile:" \ + --entry-text "NewProfile" + then echo "OK" + else echo "No name entered" +fi \ No newline at end of file diff --git a/scripts/error.sh b/scripts/error.sh new file mode 100755 index 0000000..8bcf291 --- /dev/null +++ b/scripts/error.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec zenity --error --text="Could not find /var/log/syslog." \ No newline at end of file diff --git a/scripts/file.sh b/scripts/file.sh new file mode 100755 index 0000000..53c8c1e --- /dev/null +++ b/scripts/file.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +FILE=`zenity --file-selection --title="Select a File"` + +case $? in + 0) + echo "\"$FILE\" selected.";; + 1) + echo "No file selected.";; + -1) + echo "An unexpected error has occurred.";; +esac \ No newline at end of file diff --git a/scripts/info.sh b/scripts/info.sh new file mode 100755 index 0000000..45ae241 --- /dev/null +++ b/scripts/info.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec zenity --info --text="Merge complete. Updated 3 of 10 files." \ No newline at end of file diff --git a/scripts/notification-listen.sh b/scripts/notification-listen.sh new file mode 100755 index 0000000..1c6732c --- /dev/null +++ b/scripts/notification-listen.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +cat <