added zenity examples
This commit is contained in:
parent
dd1c195da5
commit
09352fb219
26
code/Bash/zenity/progress.sh
Executable file
26
code/Bash/zenity/progress.sh
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# https://help.gnome.org/users/zenity/stable/progress.html.en
|
||||||
|
|
||||||
|
(
|
||||||
|
echo "0" ; sleep 1
|
||||||
|
echo "# Scanning mail logs..." ; sleep 1
|
||||||
|
echo "10" ; sleep 1
|
||||||
|
echo "# Updating mail logs" ; sleep 1
|
||||||
|
echo "20" ; sleep 1
|
||||||
|
echo "# Resetting cron jobs" ; sleep 1
|
||||||
|
echo "50" ; sleep 1
|
||||||
|
echo "This line will just be ignored" ; sleep 1
|
||||||
|
echo "75" ; sleep 1
|
||||||
|
echo "# Rebooting system" ; sleep 1
|
||||||
|
echo "100" ; sleep 1
|
||||||
|
) |
|
||||||
|
zenity --progress \
|
||||||
|
--title="Update System Logs" \
|
||||||
|
--text="..." \
|
||||||
|
--percentage=0
|
||||||
|
|
||||||
|
if [ "$?" = -1 ] ; then
|
||||||
|
zenity --error \
|
||||||
|
--text="Update canceled."
|
||||||
|
fi
|
8
code/Bash/zenity/table.sh
Executable file
8
code/Bash/zenity/table.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
for i in $(seq 1 10)
|
||||||
|
do
|
||||||
|
echo "bla bla"
|
||||||
|
echo "xxx"
|
||||||
|
echo "$i"
|
||||||
|
done | zenity --list --title="title" --text="text" --column="X" --column="Y" --column="Z"
|
Loading…
Reference in New Issue
Block a user