]> git.phdru.name Git - audio-cdr-video.git/commitdiff
Remove absolute directory ~/lib to make it portable
authorOleg Broytman <phd@phdru.name>
Tue, 14 Jan 2014 16:57:00 +0000 (20:57 +0400)
committerOleg Broytman <phd@phdru.name>
Tue, 14 Jan 2014 16:57:00 +0000 (20:57 +0400)
19 files changed:
TODO
audio/mk_list_recursive.sh
audio/mp3/recode-tags-list.sh
audio/mp3/recode-tags-recursive.sh
audio/mp3/recode-tags.sh
audio/ogg/playlist2tags.sh
audio/pa-bt
audio/pa-bt-BT3030
audio/pa-bt-Backbeat903
audio/pa-speaker
audio/pa-toggle-mute
audio/playlist2name.sh
audio/rip
audio/toggle-mute
audio/volume
cdr-dvdrw-tools/.config
cdr-dvdrw-tools/cdr-complete
set-path [new file with mode: 0644]
video/video [deleted file]

diff --git a/TODO b/TODO
index baceee559d568b64aa9144b3179422419f34a451..ce8ae2924bda9ceb0101b473963c967a46e40a48 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,4 +1 @@
-Remove absolute directory ~/lib to make it portable.
-
-
 Add apeinfo, flacinfo, ogginfo like id3info.py.
index bee4b99db8c569f682bbe3c5d6da3132e00aaa84..8d0260c409a3fa39dc8f612fe012e454703ae4ed 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-PATH=$HOME/lib/audio:$PATH
+. "`dirname \"$0\"`"/../set-path
 umask 022
 
 [ "$1" ] && cd "$1" || exit 1 # or just do it in current directory
index 89ae0f1ae5ff642e86233e4046305b649e39356e..e460a2b4ce7323aded98ff70dccc971b380abce3 100755 (executable)
@@ -23,7 +23,7 @@ if [ "`wc -c \"$1\" | awk '{print $1}'`" -ge 10000 ]; then
    exit 2
 fi
 
-PATH=$HOME/lib/audio/mp3:$PATH
+. "`dirname \"$0\"`"/../set-path
 umask 022
 
 recode-tags.sh . $direction || exit 1
index d534b8b2a9c5eddb6698d975191718d0201a4522..9e52fb60cf18d964d2e15d75914543d454223376 100755 (executable)
@@ -17,7 +17,7 @@ else
    exit 1
 fi
 
-PATH=$HOME/lib/audio/mp3:$PATH
+. "`dirname \"$0\"`"/../set-path
 umask 022
 
 if [ "$2" ]; then
index 28c5d8d275fe5a686162a4e919a351d476c84d25..8f311126401fefab5ed18de83e5844e3d51e42c3 100755 (executable)
@@ -20,7 +20,7 @@ fi
 
 cd "$1" || exit 1
 
-PATH=$HOME/lib/audio/mp3:$PATH
+. "`dirname \"$0\"`"/../set-path
 umask 022
 
 if [ "$direction" = "koi2win" ]; then
index 7c487681135447938f9cadc4fd66a292e90cd44e..8504cce17ccdb77b4f207fa81cd50d24c3998799 100755 (executable)
@@ -5,7 +5,7 @@ if [ "$1" = "" ]; then
    exit 1
 fi
 
-PATH=$HOME/lib/audio/ogg:$PATH
+. "`dirname \"$0\"`"/../set-path
 umask 022
 
 playlist="$1"
index 5baf8abc18f22c4cf3da4d5af7ec0ff60fddb379..775eca1bd6aac25dbdbee689d43630e737967b2b 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-"$HOME"/lib/audio/pa-kill
+"`dirname \"$0\"`"/pa-kill
 sleep 1
 pulseaudio -L "module-bluetooth-device address="$1" sink_name=btheadset profile=a2dp" -D &&
 
index 823ed770f0befad848c1ad169f10afc8735fbe6e..803aed8097b13c6a2ac546f83ba0d5708dd7c6e6 100755 (executable)
@@ -1,2 +1,2 @@
 #! /bin/sh
-exec "$HOME"/lib/audio/pa-bt 00:23:78:11:D6:4B
+exec "`dirname \"$0\"`"/pa-bt 00:23:78:11:D6:4B
index 2c1915c803bdd492b959d4d8a5020ae9e7263305..866a689533681992d8c4d895d1f7b3da24da74ca 100755 (executable)
@@ -1,2 +1,2 @@
 #! /bin/sh
-exec "$HOME"/lib/audio/pa-bt 00:1C:EF:7C:81:D6
+exec "`dirname \"$0\"`"/pa-bt 00:1C:EF:7C:81:D6
index bc8b7b9d7cedd2bcd6b9a9ff7e037b242d0d694b..a5466a882afb458309daa869a39cc82180a4b5ab 100755 (executable)
@@ -2,7 +2,7 @@
 
 default_sink=`cat "$HOME"/.pulse/default`
 
-"$HOME"/lib/audio/pa-kill
+"`dirname \"$0\"`"/pa-kill
 sleep 1
 pulseaudio -D &&
 echo "\
index 743b953a66095c923cb7150547f34b2f850bd6dd..8ae6b83764a2289bd61119fef94e266dbd17061b 100755 (executable)
@@ -6,13 +6,13 @@ test "$MUTE" = "1"
 RETURN=$?
 if [[ $RETURN -eq 0 ]]
 then
-   "$HOME"/lib/audio/pa-volume unmute
+   "`dirname \"$0\"`"/pa-volume unmute
    echo "0" > ~/.pulse/mute
    exit
 fi
 if [[ $RETURN -eq 1 ]]
 then
-   "$HOME"/lib/audio/pa-volume mute
+   "`dirname \"$0\"`"/pa-volume mute
    echo "1" > ~/.pulse/mute
    exit
 fi
index 4ef4182332c89b98f28a889e21f17e59c3a8e2d9..eb4c6f49a83f8d39a43335357899a2d6658173cf 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-PATH=$HOME/lib/audio:$PATH
+. "`dirname \"$0\"`"/../set-path
 umask 022
 
 if [ "$1" ]; then
index a0dc974ad0ce8a4d7fbb7b5ba84296cb0061e374..23f48c78f390a8992536f720fb578d8120005c20 100755 (executable)
--- a/audio/rip
+++ b/audio/rip
@@ -10,4 +10,4 @@ fi
 mkdir cdrip && cd cdrip || exit 1
 
 cdparanoia -d "$device" -B &&
-exec $HOME/lib/audio/mjack "$device" "$@"
+exec "`dirname \"$0\"`"/mjack "$device" "$@"
index 62067722532d732d18283109b475829f8f3835bb..2818a2897175d4bd5c127e71eb2c6686b80d3ded 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 if pulseaudio --check; then
-   exec "$HOME"/lib/audio/pa-toggle-mute
+   exec "`dirname \"$0\"`"/pa-toggle-mute
 else
-   exec "$HOME"/lib/audio/amixer-toggle-mute
+   exec "`dirname \"$0\"`"/amixer-toggle-mute
 fi
index 1a2fa50388bfa405db6b3472b4332af24165f8c5..d1af7aa346f6a84f4af4803805d7191f84d288f1 100755 (executable)
@@ -1,5 +1,7 @@
 #! /bin/sh
 
+. "`dirname \"$0\"`"/../set-path
+
 if pulseaudio --check; then
    if [ "$1" = increase ]; then
       vol=increase
@@ -7,15 +9,15 @@ if pulseaudio --check; then
       vol=decrease
    elif [ "$1" = INCREASE ]; then
       vol=increase
-      "$HOME"/lib/audio/pa-volume "$vol"
+      pa-volume "$vol"
    elif [ "$1" = DECREASE ]; then
       vol=decrease
-      "$HOME"/lib/audio/pa-volume "$vol"
+      pa-volume "$vol"
    else
       echo "Usage: $0 [increase|decrease|INCREASE|DECREASE]" >&2
       exit 1
    fi
-   exec "$HOME"/lib/audio/pa-volume "$vol"
+   exec pa-volume "$vol"
 else
-   exec "$HOME"/lib/audio/amixer-volume "$@"
+   exec amixer-volume "$@"
 fi
index 58764bbc30261de3082cf912e67c7587fa42e616..656abac6f1848f13831b429f61ed96c1b59c3c6e 100644 (file)
@@ -1,6 +1,4 @@
-if echo "$PATH" | grep -vq "phd/lib/cdr-dvdrw-tools"; then
-   PATH="$HOME/lib/cdr-dvdrw-tools:$PATH"
-fi
+. "`dirname \"$0\"`"/../set-path
 
 cd_image_iso="$HOME/tmp/cd-image.iso"
 source_dir="$HOME/tmp/cdrw"
index e09a23f5c7a815c431b826895479944e3ec246a4..2dec1a53bb1b1f83ccccf8ed5fec990fdad8bd25 100755 (executable)
@@ -50,7 +50,7 @@ if [ "$source" ]; then
 fi
 
 if [ $setattrs = YES ]; then
-   "$HOME"/lib/audio/setattrs.sh "$source_dir"
+   setattrs.sh "$source_dir"
 fi
 
 if [ -z "$label" ]; then
diff --git a/set-path b/set-path
new file mode 100644 (file)
index 0000000..04dc7c5
--- /dev/null
+++ b/set-path
@@ -0,0 +1,4 @@
+CWD="`pwd`"
+if echo "$PATH" | grep -vq "\(^\|:\)$CWD\(:\|$\)"; then
+   PATH="$CWD:$PATH"
+fi
diff --git a/video/video b/video/video
deleted file mode 100644 (file)
index 09f5101..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-if echo "$PATH" | grep -vq "video"; then
-   PATH=$HOME/lib/video:$PATH
-
-else
-
-   echo "video config has already been installed"
-fi