User Tools

Site Tools


educare:zenity

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
educare:zenity [2017/06/30 18:53]
profpro created
educare:zenity [2020/06/08 22:20] (current)
Line 1: Line 1:
 +====Zenity====
  
 +è un semplice strumento per aprire finestre di dialogo come questa
 +
 +<code bash>
 +#!/bin/bash
 +
 +zenity --question --text="Avviare lo spegnimento?"
 +if [ $? = 0 ]; then
 +    obsession-exit -p
 +else
 +    exit
 +fi
 +</code>
 +
 +un programma simile si chiama //xmessage//
 +
 +
 +<code bash>
 +
 +#!/bin/sh
 +
 +risposta=$(xmessage  "Vuoi davvero spegnere il computer? " -buttons si,no -print)
 +if [ $risposta = "si" ]
 +then
 +    obsession-exit -p
 +fi
 +</code>
educare/zenity.txt · Last modified: 2020/06/08 22:20 (external edit)