Code: Select all
#!/bin/bash
# The BBQ CLI Menu
# May-July 2013 <[email protected]>
# this time only depending on dialog
# set fancy colors
# using .dialogrc
# set var
INPUT=/tmp/menu.sh.$$
# set function for upgrade warning
function upgrade(){
#wget http://linuxbbq.org/feed_format.txt -O /tmp/feed_format.txt
#dialog --backtitle "LinuxBBQ - Bork Your Own" --title "Upgrade warnings" --textbox /tmp/feed_format.txt 0 0
#rm /tmp/feed_format.txt
newsbeuter
}
# bbq system hospital
function bbqfix(){
dialog --backtitle "LinuxBBQ - Start" --title "System Hospital" --menu " \n" 0 0 0 \
1 "Configure network" \
a "Set timezone" \
k "Set keymap" \
l "Set localization" \
b "Sync network time" \
c "Reset and fix soundcard" \
C "Fix Maestro and ESS soundcards" \
d "Edit sources.list" \
e "Update GRUB2" \
f "Repair GRUB" \
g "Remove unused kernels" \
h "Install CUPS" \
i "Reconfigure all packages through dpkg" \
j "Update application alternatives" \
m "Configure and check network" \
n "Edit HOSTS file" \
o "Add adblocking to HOSTS file" \
p "Run testdisk to repair hard drives" \
q "Install Asian Language support" \
r "Install nVidia drivers" \
s "Edit Sources List" \
t "Edit GRUB file" \
u "Change Distro Defaults" \
v "Install localepurge and remove unused locales" \
w "Remove orphaned packages" \
S "Create a snapshot of the running system" \
b "Back to Main" \
x "Exit BBQ Menu" 2>"${INPUT}"
menuitem=$(<"${INPUT}")
case $menuitem in
S) sudo bbqsnapshot;;
1) sudo ceni;;
w) sudo orphaner;;
v) sudo apt-get install localepurge && sudo localepurge;;
h) bbqcups;;
i) sudo dpkg-reconfigure --all;;
j) sudo update-alternatives --all;;
k) sudo dpkg-reconfigure keyboard-configuration;;
l) sudo dpkg-reconfigure locales;;
m) sudo service networking restart && service network-manager restart;;
n) sudo nano /etc/hosts;;
o) sudo adblock-host;;
p) sudo testdisk;;
q) bbqasian;;
r) sudo bbqnvidia;;
s) sudo nano /etc/apt/sources.list.d/bbq.list;;
t) sudo nano /etc/default/grub;;
u) sudo bbq-distro-defaults;;
a) sudo dpkg-reconfigure tzdata;;
b) sudo ntpdate 0.nl.pool.ntp.org;;
c) fixsnd;;
C) fixess;;
d) sudo nano /etc/apt/sources.list.d/bbq.list;;
e) sudo update-grub;;
f) sudo grubrepair;;
g) sudo kernel-remover -F text;;
b) main;;
x) exit 0;;
esac
bbqfix
}
# set function for the office menu
function office(){
dialog --backtitle "LinuxBBQ - Start" --title "Office" --menu " \n" 0 0 0 \
W "Word Processor" \
S "Spreadsheet" \
E "Email Client" \
N "Newsreader" \
a "Address Book" \
d "Calendar" \
c "Calculator" \
e "Tape Calculator" \
t "To Do" \
p "Personal Information Manager" \
b "Back to Main" \
x "Exit BBQ Menu" 2>"${INPUT}"
menuitem=$(<"${INPUT}")
case $menuitem in
e) tapecalc;;
W) wordgrinder;;
S) sc;;
E) mutt;;
N) newsbeuter;;
A) alsamixer;;
r) bbqradio;;
m) mocp -T slob;;
T) tv;;
l) shell-fm;;
a) abook;;
c) bc;;
t) calcurse;;
p) tina;;
d) wyrd;;
b) main;;
x) exit 0;;
esac
office
}
# media menu
function media(){
dialog --backtitle "LinuxBBQ - Start" --title "Multimedia" --menu " \n" 0 0 0 \
A "Alsamixer" \
T "TV Streams" \
r "Radio" \
m "MOC Music Player" \
l "Shell.fm" \
b "Back to Main" \
x "Exit BBQ Menu" 2>"${INPUT}"
menuitem=$(<"${INPUT}")
case $menuitem in
A) alsamixer;;
r) bbqradio;;
m) mocp -T slob;;
T) tv;;
l) shell-fm;;
b) main;;
x) exit 0;;
esac
media
}
# Network Menu
function network(){
dialog --backtitle "LinuxBBQ - Start" --title "Network" --menu " \n" 0 0 0 \
d "Network Usage Monitor" \
o "ctorrent" \
l "links2 Browser" \
i "IRC Client" \
c "Instant Messenger" \
n "Newsreader" \
t "iftop NIC Viewer" \
b "Back to Main" \
x "Exit BBQ Menu" 2>"${INPUT}"
menuitem=$(<"${INPUT}")
case $menuitem in
o) man ctorrent;;
l) links2 www.startpage.com ;;
i) irssi;;
t) sudo iftop;;
c) centerim;;
e) mutt;;
n) newsbeuter;;
b) main;;
x) exit 0;;
d) nload;;
esac
network
}
function secsys(){
dialog --backtitle "LinuxBBQ - Start" --title "Security and System" --menu " \n" 0 0 0 \
c "cpm Password Manager" \
a "Aircrack" \
j "john Password Cracker" \
s "sucrack" \
S "bbqsnapshot" \
I "bbqinstaller !!!run in LIVE session ONLY!!!" \
b "Back to Main" \
x "Exit BBQ Menu" 2>"${INPUT}"
menuitem=$(<"${INPUT}")
case $menuitem in
S) sudo bbqsnapshot;;
I) sudo bbqinstaller;;
c) cpm;;
a) man aircrack-ng;;
j) man john;;
s) man sucrack;;
b) main;;
x) exit 0;;
esac
secsys
}
function hobby(){
dialog --backtitle "LinuxBBQ - Start" --title "Hobby" --menu " \n" 0 0 0 \
n "nut nutrition" \
r "routeplanner" \
h "notebook" \
a "astronomical almanac" \
c "piano reference" \
d "Dive into Python" \
H "The Hardware Book" \
K "Debian Kernel Handbook" \
b "Back to Main" \
x "Exit BBQ Menu" 2>"${INPUT}"
menuitem=$(<"${INPUT}")
case $menuitem in
a) aa;;
K) links2 /usr/share/doc/debian-kernel-handbook/kernel-handbook.html/index.html;;
d) links2 /usr/share/doc/diveintopython/html/index.html;;
H) links2 /usr/share/doc/hwb/html/index.html;;
c) chords;;
n) nut-nutrition;;
h) hnb;;
r) rplan;;
b) main;;
x) exit 0;;
esac
hobby
}
# accessories
function acc(){
dialog --backtitle "LinuxBBQ - Start" --title "Accessories" --menu " \n" 0 0 0 \
m "Midnight Commander" \
r "Ranger" \
f "vifm" \
e "nano" \
v "vi" \
j "joe" \
w "xwpe" \
u "hexcurse" \
p "Powertop" \
g "glances System Monitor" \
h "htop Process Monitor"\
t "Multitail Log Viewer" \
d "Disk Usage" \
b "Back to Main" \
x "Exit BBQ Menu" 2>"${INPUT}"
menuitem=$(<"${INPUT}")
case $menuitem in
u) hexcurse;;
w) xwpe;;
j) joe;;
f) vifm;;
p) sudo powertop;;
t) multitail;;
m) mc;;
g) glances;;
r) ranger;;
v) vi;;
e) nano;;
h) htop;;
d) ncdu;;
b) main;;
x) exit 0;;
esac
acc
}
# games
function games(){
dialog --backtitle "LinuxBBQ - Start" --title "Games" --menu " \n" 0 0 0 \
b "Cavez Of Phear" \
C "Scribble" \
a "bastet" \
A "empire" \
F "rogue" \
c "ninvaders" \
d "freesweep"\
e "pacman" \
f "adventure" \
g "phantasia" \
h "worm" \
i "cribbage" \
j "snake" \
k "wargames" \
l "sail" \
m "robots" \
n monop \
o boggle \
p hangman \
q hack \
r backgammon \
s mille \
t canfield \
u wump \
v tetris \
w gomoku \
y trek \
z battlestar \
B "Back to Main" \
x "Exit BBQ Menu" 2>"${INPUT}"
menuitem=$(<"${INPUT}")
case $menuitem in
C) scribble;;
b) phear;;
a) bastet;;
F) rogue;;
A) empire;;
c) ninvaders;;
d) freesweep;;
e) pacman;;
f) adventure;;
g) phantasia;;
h) worm;;
i) cribbage;;
j) snake;;
k) clear && wargames && read ;;
l) sail;;
m) robots;;
n) monop;;
o) boggle;;
p) hangman;;
q) hack;;
r) backgammon;;
s) mille;;
t) canfield;;
u) wump;;
v) tetris;;
w) gomoku;;
y) trek;;
z) battlestar;;
B) main;;
x) exit 0;;
esac
games
}
# main selection
function main(){
dialog --backtitle "LinuxBBQ - Start" --title "Main Menu" --menu " \n" 0 0 0 \
f "Fix your system" \
u "Upgrade Warnings" \
a "Accessories" \
n "Network and Chat" \
o "Office" \
m "Multimedia" \
g "Games" \
h "Hobby" \
s "Security and System" \
l "Screensaver" \
9 "Reboot" \
0 "Power off" \
x "Exit BBQ Menu" 2>"${INPUT}"
menuitem=$(<"${INPUT}")
case $menuitem in
s) secsys;;
e) emu;;
l) termsaver sysmon;;
p) programming;;
f) bbqfix;;
u) upgrade ;;
a) acc ;;
n) network;;
o) office;;
m) media;;
h) hobby;;
g) games;;
9) systemctl reboot;;
0) systemctl poweroff;;
q) clear &&exit 0;;
x) clear &&exit 0;;
esac
main
}
main
clear &&
exit 0