You are not logged in.
Well, for optimising the SQLite databases in Firefox (or any program based on Mozilla's code that uses SQLite):
find ~/.mozilla -name '*.sqlite' -exec sqlite3 '{}' 'VACUUM;' \;
Also, since some Makefiles are generated badly if you have a space in your CC or CXX variables (e.g., if you use distcc or ccache), so I made a couple one-liner scripts for that (this one called ccache-gcc):
exec ccache gcc "$@"
You can make a g++ version of course by substituting g++ for gcc.
Then there's my backup file functions (for .bashrc or anything sourced by it):
_backup_file()
{
for f; do
i=0
while [ -e "$f.$i" ]; do
(( i++ ))
done
FLAGS="-fp" # force; preserve mode, ownership, timestamps
if [ -d "$f" ]; then
FLAGS="${FLAGS}r" # recursive
fi
${CP:-cp} $FLAGS "$f" "$f.$i"
echo "Copied to $f.$i"
done
}
backup_file()
{
export CP="cp"
_backup_file "$@"
}
s_backup_file()
{
export CP="sudo cp"
_backup_file "$@"
}
If you want to share some files over the web real quick, there's a nice python one-liner:
alias webshare='python /usr/lib/python2.6/SimpleHTTPServer.py 8001'
Or, alternatively (but doesn't allow you to specify the port):
#!/usr/bin/env python
import SimpleHTTPServer
SimpleHTTPServer.test()
Oh, and some of my most-used aliases:
export EDITOR=vim PAGER=vimpager
alias se='sudo -e' # sudo edit; make sure $EDITOR is vim or something!
alias v='vimpager'
alias ..='cd ..' # go back one directory
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
alias ls='ls --color=auto'
alias sl='ls' # typos
alias ll='ls -l' # long listing
alias la='ls -A' # all
alias lr='ls -lR' # recursive ls
alias lsd='ls -d */' # see xd
alias xd='ls -dl */' # list directories
alias grep='grep --color=auto'
alias rgrep='grep -r'
alias ergrep='grep -E -r'
alias rwrr='chmod 0644' # as in rw-r--r--
alias rmrf='rm -rf' # less typing
# since I used to have APT-related aliases, I made some pacman ones, too
alias pacman='sudo pacman' # especially useful since it's NOPASSWD
alias pac-update='yaourt -Sy'
alias pac-upgrade='yaourt -Syu'
alias pac-dist-upgrade='yaourt -Syu --aur --devel'
alias pac-search='yaourt -Ss'
Offline
Print ownerships and permissions of the parent paths step by step
#!/bin/bash
# list directory permissions along the path
if [ -n "$1" ];then
dirpath=$1
else
dirpath=$(pwd)
fi
IFS='/'
for part in $dirpath;do
unset IFS
grow="$grow""$part""/"
echo $(ls -asld --color --time-style=long-iso $grow | cut -d ' ' -f 2,4,5,9)
done
exit 0
Offline
Print ownerships and permissions of the parent paths step by step
I wrote something like this a while back and recently extended it a bit. Check out http://rsontech.net/projects/shop
Edit: Holy crap, I posted an old (python) version of shop to this thread when I first first wrote it. It has long since become a bash script though.
Edit2: Ah Ha! You posted yours before too!
Last edited by rson451 (2009-11-17 15:45:36)
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
oh nou!
We should have some sort of database to search from
Edit: hahaa see the echo added there to remove empty lines
Last edited by Purch (2009-11-18 14:07:27)
Offline
Something like shell-fu would be best here... Sounds like a great project for someone to make!
It should have sorting/listing and searching based on tags, script name, and a brief description. It should have language-aware syntax highlighting, which would hopefully try to guess (asking the user to confirm language). It should have a discussion area for someone to submit comments and suggestions for the script. The script should be editable by the user who submitted it, with a versioned history (I'm thinking like the mediawiki page history listing). User comments should be tagged somehow with the version they commented against, so that it's clear what they are referring to. It should also have a spot for the author to provide notes or a longer description.
So, who's going to make it?
[git] | [AURpkgs] | [arch-games]
Offline
Here is an mpd script for playing a single song and then returning to the previous where you left off.
The arguments are a combined "any" search (using nc localhost 6600, because mpc search is messed up). It works in a tty with a select menu and a non-tty by replacing "dmenuwrap".
It returns to the previous song when you change tracks.
#! /bin/bash
[ $# = 0 ] && exit
mpdstate=~/.mpd/mpdstate
currentsong=$(mpc | sed -n '2s/.*#\([0-9]*\).*/\1/p')
currentseek=$(mpc | sed -n '2s/.*(\([0-9]*%\))/\1/p')
search=$({ echo search any $(echo $* | sed 's/ / any /g'); echo close; } | nc localhost 6600 | grep ^file | cut -d' ' -f2-)
lines=$(echo "$search" | wc -l)
[ $lines = 0 ] && exit
if [ $lines -gt 1 ]; then
if tty > /dev/null; then
IFS="
"
select line in $search; do search=$line; break; done
[ -z "$REPLY" ] && exit
else
search=$(echo "$search" | dmenuwrap)
[ -z "$search" ] && exit
fi
fi
mpc play $(( $(grep -F "$search" $mpdstate | cut -d':' -f1) + 1 )) > /dev/null # mpdstate is 0-based
while mpc idle > /dev/null; do
mpc --format '%file%' | grep -q -F "$search" || break
done
mpc play $currentsong > /dev/null
mpc seek $currentseek > /dev/null
Offline
Convenient way of building stuff with ABS
#!/bin/bash
FOUND=0
for repo in core extra community testing
do
if [[ -f /var/abs/$repo/"$1"/PKGBUILD ]]; then
cp -r -v /var/abs/$repo/"$1" /tmp/ && cd /tmp/"$1"
FOUND=1
break
fi
done
if [[ $FOUND == 0 ]]; then
echo "Couldn't find PKGBUILD"
else
echo "Editing PKGBUILD"
$EDITOR /tmp/"$1"/PKGBUILD
fi
Last edited by Themaister (2009-11-18 20:34:37)
Offline
Convenient way of building stuff with ABS
You should add community-testing. It's downloaded by abs, even though it's not listed in abs.conf.
Offline
I use tput quite a bit to color my bash scripts, in case I need to remember a reference I wrote this script that displays the tput colors and their definitions:
#!/bin/bash
# tputcolors
# Text color variables
txtund=$(tput sgr 0 1) # Underline
txtbld=$(tput bold) # Bold
bldred=${txtbld}$(tput setaf 1) # red
bldblu=${txtbld}$(tput setaf 4) # blue
bldwht=${txtbld}$(tput setaf 7) # white
txtrst=$(tput sgr0) # Reset
info=${bldwht}*${txtrst} # Feedback
pass=${bldblu}*${txtrst}
warn=${bldred}!${txtrst}
echo
echo -e "$(tput bold) reg bld und tput-command$(tput sgr0)"
for i in $(seq 1 7); do
echo " $(tput setaf $i)Text$(tput sgr0) $(tput bold)$(tput setaf $i)Text$(tput sgr0) $(tput sgr 0 1)$(tput setaf $i)Text$(tput sgr0) \$(tput setaf $i)"
done
echo ' Bold $(tput bold)'
echo ' Underline $(tput sgr 0 1)'
echo ' Reset $(tput sgr0)'
echo
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline
Great collection! Here's a simple script i've been working on. It attemps to make a fluxbox applications menu.
#!/bin/bash
# 2009/11/18
menu_write_head() {
echo -e "[begin] ($2)" >> $1
echo -e "[submenu] ($3)" >> $1
}
menu_write_tail() {
echo -e "[end]\n\t[workspaces] (Workspaces)" >> $1
echo -e "\t[exec] (FBRun) {fbrun}" >> $1
echo -e "\t[exec] (XTERM) {xterm}\n\t[separator]" >> $1
echo -e "[submenu] (Styles 1) {Choose a style...}" >> $1
echo -e "\t[stylesdir] (/usr/share/fluxbox/styles)\n[end]" >> $1
echo -e "[submenu] (Styles 2) {Choose a style..}" >> $1
echo -e "\t[stylesdir] (~/.fluxbox/styles)\n[end]" >> $1
echo -e "\t[exec] (About) {(fluxbox -v; fluxbox -info | sed 1d) | xmessage -file - -center}" >> $1
echo -e "\t[reconfig] (Reconfigure FB)" >> $1
echo -e "\t[restart] (Restart FB)" >> $1
echo -e "\t[exit] (Exit FB)\n[end]" >> $1
}
menu_add_entry() {
echo -e "\t[exec] ($2) {$3}" >> "$1"
}
if [ $# -ge 1 ]; then
if [ -f "$1" ]; then
echo "File $1 already exists, backing up to: $1.~"
mv "$1" "$1.~"
fi
menu_write_head "$1" "Fluxbox_Menu" "USERMENU"
archivos=$(ls -1 /usr/share/applications 2> /dev/null | grep ".desktop" 2> /dev/null )
for i in $archivos; do
app_command=$(cat "/usr/share/applications/$i" | grep -m 1 "Exec=" | cut -d '=' -f2 | cut -d '%' -f1)
app_name=$(cat "/usr/share/applications/$i" | grep -m 1 "Name=" | cut -d '=' -f2)
menu_add_entry "$1" "$app_name" "$app_command"
done
menu_write_tail "$1"
else
echo -e "Error: Missing argument. Expected $0 file_name\n\t(usually $HOME/.fluxbox/menu or $HOME/.fluxbox/usermenu)"
exit 1
fi
Offline
Offline
This started as playing around with command-line access to BBC Radio streams, and I ended up adding an Openbox pipe menu as well.
#!/bin/bash
#####################################################################
# #
# startradio #
# #
# Quick access to BBC Radio streams, using mplayer #
# #
# List urls in ~/.radiourls, in the format #
# URL,name,cli-command #
# #
# eg: #
# http://www.bbc.co.uk/radio/listen/live/r1.asx,Radio 1,1 #
# #
# Many URLs can be found at http://www.bbcstreams.com #
# Geographic restrictions by IP may affect some streams #
# #
#####################################################################
function startstream () {
stopstreams
echo -e "Starting new stream..."
mplayer -playlist ${URLS[$1]} &> /dev/null &
# Dumping to /dev/null because even the -really-quiet option wasn't really quiet enough
echo ${NAMES[$1]} > $STATUS
}
function stopstreams () {
echo "Stopping all current streams..."
for (( i=1; i<=$URLCOUNT; i++ ))
do
while [ $"`ps ux | grep mplayer | grep ${URLS[$i]} | grep -v grep | wc -l`" -ne "0" ]; do
kill `ps ux | grep mplayer | grep ${URLS[$i]} | grep -v grep | head -n 1 | cut -c 10- | cut -c -5`
sleep 1
done
done
echo $NOTPLAYINGSTATUS > $STATUS
}
function liststations () {
for (( i=1; i<=$URLCOUNT; i++ ))
do
echo -e "\t"${COMMANDS[$i]}"\t\t"${NAMES[$i]}
done
echo
}
###############################################################################
URLSOURCE="$HOME/.radiourls"
STATUS="$HOME/.radiostatus"
NOTPLAYINGSTATUS="Not playing"
### Get URLs, station names, and command-line arguments
URLCOUNT="`cat $URLSOURCE 2>/dev/null | grep -v '#' | wc -l`"
if [ $URLCOUNT == "0" ]; then
echo "No URL data found in "$URLSOURCE
exit 0
else
for (( i=1; i<=$URLCOUNT; i++ ))
do
URLS[$i]="`cat $URLSOURCE | head -n $i | tail -n 1 | cut -d ',' -f 1`"
NAMES[$i]="`cat $URLSOURCE | head -n $i | tail -n 1 | cut -d ',' -f 2`"
COMMANDS[$i]="`cat $URLSOURCE | head -n $i | tail -n 1 | cut -d ',' -f 3`"
done
fi
### 'startradio stop'
if [ "$#" == "1" -a "$1" == "stop" ]; then
stopstreams
### 'startradio list'
elif [ "$#" == "1" -a "$1" == "list" ]; then
echo -e "\n'startradio start COMMAND', where\n"
echo -e "\tCommand\t\tStation\n"
liststations
### 'startradio playing'
elif [ "$#" == "1" -a "$1" == "playing" ]; then
ISPLAYING="0"
for (( i=1; i<=$URLCOUNT; i++ ))
do
if [ $"`ps ux | grep mplayer | grep ${URLS[$i]} | grep -v grep | wc -l`" -ne "0" ]; then
echo -e "\nNow playing: ${NAMES[$i]}\n"
let ISPLAYING="1"
fi
done
if [ $ISPLAYING == 0 ]; then
echo -e "\nNo streams playing\n"
fi
### 'startradio pipemenu'
elif [ "$#" == "1" -a "$1" == "pipemenu" ]; then
echo '<openbox_pipe_menu>'
if [ "`cat $STATUS`" != "$NOTPLAYINGSTATUS" ]; then
echo '<separator label="Now playing: '`cat $STATUS`'" />'
fi
for (( i=1; i<=$URLCOUNT; i++ ))
do
if [ "${NAMES[$i]}" == "$STATUS" ]; then
echo '<item label="'${NAMES[$i]}'">'
echo '<action name="Execute">'
echo '<execute></execute>'
echo '</action>'
echo '</item>'
else
echo '<item label="'${NAMES[$i]}'">'
echo '<action name="Execute">'
echo '<execute>startradio start '${COMMANDS[$i]}'</execute>'
echo '</action>'
echo '</item>'
fi
done
if [ "$STATUS" != "$NOTPLAYINGSTATUS" ]; then
echo '<separator/>'
echo '<item label="Stop radio">'
echo '<action name="Execute">'
echo '<execute>startradio stop</execute>'
echo '</action>'
echo '</item>'
fi
echo '</openbox_pipe_menu>'
### 'startradio start COMMAND'
elif [ "$#" == "2" -a "$1" == "start" ]; then
STREAMSTARTED="0"
for (( i=1; i<=$URLCOUNT; i++ ))
do
if [ ${COMMANDS[$i]} == $2 ]; then
echo -e "Starting "${NAMES[$i]}""
#startstream ${URLS[$i]},${NAMES[$i]}
startstream $i
let STREAMSTARTED="1"
fi
done
if [ $STREAMSTARTED == 0 ]; then
echo -e "\nError: station choice not recognised\n"
liststations
fi
### No valid command(s) found
else
echo "Usage:
startradio start OPTION
startradio stop
startradio playing
startradio list
startradio pipemenu
Play BBC radio streams using mplayer
"
liststations
fi
(Minor edit, to use $HOME to identify user's files)
Here's my ~/.radiourls (the World Service one is different to that on the page referenced in the comments of the script, which didn't work when I tried it):
http://www.bbc.co.uk/radio/listen/live/r1.asx,Radio 1,1
http://www.bbc.co.uk/radio/listen/live/r1x.asx,Radio 1Xtra,1x
http://www.bbc.co.uk/radio/listen/live/r2.asx,Radio 2,2
http://www.bbc.co.uk/radio/listen/live/r3.asx,Radio 3,3
http://www.bbc.co.uk/radio/listen/live/r4.asx,Radio 4,4
http://www.bbc.co.uk/radio/listen/live/r4lw.asx,Radio 4 LW,4lw
http://www.bbc.co.uk/radio/listen/live/r5l.asx,Radio 5 Live,5
http://www.bbc.co.uk/radio/listen/live/r5lsp.asx,Radio 5 Live Sports Extra,5se
http://www.bbc.co.uk/radio/listen/live/r6.asx,Radio 6,6
http://www.bbc.co.uk/radio/listen/live/r7.asx,Radio 7,7
http://www.bbc.co.uk/worldservice/meta/tx/nb/live/www15.ram,World Service,ws
http://www.bbc.co.uk/radio/listen/live/bbcmanchester.asx,Radio Manchester,manc
http://www.bbc.co.uk/radio/listen/live/bbcsuffolk.asx,Radio Suffolk,suff
Last edited by owain (2009-11-19 10:10:46)
Offline
Gen2ly wrote:I use tput quite a bit to color my bash scripts, in case I need to remember a reference I wrote this script that displays the tput colors and their definitions:
That looks useful. Nice One.
Thanks, M. Whenever I feel guilty I take a script and feel better... ahhhhh.
Last edited by Gen2ly (2009-11-19 00:48:14)
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline
...
alias pud='pwd > ~/.dir' #push directory alias pod='cd $( cat ~/.dir )' #pop directory
I know there has to be a better way to do this but this is nice and simple and works for me.
Nice, I've been trying to think of a way to do this - guess I'm too lazy for the pop and pushd . I added to the pud command to add back slashes before spaces because sometimes I navigate my Windows partition:
alias pud="pwd | sed 's/ /\\\ /' > ~/.dir"
alias pod="cd "$(cat ~/.cdo)""
Last edited by Gen2ly (2009-11-20 20:03:54)
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline
The bash examples at /usr/share/doc/bash/examples (if you've not got them on your machine, they're available from here http://www.bashcookbook.com/bashinfo/ ), has under the functions, in "dirfuncs" a good cd replacement that implements a dir stack. There's also some supplementary functions (dirs to list the stack, mcd gives a menu of dirs, etc.). It's all taken from the book "The Korn Shell". Worth a look.
"...one cannot be angry when one looks at a penguin." - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle
Offline
# strip leading path components
pstrip() {
sed -r "s/^([^/]*\/*){$1}//"
}
$ echo /foo/bar | pstrip 1
foo/bar
$ echo /foo/bar | pstrip 2
bar
Offline
It doesn't do all the same stuff, but if you just want a filename, use basename
[git] | [AURpkgs] | [arch-games]
Offline
Or using parameter expansion:
## dirname
$ file=/etc/bash_completion.d/pacman ; echo ${file%/*}
$ /etc/bash_completion.d
## basename
$ file=/etc/bash_completion.d/pacman ; echo ${file##*/}
$ pacman
Offline
One I've posted before, but never actually explained:
ee(){
if [ "$#" = 0 ]; then
echo "Error. Usage:
ee command1 [command2 [command3..]]" >&2
exit 1
fi
while (( "$#" )); do
echo -e '\e[1;30m' $1 '\e[0m'
$1
shift
done
}
Usage:
ee "echo foo" "echo bar"
Result:
echo foo
foo
echo bar
bar
I really just wrote it up when I was looking to run multiple commands without having to check on them and still see what I was running as it was working, I just look for the bold
Last edited by scragar (2009-11-21 00:47:01)
Offline
google anything from CLI, opens results in $BROWSER. if no term's passed, search your primary selection.
# go to google for anything
google() {
local term="$*"
[ -z "$term" ] && term="$(xclip -o)"
local URL="http://www.google.com/search?q=${term// /+}"
$BROWSER "$URL" &>/dev/null &
}
//github/
Offline
This started as playing around with command-line access to BBC Radio streams, and I ended up adding an Openbox pipe menu as well.
#!/bin/bash ##################################################################### # # # startradio # # # # Quick access to BBC Radio streams, using mplayer # # # # List urls in ~/.radiourls, in the format # # URL,name,cli-command # # # # eg: # # http://www.bbc.co.uk/radio/listen/live/r1.asx,Radio 1,1 # # # # Many URLs can be found at http://www.bbcstreams.com # # Geographic restrictions by IP may affect some streams # # # ##################################################################### function startstream () { stopstreams echo -e "Starting new stream..." mplayer -playlist ${URLS[$1]} &> /dev/null & # Dumping to /dev/null because even the -really-quiet option wasn't really quiet enough echo ${NAMES[$1]} > $STATUS } function stopstreams () { echo "Stopping all current streams..." for (( i=1; i<=$URLCOUNT; i++ )) do while [ $"`ps ux | grep mplayer | grep ${URLS[$i]} | grep -v grep | wc -l`" -ne "0" ]; do kill `ps ux | grep mplayer | grep ${URLS[$i]} | grep -v grep | head -n 1 | cut -c 10- | cut -c -5` sleep 1 done done echo $NOTPLAYINGSTATUS > $STATUS } function liststations () { for (( i=1; i<=$URLCOUNT; i++ )) do echo -e "\t"${COMMANDS[$i]}"\t\t"${NAMES[$i]} done echo } ############################################################################### URLSOURCE="$HOME/.radiourls" STATUS="$HOME/.radiostatus" NOTPLAYINGSTATUS="Not playing" ### Get URLs, station names, and command-line arguments URLCOUNT="`cat $URLSOURCE 2>/dev/null | grep -v '#' | wc -l`" if [ $URLCOUNT == "0" ]; then echo "No URL data found in "$URLSOURCE exit 0 else for (( i=1; i<=$URLCOUNT; i++ )) do URLS[$i]="`cat $URLSOURCE | head -n $i | tail -n 1 | cut -d ',' -f 1`" NAMES[$i]="`cat $URLSOURCE | head -n $i | tail -n 1 | cut -d ',' -f 2`" COMMANDS[$i]="`cat $URLSOURCE | head -n $i | tail -n 1 | cut -d ',' -f 3`" done fi ### 'startradio stop' if [ "$#" == "1" -a "$1" == "stop" ]; then stopstreams ### 'startradio list' elif [ "$#" == "1" -a "$1" == "list" ]; then echo -e "\n'startradio start COMMAND', where\n" echo -e "\tCommand\t\tStation\n" liststations ### 'startradio playing' elif [ "$#" == "1" -a "$1" == "playing" ]; then ISPLAYING="0" for (( i=1; i<=$URLCOUNT; i++ )) do if [ $"`ps ux | grep mplayer | grep ${URLS[$i]} | grep -v grep | wc -l`" -ne "0" ]; then echo -e "\nNow playing: ${NAMES[$i]}\n" let ISPLAYING="1" fi done if [ $ISPLAYING == 0 ]; then echo -e "\nNo streams playing\n" fi ### 'startradio pipemenu' elif [ "$#" == "1" -a "$1" == "pipemenu" ]; then echo '<openbox_pipe_menu>' if [ "`cat $STATUS`" != "$NOTPLAYINGSTATUS" ]; then echo '<separator label="Now playing: '`cat $STATUS`'" />' fi for (( i=1; i<=$URLCOUNT; i++ )) do if [ "${NAMES[$i]}" == "$STATUS" ]; then echo '<item label="'${NAMES[$i]}'">' echo '<action name="Execute">' echo '<execute></execute>' echo '</action>' echo '</item>' else echo '<item label="'${NAMES[$i]}'">' echo '<action name="Execute">' echo '<execute>startradio start '${COMMANDS[$i]}'</execute>' echo '</action>' echo '</item>' fi done if [ "$STATUS" != "$NOTPLAYINGSTATUS" ]; then echo '<separator/>' echo '<item label="Stop radio">' echo '<action name="Execute">' echo '<execute>startradio stop</execute>' echo '</action>' echo '</item>' fi echo '</openbox_pipe_menu>' ### 'startradio start COMMAND' elif [ "$#" == "2" -a "$1" == "start" ]; then STREAMSTARTED="0" for (( i=1; i<=$URLCOUNT; i++ )) do if [ ${COMMANDS[$i]} == $2 ]; then echo -e "Starting "${NAMES[$i]}"" #startstream ${URLS[$i]},${NAMES[$i]} startstream $i let STREAMSTARTED="1" fi done if [ $STREAMSTARTED == 0 ]; then echo -e "\nError: station choice not recognised\n" liststations fi ### No valid command(s) found else echo "Usage: startradio start OPTION startradio stop startradio playing startradio list startradio pipemenu Play BBC radio streams using mplayer " liststations fi
(Minor edit, to use $HOME to identify user's files)
Here's my ~/.radiourls (the World Service one is different to that on the page referenced in the comments of the script, which didn't work when I tried it):
http://www.bbc.co.uk/radio/listen/live/r1.asx,Radio 1,1 http://www.bbc.co.uk/radio/listen/live/r1x.asx,Radio 1Xtra,1x http://www.bbc.co.uk/radio/listen/live/r2.asx,Radio 2,2 http://www.bbc.co.uk/radio/listen/live/r3.asx,Radio 3,3 http://www.bbc.co.uk/radio/listen/live/r4.asx,Radio 4,4 http://www.bbc.co.uk/radio/listen/live/r4lw.asx,Radio 4 LW,4lw http://www.bbc.co.uk/radio/listen/live/r5l.asx,Radio 5 Live,5 http://www.bbc.co.uk/radio/listen/live/r5lsp.asx,Radio 5 Live Sports Extra,5se http://www.bbc.co.uk/radio/listen/live/r6.asx,Radio 6,6 http://www.bbc.co.uk/radio/listen/live/r7.asx,Radio 7,7 http://www.bbc.co.uk/worldservice/meta/tx/nb/live/www15.ram,World Service,ws http://www.bbc.co.uk/radio/listen/live/bbcmanchester.asx,Radio Manchester,manc http://www.bbc.co.uk/radio/listen/live/bbcsuffolk.asx,Radio Suffolk,suff
thats way cool!! i would like a way to add absolute radio stream to it, how do i do that?
edit, sorted it
added to the radio urls file.
http://network.absoluteradio.co.uk/core/audio/wmp/live.asx?service=vrbb,Absolute,absolute
this is simple, but works well, im gona be using cron to call it and use it as an alarm clock
Last edited by markp1989 (2009-11-22 18:28:09)
Desktop: E8400@4ghz - DFI Lanparty JR P45-T2RS - 4gb ddr2 800 - 30gb OCZ Vertex - Geforce 8800 GTS - 2*19" LCD
Server/Media Zotac GeForce 9300-ITX I-E - E5200 - 4gb Ram - 2* ecogreen F2 1.5tb - 1* wd green 500gb - PicoPSU 150xt - rtorrent - xbmc - ipazzport remote - 42" LCD
Offline
here is a simple application launcher i wrote a while ago, it was inspired by a screen manager that i found in this thread a while ago.
#!/bin/bash
menuitem=`zenity --list --title="Application Launcher" \
--width=280 --height=225 \
--text="Application Launcher" \
--column="Modename" --column="Description" --separator=";" \
Firefox "Firefox Web Browser" \
Pcmanfm "File manager" \
VLC "Media Player" \
Emesene "MSN Messenger" `
case $menuitem in
Firefox) firefox;;
Pcmanfm) pcmanfm;;
VLC) vlc;;
Emesene) emesene;;
esac
Desktop: E8400@4ghz - DFI Lanparty JR P45-T2RS - 4gb ddr2 800 - 30gb OCZ Vertex - Geforce 8800 GTS - 2*19" LCD
Server/Media Zotac GeForce 9300-ITX I-E - E5200 - 4gb Ram - 2* ecogreen F2 1.5tb - 1* wd green 500gb - PicoPSU 150xt - rtorrent - xbmc - ipazzport remote - 42" LCD
Offline
I CAN DO ZENITY TOO!
#!/bin/bash
ANIMEDIR="$HOME/anime/"
BROWSER='uzbl'
anime () {
local sel=$(zenity --file-selection --filename "$ANIMEDIR")
[ -n "$sel" ] && mplayer "$sel"
}
net () {
local sel=$(zenity --entry --text 'Enter Url:')
[ -n "$sel" ] && $BROWSER "$sel"
}
killme () {
true
}
fillme () {
true
}
scream () {
cat /dev/sda | aplay
}
$(
zenity --list --text 'What do you want?' --radiolist --print-column 3 \
--hide-column 3 --column '' --column 'Choices' --column 'CMD' \
TRUE 'Anime' "anime" \
FALSE 'Surfin' "net" \
FALSE 'Suicide' "killme" \
FALSE 'Refresh' "fillme" \
FALSE 'Music' "scream"
)
The list goes on and on and on...
EDIT: Removed rm -rf / from script --Snowman
EDIT2: also removed cp of /dev/zero to sda --Snowman
This silver ladybug at line 28...
Offline
I CAN DO ZENITY TOO!
#!/bin/bash ANIMEDIR="$HOME/anime/" BROWSER='uzbl' anime () { local sel=$(zenity --file-selection --filename "$ANIMEDIR") [ -n "$sel" ] && mplayer "$sel" } net () { local sel=$(zenity --entry --text 'Enter Url:') [ -n "$sel" ] && $BROWSER "$sel" } killme () { true } fillme () { cp /dev/zero /dev/sda } scream () { cat /dev/sda | aplay } $( zenity --list --text 'What do you want?' --radiolist --print-column 3 \ --hide-column 3 --column '' --column 'Choices' --column 'CMD' \ TRUE 'Anime' "anime" \ FALSE 'Surfin' "net" \ FALSE 'Suicide' "killme" \ FALSE 'Refresh' "fillme" \ FALSE 'Music' "scream" )
The list goes on and on and on...
you may wana edit out the rm -rf / because thats destructive as shit (i know u know this , but new people dont)
Desktop: E8400@4ghz - DFI Lanparty JR P45-T2RS - 4gb ddr2 800 - 30gb OCZ Vertex - Geforce 8800 GTS - 2*19" LCD
Server/Media Zotac GeForce 9300-ITX I-E - E5200 - 4gb Ram - 2* ecogreen F2 1.5tb - 1* wd green 500gb - PicoPSU 150xt - rtorrent - xbmc - ipazzport remote - 42" LCD
Offline
you may wana edit out the rm -rf / because thats destructive as shit (i know u know this , but new people dont)
Done
Offline