Donc à partir de :
https://debian-facile.org/viewtopic.php?id=30120
https://stackoverflow.com/questions/757 ... s/55942096
[EDIT]
1- J'ai tenté d'installer
perl-tk à partir du
cpan
,
bien sûr. Je me suis fait jeter.
2- J'ai tenté avec
pacman
, j'ai eu un tas d'insanités.
3- Bizarrement je me retrouve avec
perl-tk (Pas le temps de chercher pour l'instant).
4- Installez
perl-tk comme vous pouvez pour faire une petite interface graphique...
[/EDIT]
2- le script
perl de l'interface graphique
Logout.pl
:
Code : Tout sélectionner
#!/usr/local/bin/perl
use strict;
use warnings;
use utf8;
use Tk;
# Creation du widget principal
my $Wm = new MainWindow(
-title => "Déconnexion",
);
$Wm->minsize( 300, 100 );
# Frame pour les 3 boutons [Log Out|Restart|Shut Down]
my $Frame3Boutons = $Wm->Frame(
-background => "#F0FFFF",
)->pack(qw / -side top -fill both -expand 0 /);
# Frame pour le bouton [Suspend]
my $Frame1Bouton = $Wm->Frame(
-background => "#F0FFFF",
)->pack(qw / -side bottom -fill both -expand 1 /);
# Log Out
$Frame3Boutons->Button(
-text => "Log Out",
-width => 10,
-height => 2,
-command => sub {
system "/root/ZZ_Fin";
system "/usr/bin/xfce4-session-logout --fast --logout";
},
)->grid( -row => 0, -column => 1, -padx => 5, -pady => 10, -sticky => "nsew" );
# Restart
$Frame3Boutons->Button(
-text => "Restart",
-width => 10,
-height => 2,
-command => sub {
system "/root/ZZ_Fin";
system "/usr/bin/xfce4-session-logout --fast --reboot";
},
)->grid( -row => 0, -column => 2, -padx => 5, -pady => 10, -sticky => "nsew" );
# Shut Down
$Frame3Boutons->Button(
-text => "Shut Down",
-width => 10,
-height => 2,
-command => sub {
system "/root/ZZ_Fin";
system "/usr/bin/xfce4-session-logout --fast --halt";
},
)->grid( -row => 0, -column => 3, -padx => 5, -pady => 10, -sticky => "nsew" );
# Suspend
$Frame1Bouton->Button(
-text => "Suspend",
-width => 36,
-height => 2,
-command => sub {
system "/root/ZZ_Fin";
system "/usr/bin/xfce4-session-logout --fast --suspend";
},
)->grid( -row => 0, -column => 0, -padx => 5, -pady => 10, -sticky => "nsew" );
$Frame1Bouton->pack(qw / -side top -fill both -expand 1 /);
MainLoop();
#---------------------------------------------------------------
# Il n'y a pas de code spécifique...
3- Dans
/usr/local/bin
un script du
même nom que celui qui est lancé lorsqu’on clique sur
Déconnexion xfce4-session-logout
:
4- Le script qui rassemble tout ce qui est à lancer à la déconnexion
/root/ZZ_Fin
:
Code : Tout sélectionner
#!/bin/bash
/root/ZZ_Sound
/usr/bin/perl /root/ZZ_Perl/mail.pl
#... ...
5- Le script qui joue le son
/root/ZZ_Sound
:
Code : Tout sélectionner
#!/bin/bash
/usr/bin/pacmd set-default-sink 0
/usr/bin/aplay /root/MK_Rescue/sysresccd/UTILE/LaSouris_V.wav
Voila ce que ça donne :

Cliquer sur l'image pour agrandir.
Ce n'est plus dans la norme mais ça fonctionne
