소스 검색

Add an mp3 ringtone generator

master
Arun Prakash Jana 5 년 전
부모
커밋
42a5479fa8
No known key found for this signature in database GPG 키 ID: A75979F35C080412
4개의 변경된 파일34개의 추가작업 그리고 2개의 파일을 삭제
  1. +1
    -0
      plugins/README.md
  2. +1
    -1
      plugins/ndiff
  3. +31
    -0
      plugins/ringtone
  4. +1
    -1
      plugins/splitjoin

+ 1
- 0
plugins/README.md 파일 보기

@@ -18,6 +18,7 @@
| pdfview | sh | pdftotext/mupdf-tools | View PDF file in `$PAGER` |
| picker | sh | nnn | Pick files and pipe the newline-separated list to another utility |
| pywal | sh | pywal | Set selected image as wallpaper, change terminal color scheme |
| ringtone | sh | date, ffmpeg | Create a variable bitrate mp3 ringtone from file |
| splitjoin | sh | split, cat | Split file or join selection |
| sxiv | sh | sxiv | Browse images in a dir in sxiv, set wallpaper, copy path ([config](https://wiki.archlinux.org/index.php/Sxiv#Assigning_keyboard_shortcuts))|
| transfer | sh | curl | Upload file to transfer.sh |


+ 1
- 1
plugins/ndiff 파일 보기

@@ -6,7 +6,7 @@
# press 'Enter' to ignore and proceed.
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
# Authors: Arun Prakash Jana, ath3

selection=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection



+ 31
- 0
plugins/ringtone 파일 보기

@@ -0,0 +1,31 @@
#!/usr/bin/env sh

# Description: Create an mp3 ringtone out of an audio file in any format
# Needs user to provide start and end where to cut the file
# Input file audio.ext results in audio_ringtone.mp3
# Requires: date, ffmpeg
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana

if ! [ -z "$1" ]; then
echo -n "start (hh:mm:ss): "
read start
st=`date -d "$start" +%s`

echo -n "end (hh:mm:ss): "
read end
et=`date -d "$end" +%s`

if [ $st -ge $et ]; then
echo "error: start >= end"
exit 1
fi

interval=$(( $et - $st ))

outfile=`basename "$1"`
outfile="${outfile%.*}"_ringtone.mp3

ffmpeg -i "$1" -ss "$start" -t "$interval" -vn -sn -acodec libmp3lame -q:a 2 "$outfile"
fi

+ 1
- 1
plugins/splitjoin 파일 보기

@@ -6,7 +6,7 @@
# Adds '.out suffix to the first file to be joined and saves as output file for join
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
# Authors: Arun Prakash Jana, ath3

selection=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection
resp=s


불러오는 중...
취소
저장