diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0ca8dd7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Itay Grudev + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d44aae2 --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +imperial +======== +Imperial plays the Imperial March using the beep utility. It is really cool, especially if you enable it, early at boot. + +Usage +----- + +``` +Usage: imperial (march|start|stop) + + imperial march - Starts playing the Imperial March + imperial stop - Stops playing the Imperial March + imperial start - A more formal way of playing the Imperial March + +``` + +Copyright +--------- +Itay Grudev 2015 diff --git a/imperial b/imperial new file mode 100755 index 0000000..b1d2ed2 --- /dev/null +++ b/imperial @@ -0,0 +1,58 @@ +#!/bin/bash + +# The MIT License (MIT) + +# Copyright (c) 2015 Itay Grudev + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +help() { + echo ""; + echo "Plays the Imperial March using the beep utility"; + echo ""; + echo "Usage: imperial (march|start|stop)"; + echo ""; + echo " imperial march - Starts playing the Imperial March"; + echo " imperial stop - Stops playing the Imperial March"; + echo " imperial start - A more formal way of playing the Imperial March"; + echo ""; +} + +start() { + beep -l 350 -f 392 -D 100 -n -l 350 -f 392 -D 100 -n -l 350 -f 392 -D 100 -n -l 250 -f 311.1 -D 100 -n -l 25 -f 466.2 -D 100 -n -l 350 -f 392 -D 100 -n -l 250 -f 311.1 -D 100 -n -l 25 -f 466.2 -D 100 -n -l 700 -f 392 -D 100 -n -l 350 -f 587.32 -D 100 -n -l 350 -f 587.32 -D 100 -n -l 350 -f 587.32 -D 100 -n -l 250 -f 622.26 -D 100 -n -l 25 -f 466.2 -D 100 -n -l 350 -f 369.99 -D 100 -n -l 250 -f 311.1 -D 100 -n -l 25 -f 466.2 -D 100 -n -l 700 -f 392 -D 100 -n -l 350 -f 784 -D 100 -n -l 250 -f 392 -D 100 -n -l 25 -f 392 -D 100 -n -l 350 -f 784 -D 100 -n -l 250 -f 739.98 -D 100 -n -l 25 -f 698.46 -D 100 -n -l 25 -f 659.26 -D 100 -n -l 25 -f 622.26 -D 100 -n -l 50 -f 659.26 -D 400 -n -l 25 -f 415.3 -D 200 -n -l 350 -f 554.36 -D 100 -n -l 250 -f 523.25 -D 100 -n -l 25 -f 493.88 -D 100 -n -l 25 -f 466.16 -D 100 -n -l 25 -f 440 -D 100 -n -l 50 -f 466.16 -D 400 -n -l 25 -f 311.13 -D 200 -n -l 350 -f 369.99 -D 100 -n -l 250 -f 311.13 -D 100 -n -l 25 -f 392 -D 100 -n -l 350 -f 466.16 -D 100 -n -l 250 -f 392 -D 100 -n -l 25 -f 466.16 -D 100 -n -l 700 -f 587.32 -D 100 -n -l 350 -f 784 -D 100 -n -l 250 -f 392 -D 100 -n -l 25 -f 392 -D 100 -n -l 350 -f 784 -D 100 -n -l 250 -f 739.98 -D 100 -n -l 25 -f 698.46 -D 100 -n -l 25 -f 659.26 -D 100 -n -l 25 -f 622.26 -D 100 -n -l 50 -f 659.26 -D 400 -n -l 25 -f 415.3 -D 200 -n -l 350 -f 554.36 -D 100 -n -l 250 -f 523.25 -D 100 -n -l 25 -f 493.88 -D 100 -n -l 25 -f 466.16 -D 100 -n -l 25 -f 440 -D 100 -n -l 50 -f 466.16 -D 400 -n -l 25 -f 311.13 -D 200 -n -l 350 -f 392 -D 100 -n -l 250 -f 311.13 -D 100 -n -l 25 -f 466.16 -D 100 -n -l 300 -f 392.00 -D 150 -n -l 250 -f 311.13 -D 100 -n -l 25 -f 466.16 -D 100 -n -l 700 -f 392 +} + +stop() { + # Kill the Beep process + pkill beep + # Sometimes if you interrupt the beep, it won't stop the sound. + # So we play a short beep to stop it. Notice the frquency and length + beep -f 1 -l 1 +} + +case $1 in + start|stop) + $1 + ;; + march) + start + ;; + *|--help|-h) + help +esac diff --git a/imperial.1 b/imperial.1 new file mode 100644 index 0000000..3b11cb0 --- /dev/null +++ b/imperial.1 @@ -0,0 +1,34 @@ +.\" +.\" Copyright 2015 Itay Grudev +.\" +.\" @(#)imperial.1 +.\" +.TH IMPERIAL 1 "April 1, 2015" +.SH NAME +.B imperial +- A proper greet from your computer +.SH SYNOPSIS +.B imperial +(march|start|stop) +.SH DESCRIPTION +.B imperial +is a very sophisticated software that enables your computer to play the Imperial March whenever requested. And the best part - it can play it on boot. +.PP +Heavily relies on the beep utility. +.SH EXAMPLES +.B imperial march + Starts playing the Imperial March +.PP +.B \imperial stop + Stops playing the Imperial March +.PP +.B \imperial start + A more formal way of playing the Imperial March +.SH SEE ALSO +.BR beep (1) +.SH BUGS +Non enlightened people may not understand the significance of this software. +.SH REPORTING BUGS +Report generic bugs to and severe bugs to . +.SH AUTHOR +Itay Grudev