#!/bin/bash
# launcher to select info4help opions

# define options
info-disk () { info4help -s 4 | xclip -selection clipboard ; }
info-dist () { info4help -s 1 | xclip -selection clipboard ; }
info-hard () { info4help -s 2 | xclip -selection clipboard ; }
info-net () { info4help -s 3 | xclip -selection clipboard ; }
info-bb () { info4help -w -t /usr/share/info4help/templates/forum-bb ; }
info-md () { info4help -w -t /usr/share/info4help/templates/forum-md ; }
# set options
options="1: distribution infos\n\
2: disks infos\n\
3: hardware infos\n\
4: network infos\n\
5: rapport complet bbcode\n\
6: rapport complet markdown\n\
7: annuler"
# launch info4help menu
choice=$(echo -e $options | rofi -dmenu -p "select an output" | cut -d ':' -f 1)
# execute the choice in background
case "$choice" in
   1) info-dist && xmessage "les informations à propos de votre distribution sont collées dans le presse-papier" & ;;
   2) info-disk && xmessage "les informations à propos de vos disques sont collées dans le presse-papier" & ;;
   3) info-hard && xmessage "les informations à propos de votre matériel sont collées dans le presse-papier" & ;;
   4) info-net && xmessage "les informations à propos de votre configuration réseau sont collées dans le presse-papier" & ;;
   5) info-bb & ;;
   6) info-md & ;;
   7) exit ;;
esac
