Dvd : Add CD/DVD scripts.
This commit is contained in:
parent
c28bd075c9
commit
b405b37871
61
.config/bash/module/Dvd.sh
Normal file
61
.config/bash/module/Dvd.sh
Normal file
|
@ -0,0 +1,61 @@
|
|||
# Burn specified files to DVD.
|
||||
# Usage: dvd_burn <FILES>
|
||||
function dvd_burn() {
|
||||
if [[ "${*}" = "" ]]; then
|
||||
help dvd_burn
|
||||
return 2
|
||||
fi
|
||||
|
||||
growisofs -use-the-force-luke=tty -Z /dev/sr0 -J -r -speed=8 -dvd-compat -pad -graft-points "${*}"
|
||||
}
|
||||
|
||||
# Burn specified iso file to DVD.
|
||||
# Usage: dvd_burn_iso <FILE.iso>
|
||||
function dvd_burn_iso() {
|
||||
local iso="${1}"
|
||||
if [[ "${iso}" = "" ]]; then
|
||||
help dvd_burn_iso
|
||||
return 2
|
||||
fi
|
||||
|
||||
growisofs -dvd-compat -speed=8 -use-the-force-luke=tty -Z /dev/sr0="${iso}"
|
||||
}
|
||||
|
||||
# Burn specified files to CD.
|
||||
# Usage: cd_burn <FILES>
|
||||
function cd_burn() {
|
||||
if [[ "${*}" = "" ]]; then
|
||||
help cd_burn
|
||||
return 2
|
||||
fi
|
||||
|
||||
mkisofs -J -r -pad -graft-points "${*}" | cdrecord dev=1,1,0 speed=8 -
|
||||
}
|
||||
|
||||
# Burn specified iso file to CD.
|
||||
# Usage: cd_burn_iso <FILE.iso>
|
||||
function cd_burn_iso() {
|
||||
local iso="${1}"
|
||||
if [[ "${iso}" = "" ]]; then
|
||||
help cd_burn_iso
|
||||
return 2
|
||||
fi
|
||||
|
||||
wodim speed=8 -tao dev=/dev/sr0 "${iso}"
|
||||
}
|
||||
|
||||
# Burn specified audio files to CD.
|
||||
# Usage: cd_burn_audio <FILES.wav>
|
||||
function cd_burn_audio() {
|
||||
if [[ "${*}" = "" ]]; then
|
||||
help cd_burn_audio
|
||||
return 2
|
||||
fi
|
||||
|
||||
cdrecord -v dev=/dev/sr0 speed=8 -audio -pad "${*}"
|
||||
}
|
||||
|
||||
# Spawn Nix shell with required tools.
|
||||
function dvd_shell() {
|
||||
NIX_SHELL="dvd" tmpshell dvdplusrwtools cdrkit
|
||||
}
|
|
@ -47,17 +47,20 @@ function nix_tmpshell() {
|
|||
local IFS=$'\n'
|
||||
local input=("${@}")
|
||||
local pkgs=()
|
||||
local tag="${NIX_SHELL}"
|
||||
|
||||
if [[ "${input}" = "" ]]; then
|
||||
help nix_tmpshell
|
||||
return 2
|
||||
fi
|
||||
|
||||
[[ "${tag}" = "" ]] && tag="${1}"
|
||||
|
||||
for pkg in ${input[@]}; do
|
||||
pkgs+=("nixpkgs#${pkg}")
|
||||
done
|
||||
|
||||
NIX_SHELL="${1}" nix shell ${pkgs[@]}
|
||||
NIX_SHELL="${tag}" nix shell ${pkgs[@]}
|
||||
}
|
||||
alias tmpshell="nix_tmpshell"
|
||||
|
||||
|
|
Reference in a new issue