#!/bin/bash

export LEAVE_ICE='
<window title="Leave" icon-name="system-log-out">
 <vbox>
  <hbox>
    <button use-underline="true">
      <label>Sh_ut Down</label>
      <input file>/usr/share/icewm/icons/shutdown.png</input>
      <action>"sudo /sbin/shutdown -h now"</action>
    </button>
    <button use-underline="true">
      <label>_Restart</label>
      <input file>/usr/share/icewm/icons/reboot.png</input>
      <action>"sudo /sbin/shutdown -r now"</action>
    </button>
    <button use-underline="true">
      <label>_Log Out</label>
      <input file>/usr/share/icewm/icons/logout.png</input>
      <action>killall spacefm; killall icewm</action>
    </button>
    <button use-underline="true">
      <label>_Cancel</label>
      <input file>/usr/share/icewm/icons/cancel.png</input>
      <action>kill $(ps -eo pid,args | grep LEAVE_ICE | grep -v grep| cut -c1-6)</action>
    </button>
  </hbox>
 </vbox>
</window>
'

gtkdialog -c --program=LEAVE_ICE
