#!/usr/bin/pdmenu
#
# Note that the above bang-path isn't required, but it lets you run this
# file directly as a sort of pdmenu script.

# Sample menus for Pdmenu.

# Define the main menu.
menu:main:Main Menu
	show:_Internet menu::internet
	show:_Edit files menu::file-editing
	exec:_File manager::mc
	show:_System monitor menu::system_monitor
	show:_Partition tools menu::partition_tools
	exec:_Mount/Unmount a partition:pause:mumount
	exec:_Man - display man page::man -d
	exec:_Change your password:pause:passwd
	exec:_Directory listing::pwd >/tmp/view.txt ; ls -l -h -A >>/tmp/view.txt ; mcview /tmp/view.txt
	exec:_Change directory:edit,set:echo PWD=~set to?:~
	exec:_Who's online?:display:echo "These users are online:";w
	exec:_Calendar:display:ccal `date +%Y`
	exec:_Display date and time:display:date "+%A, %b %e, %Y (%l:%M:%S %p)"
	show:_Shutdown menu::shutdown
	exit:_Exit

# This is a submenu.
menu:internet:Internet programs
        exec:_Dhcp    - setup wired network connection, wait a few sec.:pause:dhcpup dhcpcd
        exec:_WiFi    - setup wireless network connection:pause:wificonfig
        exec:_Mnsetup - setup mail and news programs::mnsetup
	exec:_AIM  - Naim AIM client::naim
	exec:_MSN  - Tmsnc MSN client::tmsnc
	exec:_IRC  - Epic IRC client::irc
	exec:_Ftp  - Lftp ftp client:edit,pause:lftp ~Ftp to where?:~
	exec:_Ftp  - Ncftp ftp client:edit,pause:ncftp ~Ftp to where?:~
	exec:_Mail - fetchmail mail fetcher:pause:fetchmail -k
	exec:_Mail - fetchmail - use SSL:pause:fetchmail -k --ssl
	exec:_Mail - Mutt mail reader::mutt
	exec:_News - Slrn newsreader::slrn -C -n
	exec:_News - Tin newsreader::tin -radq
	exec:_WWW  - Lynx browser::lynx
	exec:_WWW  - Links browser::links
	exec:_Finger:edit,display:finger ~Enter address to finger:~ 2>/dev/null
	exec:_Telnet:edit,pause:telnet ~Telnet to where?:~
	exec:_Whois:edit,display:whois ~Whois where?:~ | dos2unix
	nop
	exit:_Main menu

#file editing
menu:file-editing:Edit Files
	exec:Edit file with mcedit::mcedit
	group:Edit an _existing file with mcedit
		exec::makemenu: ( \
		        EDITOR=mcedit \
			/usr/doc/RIPLinu[xX]/pdmenu/editdir.pl `pwd` "" edit-existing \
			) 2>/dev/null
		show:::edit-existing
		remove:::edit-existing
	endgroup
menu:file-editing:Edit Files
	exec:Edit file with nano::nano
	group:Edit an _existing file with nano
		exec::makemenu: ( \
		        EDITOR=nano \
			/usr/doc/RIPLinu[xX]/pdmenu/editdir.pl `pwd` "" edit-existing \
			) 2>/dev/null
		show:::edit-existing
		remove:::edit-existing
	endgroup
	exec:Edit file with vim::vim
	group:Edit an _existing file with vim
		exec::makemenu: ( \
			EDITOR=vim \
			/usr/doc/RIPLinu[xX]/pdmenu/editdir.pl `pwd` "" edit-existing \
			) 2>/dev/null
		show:::edit-existing
		remove:::edit-existing
	endgroup
	nop
	exit:_Main menu

# This is a submenu.
menu:man:Man pages
	exec:_Man  - display man page:edit,pause:pman ~Man page name? (without .gz) press 'q' to quit page viewer:~
        exec:_List - list available man pages:display:ls -AC /usr/man/RIPLinu[xX]
	nop
	exit:_Main menu

# shutdown menu
menu:shutdown:Shutdown
 	exec:_Halt the computer::/sbin/halt
 	exec:_Reboot the computer::/sbin/reboot
 	nop
 	exit:_Main menu

# system monitor
menu:system_monitor:System monitor
        exec:_DF    - show disk usage:display:df -a -h -T
        exec:_Free  - show memory usage:display:free -m
        exec:_Mount - show mounted filesystems:display:mount
        exec:_Dmesg - display kernel messages::dmesg >/tmp/view.txt ; mcview /tmp/view.txt
        exec:_HTop  - show system processes::htop
        exec:_Top   - show system processes::top
        exec:_PS    - list system processes::ps -eF >/tmp/view.txt ; mcview /tmp/view.txt
        exec:_LShw  - list system hardware, wait a few sec.::lshw >/tmp/view.txt ; mcview /tmp/view.txt
        exec:_Dmidecode - SMBIOS information::dmidecode >/tmp/view.txt ; mcview /tmp/view.txt
        exec:_Debug     - display debug log file::mcview /var/log/debug
        exec:_Kernel    - display kernel boot messages::mcview /var/log/dmesg
        exec:_Messages  - display messages log file::mcview /var/log/messages
        exec:_Syslog    - display syslog log file::mcview /var/log/syslog
        exec:_Update    - download latest PCI & USB data files::(cd /usr/share/hwdata && ./update)
        exec:_LSpci     - list PCI devices::lspci -vvv >/tmp/view.txt ; mcview /tmp/view.txt
        exec:_LSusb     - list USB devices::lsusb -v >/tmp/view.txt ; mcview /tmp/view.txt
        exec:_LSscsi    - list SCSI devices:display:lsscsi
 	exec:_Smartctl  - show SMART hard drive info::smartctl -a -d ata `fdisk -l | grep "Disk /dev/" | head -n 1 | sed "s/://g" | awk '{print $2}'` >/tmp/view.txt ; mcview /tmp/view.txt
 	nop
 	exit:_Main menu

# partition tools
menu:partition_tools:Partition tools
        exec:_Disktype - List format of disk partitions::disktype `fdisk -l | grep "Disk /dev/" | sed "s/://g" | awk '{print $2}'` >/tmp/view.txt ; mcview /tmp/view.txt
        exec:_Fdisk - List partition tables::fdisk -l >/tmp/view.txt ; mcview /tmp/view.txt
 	exec:_Cfdisk - disk partitioner::cfdisk `fdisk -l | grep "Disk /dev/" | head -n 1 | sed "s/://" | awk '{print $2}'`
        exec:_Evms - LVM management::evmsn
 	exec:_Grub - setup & install GRUB bootloader::grubconfig
 	exec:_Parted-1.8.8 - partition editor::parted
 	exec:_Parted-1.7.1 - partition editor::parted-1.7.1
 	exec:_Parted       - read documentation offline::pinfo parted
 	exec:_Partimage - backup & restore partition::partimage
 	exec:_Partimage - no login::partimage-nologin
 	exec:_Photorec - recover lost photo files on partitions::photorec
 	exec:_Testdisk - scan & repair partitions::testdisk
 	exec:_Testdisk - read documentation offline::lynx /usr/doc/RIPLinu[xX]/testdisk/testdisk.html
 	nop
 	exit:_Main menu
