'Fluxwant'

Sharon Kimble <[email protected]> Mon, 18 Nov 2013 18:02:25 +0000
Newsgroups gmane.comp.window-managers.fluxbox.user
Message-ID <20131118180225.39387d3d@london>
I've written a bash script that allows you to search for a programme
using 'apt-cache search', seeing a short description of it, and whether
you've already installed it, using 'apt-cache policy'. You are then
given the opportunity of installing it, using 'apt-get install', and
then asked if you want to update the universal database, using 'sudo
updatedb', and finally given the opportunity of creating a menu, using
'menumaker-0.99.7.tar.gz'. The script can be obtained via my blog or git
repo, or from this email below, and is targeted at Debian. It might work
on debian-based distros but I haven’t checked it on them. 

Here is the script, but beware of line-wrapping -
=======================================
#!/bin/bash
#: Title	        	: fluxwant
#: Date				: November 2013
#: Author		        : Sharon Kimble
#: Version			: 2.0
#: Times edited			: 11
#: Description			: to easily show a list of
programmes, choose one and install it, and then update the 'universal
database' 
#: Options			: 1, all listed in variables 
#; Requirements			: menumaker-0.99.7.tar.gz, in the /programmes directory #:
License			: GNU GPL 3.0 or later
#################################################### 
# Changelog. 
# * 17-11-13 - initial version of the script, 
# logs output, added ability to install, and update 
# the universal database.
# * 18-11-13 - added the ability to generate a fluxbox menu.
####################################################
# Variables
logfile="/home/boudiccas/logs/want.txt"
####################################################
exec > >(tee -a $logfile) 2>&1

# Searches the apt-cache
echo "What programmes would you like to see? One word answer please!"
echo
read programme
echo
apt-cache search "$programme"
echo

# Uses apt-cache policy to show info regarding one programme
echo "What programme do you want to see more information of?"
echo
read programme
echo
apt-cache show "$programme" | grep -i description -A 8

apt-cache policy "$programme"	
#shows whether installed or not, and repo of it.

# Install it?
echo 
{	
	read -p "Do you want to install this programme? " yn
    case $yn in
        [Yy]* ) sudo apt-get install "$programme";; 
        [Nn]* ) exit;;
        * ) echo "Please answer yes or no. ";;
    esac
}

# use updatedb
echo
{    read -p "Do you want to update the universal database? " yn
   case $yn in
        [Yy]* ) sudo updatedb;;
        [Nn]* ) exit;;
        * ) echo "Please answer yes or no. ";;
    esac
}
#exit
echo
{    read -p "Do you want to update the fluxbox menu? " yn
   case $yn in
        [Yy]* ) mv ~/.fluxbox/menu ~/.fluxbox/menu-$(/bin/date
+%Y%m%d-%R); mmaker fluxbox -f;; 
	[Nn]* ) exit;;
        * ) echo "Please answer yes or no. ";;
    esac
}
exit
=======================================

I hope you find it useful? Any comments or ideas for improvement
welcomed.

Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
efever = http://www.efever.blogspot.com/
efever = http://sharon04.livejournal.com/
my git repo = https://github.com/boudiccas/dots
Debian testing, Fluxbox 1.3.5, LibreOffice 4.1.3.2
Registered Linux user 561944

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk

_______________________________________________
Fluxbox-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fluxbox-users
signature.asc (application/pgp-signature, 836 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)

iQIcBAEBAgAGBQJSilZFAAoJEDaBgBkK+INbd1AP/jXhuZtjPqdlipOrK7YAxu6p
rLTk9FZm5jpmPjd29Nft1hrBJP7WXhukEe12Zcsm7XqEMZoxoMNz9AXegcy3rE9z
4+3s61AxFMWWoMojtB85LyJNU+gqbDoaNdvhveXscHLxoZTEnUrZBVFBgQq/BqTM
pFYdZyZKe5xuWFtQTKhNQLjplyhGJPnnyKtTFuB5Z9hYe9O00+PLf/lDspEzUT3d
LI17Pih1PHk8HuyWYt91MCxl0FY7438fj/TDF/Gv0d8o/5OeekBb9ZahrudMhWYP
xTQ34HVmnipjhhswqZyEHb0OKpVAlPJj0qDmSc6ltZFM9X+vsIzwkewRwOadsX5X
Tdh3oqkOlw4MMP9JxPy9yx/wwpFwjwHAPFeCai4bWw7fgZD9KTi/NRMuP+ruTZ+P
x3lHAsSpDCuf+1GJZWLaRR2qysNOTkVEb8jXC+rWFrKVYCsu6MW7AHicCDQUtt9w
XumWjYgdFFRAWBwIEj+cqtfgpQYu2b3Xv/wdosbiMORjOnVvbTn+KcNDP95//bDz
SRWnKHx8mxn2Zh0Ido0kor68r3tUXZY0sgHqo3V9gVoK2bN5O50Gs1mYkfWdPsfQ
c21SBcw0zE7c6MDWHVNejEig31XszvVF7TKi2zdURMpjHEV/Qb6HCTjP5ddsvJ39
IrzZYJdpclMDIloF9y+C
=vdFp
-----END PGP SIGNATURE-----