Prompt files for Cygwin/Windows
This commit is contained in:
parent
f1675da977
commit
a88b875013
140
cygwin/prompt/.bashrc
Normal file
140
cygwin/prompt/.bashrc
Normal file
|
@ -0,0 +1,140 @@
|
||||||
|
# ~/.bashrc: executed by bash(1) for non-login shells.
|
||||||
|
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
|
||||||
|
# for examples
|
||||||
|
|
||||||
|
# If not running interactively, don't do anything
|
||||||
|
case $- in
|
||||||
|
*i*) ;;
|
||||||
|
*) return;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# don't put duplicate lines or lines starting with space in the history.
|
||||||
|
# See bash(1) for more options
|
||||||
|
HISTCONTROL=ignoreboth
|
||||||
|
|
||||||
|
# append to the history file, don't overwrite it
|
||||||
|
shopt -s histappend
|
||||||
|
|
||||||
|
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
||||||
|
HISTSIZE=1000
|
||||||
|
HISTFILESIZE=2000
|
||||||
|
|
||||||
|
# check the window size after each command and, if necessary,
|
||||||
|
# update the values of LINES and COLUMNS.
|
||||||
|
shopt -s checkwinsize
|
||||||
|
|
||||||
|
# If set, the pattern "**" used in a pathname expansion context will
|
||||||
|
# match all files and zero or more directories and subdirectories.
|
||||||
|
#shopt -s globstar
|
||||||
|
|
||||||
|
# make less more friendly for non-text input files, see lesspipe(1)
|
||||||
|
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||||
|
|
||||||
|
# set variable identifying the chroot you work in (used in the prompt below)
|
||||||
|
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
||||||
|
debian_chroot=$(cat /etc/debian_chroot)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set a fancy prompt (non-color, unless we know we "want" color)
|
||||||
|
case "$TERM" in
|
||||||
|
xterm-color|*-256color) color_prompt=yes;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# uncomment for a colored prompt, if the terminal has the capability; turned
|
||||||
|
# off by default to not distract the user: the focus in a terminal window
|
||||||
|
# should be on the output of commands, not on the prompt
|
||||||
|
#force_color_prompt=yes
|
||||||
|
|
||||||
|
if [ -n "$force_color_prompt" ]; then
|
||||||
|
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
||||||
|
# We have color support; assume it's compliant with Ecma-48
|
||||||
|
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
|
||||||
|
# a case would tend to support setf rather than setaf.)
|
||||||
|
color_prompt=yes
|
||||||
|
else
|
||||||
|
color_prompt=
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$color_prompt" = yes ]; then
|
||||||
|
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]ks-tools\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||||
|
else
|
||||||
|
PS1='${debian_chroot:+($debian_chroot)}ks-tools:\w\$ '
|
||||||
|
fi
|
||||||
|
unset color_prompt force_color_prompt
|
||||||
|
|
||||||
|
# If this is an xterm set the title to user@host:dir
|
||||||
|
case "$TERM" in
|
||||||
|
xterm*|rxvt*)
|
||||||
|
PS1="\[\e]ks-tools: \w\a\]$PS1"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# enable color support of ls and also add handy aliases
|
||||||
|
if [ -x /usr/bin/dircolors ]; then
|
||||||
|
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||||
|
alias ls='ls --color=auto'
|
||||||
|
#alias dir='dir --color=auto'
|
||||||
|
#alias vdir='vdir --color=auto'
|
||||||
|
|
||||||
|
#alias grep='grep --color=auto'
|
||||||
|
#alias fgrep='fgrep --color=auto'
|
||||||
|
#alias egrep='egrep --color=auto'
|
||||||
|
fi
|
||||||
|
|
||||||
|
# colored GCC warnings and errors
|
||||||
|
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
||||||
|
|
||||||
|
# some more ls aliases
|
||||||
|
#alias ll='ls -l'
|
||||||
|
#alias la='ls -A'
|
||||||
|
#alias l='ls -CF'
|
||||||
|
|
||||||
|
# Alias definitions.
|
||||||
|
# You may want to put all your additions into a separate file like
|
||||||
|
# ~/.bash_aliases, instead of adding them here directly.
|
||||||
|
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
|
||||||
|
|
||||||
|
if [ -f ~/.bash_aliases ]; then
|
||||||
|
. ~/.bash_aliases
|
||||||
|
fi
|
||||||
|
|
||||||
|
# enable programmable completion features (you don't need to enable
|
||||||
|
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||||
|
# sources /etc/bash.bashrc).
|
||||||
|
if ! shopt -oq posix; then
|
||||||
|
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||||
|
. /usr/share/bash-completion/bash_completion
|
||||||
|
elif [ -f /etc/bash_completion ]; then
|
||||||
|
. /etc/bash_completion
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
alias all-commands='ls /bin | grep ".exe" | cut -d "." -f 1'
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo " #####################################"
|
||||||
|
echo " # ks-tools 6.6 (for Windows/Cygwin) #"
|
||||||
|
echo " #####################################"
|
||||||
|
echo ""
|
||||||
|
echo " * Note:"
|
||||||
|
echo " - C: is /cygdrive/c"
|
||||||
|
echo " Example: cd /cygdrive/c/Users/Default/Desktop"
|
||||||
|
echo ""
|
||||||
|
echo " * Available commands:"
|
||||||
|
echo ""
|
||||||
|
echo " - ks-upv - ks-vob"
|
||||||
|
echo " - ks-upa - ks-oga"
|
||||||
|
echo " - ks-upf - ks-oga-album"
|
||||||
|
echo " - ks-upr - ks-mp4-wrapper"
|
||||||
|
echo " - ks-mp4 - ks-avi-wrapper"
|
||||||
|
echo " - ks-mp4k - ks-vob-wrapper"
|
||||||
|
echo " - ks-mp4s - ks-mp4k-wrapper"
|
||||||
|
echo " - ks-mix - ks-mp4s-wrapper"
|
||||||
|
echo " - ks-avi - ks-mp4s-folder"
|
||||||
|
echo " - ks-mp3 - ks-mp3-album"
|
||||||
|
echo ""
|
||||||
|
echo " * Type 'all-commands' for show all commands."
|
||||||
|
echo ""
|
4
cygwin/prompt/.minttyrc
Normal file
4
cygwin/prompt/.minttyrc
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
Font=Consolas
|
||||||
|
FontHeight=11
|
||||||
|
Columns=120
|
||||||
|
Rows=27
|
18
cygwin/prompt/ks-tools-zui.cmd.disabled
Normal file
18
cygwin/prompt/ks-tools-zui.cmd.disabled
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
@echo off
|
||||||
|
|
||||||
|
rem ######################################
|
||||||
|
rem # ks-tools for Windows #
|
||||||
|
rem # U. Modificacion: 10-02-2021 #
|
||||||
|
rem # Author: q3aql #
|
||||||
|
rem # Contact: q3aql@protonmail.ch #
|
||||||
|
rem # License: GPL v2.0 #
|
||||||
|
rem ######################################
|
||||||
|
set VERSION=6.6
|
||||||
|
|
||||||
|
rem # Start ks-tools ZUI (bash)
|
||||||
|
mkdir home\%USERNAME%
|
||||||
|
copy /Y prompt\.bashrc home\%USERNAME%
|
||||||
|
copy /Y prompt\.minttyrc home\%USERNAME%
|
||||||
|
cls
|
||||||
|
set PATH=%PATH%;%~d0%~p0\bin
|
||||||
|
bin\bash.exe bin\ks-zui
|
BIN
cygwin/prompt/ks-tools.ico
Normal file
BIN
cygwin/prompt/ks-tools.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 100 KiB |
BIN
cygwin/prompt/ks-tools.png
Normal file
BIN
cygwin/prompt/ks-tools.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
380
cygwin/prompt/ks-zui.disabled
Normal file
380
cygwin/prompt/ks-zui.disabled
Normal file
|
@ -0,0 +1,380 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#################################################################
|
||||||
|
# ks-zui (ks-tools) - Simple zenity user interface for ks-tools #
|
||||||
|
# Date: 10-02-2021 #
|
||||||
|
# Author: q3aql #
|
||||||
|
# Contact: q3aql@protonmail.ch #
|
||||||
|
#################################################################
|
||||||
|
VERSION="6.6 (BETA)"
|
||||||
|
M_DATE="100221"
|
||||||
|
|
||||||
|
# Function to show about
|
||||||
|
function showAbout() {
|
||||||
|
/usr/bin/zenity --title "About" --info --width=330 \
|
||||||
|
--text "Software: ks-zui (ks-tools) ${VERSION} \
|
||||||
|
(${M_DATE})\nAuthor: q3aql\nContact: q3aql@protonmail.ch\nLicense: GPL v2.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to show information of video file
|
||||||
|
# Sintax: showVideoInfo
|
||||||
|
function showVideoInfo() {
|
||||||
|
videoFile=$(/usr/bin/zenity --title "ks-zui (ks-tools) ${VERSION} (${M_DATE}) \
|
||||||
|
| Select the video file" --file-selection)
|
||||||
|
# Enable in Cygwin
|
||||||
|
videoFile=$(cygwin-path -c "${videoFile}")
|
||||||
|
ks-mp4-wrapper --show-info "${videoFile}"
|
||||||
|
echo -n "Press ENTER to continue " ; read null
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to convert MP4 with subs
|
||||||
|
# Sintax: convertMP4WithSub
|
||||||
|
function convertMP4WithSub() {
|
||||||
|
videoFile=$(/usr/bin/zenity --title "ks-zui (ks-tools) ${VERSION} (${M_DATE}) \
|
||||||
|
| Select the video file" --file-selection)
|
||||||
|
# Enable in Cygwin
|
||||||
|
videoFile=$(cygwin-path -c "${videoFile}")
|
||||||
|
# Detect configuration
|
||||||
|
if [ -z "${videoFile}" ] ; then
|
||||||
|
echo null > /dev/null
|
||||||
|
else
|
||||||
|
videoTrackDefault=$(ks-mp4-wrapper --show-video-default "${videoFile}")
|
||||||
|
audioTrackDefault=$(ks-mp4-wrapper --show-audio-default "${videoFile}")
|
||||||
|
subtitleTrackDefault=$(ks-mp4-wrapper --show-subtitle-default "${videoFile}")
|
||||||
|
resolutionDefault=$(ks-mp4-wrapper --show-resolution-default)
|
||||||
|
nameDefault=$(ks-mp4-wrapper --show-name-title-default "${videoFile}")
|
||||||
|
yearDefault=$(ks-mp4-wrapper --show-year-default)
|
||||||
|
genreDefault=$(ks-mp4-wrapper --show-genre-default)
|
||||||
|
# Ask the configuration
|
||||||
|
videoTrack=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the video track to map: " --entry-text "${videoTrackDefault}")
|
||||||
|
audioTrack=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the audio track to map: " --entry-text "${audioTrackDefault}")
|
||||||
|
subtitleTrack=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the subtitle track to map: " --entry-text "${subtitleTrackDefault}")
|
||||||
|
resolution=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the resolution: " --entry-text "${resolutionDefault}")
|
||||||
|
nameVideo=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "[METADATA] Enter the name title: " --entry-text "${nameDefault}")
|
||||||
|
yearVideo=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "[METADATA] Enter the year: " --entry-text "${yearDefault}")
|
||||||
|
genreVideo=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "[METADATA] Enter the genre: " --entry-text "${genreDefault}")
|
||||||
|
# Disable on Cygwin
|
||||||
|
#mkdir -p ${HOME}/Conv
|
||||||
|
#outputFile=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
#--text "Enter the path of ouput file prefix: " --entry-text "${HOME}/Conv/Default")
|
||||||
|
# Enable on Cygwin
|
||||||
|
mkdir -p /cygdrive/c/Conv
|
||||||
|
outputFile=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the path of ouput file prefix: " --entry-text "/cygdrive/c/Conv/Default")
|
||||||
|
/usr/bin/zenity --question --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" --cancel-label="No" \
|
||||||
|
--ok-label="Yes" --width=320 --text "Do you want apply '-thread_queue_size 2048' patch?"
|
||||||
|
outputPath=$?
|
||||||
|
if [ ${outputPath} -eq 0 ] ; then
|
||||||
|
ks-mp4-wrapper --conv-with-sub "${videoFile}" "${outputFile}" ${videoTrack} ${audioTrack} \
|
||||||
|
${subtitleTrack} ${resolution} "${nameVideo}" ${yearVideo} ${genreVideo} patch
|
||||||
|
else
|
||||||
|
ks-mp4-wrapper --conv-with-sub "${videoFile}" "${outputFile}" ${videoTrack} ${audioTrack} \
|
||||||
|
${subtitleTrack} ${resolution} "${nameVideo}" ${yearVideo} ${genreVideo}
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
echo -n "Press ENTER to continue " ; read null
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to convert MP4
|
||||||
|
# Sintax: convertMP4
|
||||||
|
function convertMP4() {
|
||||||
|
videoFile=$(/usr/bin/zenity --title "ks-zui (ks-tools) ${VERSION} (${M_DATE}) \
|
||||||
|
| Select the video file" --file-selection)
|
||||||
|
# Enable in Cygwin
|
||||||
|
videoFile=$(cygwin-path -c "${videoFile}")
|
||||||
|
# Detect configuration
|
||||||
|
if [ -z "${videoFile}" ] ; then
|
||||||
|
echo null > /dev/null
|
||||||
|
else
|
||||||
|
videoTrackDefault=$(ks-mp4-wrapper --show-video-default "${videoFile}")
|
||||||
|
audioTrackDefault=$(ks-mp4-wrapper --show-audio-default "${videoFile}")
|
||||||
|
resolutionDefault=$(ks-mp4-wrapper --show-resolution-default)
|
||||||
|
nameDefault=$(ks-mp4-wrapper --show-name-title-default "${videoFile}")
|
||||||
|
yearDefault=$(ks-mp4-wrapper --show-year-default)
|
||||||
|
genreDefault=$(ks-mp4-wrapper --show-genre-default)
|
||||||
|
# Ask the configuration
|
||||||
|
videoTrack=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the video track to map: " --entry-text "${videoTrackDefault}")
|
||||||
|
audioTrack=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the audio track to map: " --entry-text "${audioTrackDefault}")
|
||||||
|
resolution=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the resolution: " --entry-text "${resolutionDefault}")
|
||||||
|
nameVideo=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "[METADATA] Enter the name title: " --entry-text "${nameDefault}")
|
||||||
|
yearVideo=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "[METADATA] Enter the year: " --entry-text "${yearDefault}")
|
||||||
|
genreVideo=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "[METADATA] Enter the genre: " --entry-text "${genreDefault}")
|
||||||
|
# Disable on Cygwin
|
||||||
|
#mkdir -p ${HOME}/Conv
|
||||||
|
#outputFile=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
#--text "Enter the path of ouput file prefix: " --entry-text "${HOME}/Conv/Default")
|
||||||
|
# Enable on Cygwin
|
||||||
|
mkdir -p /cygdrive/c/Conv
|
||||||
|
outputFile=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the path of ouput file prefix: " --entry-text "/cygdrive/c/Conv/Default")
|
||||||
|
/usr/bin/zenity --question --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" --cancel-label="No" \
|
||||||
|
--ok-label="Yes" --width=320 --text "Do you want apply '-thread_queue_size 2048' patch?"
|
||||||
|
outputPath=$?
|
||||||
|
if [ ${outputPath} -eq 0 ] ; then
|
||||||
|
ks-mp4-wrapper --conv "${videoFile}" "${outputFile}" ${videoTrack} \
|
||||||
|
${audioTrack} ${resolution} "${nameVideo}" ${yearVideo} ${genreVideo} patch
|
||||||
|
else
|
||||||
|
ks-mp4-wrapper --conv "${videoFile}" "${outputFile}" ${videoTrack} \
|
||||||
|
${audioTrack} ${resolution} "${nameVideo}" ${yearVideo} ${genreVideo}
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
echo -n "Press ENTER to continue " ; read null
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to convert AVI with subs
|
||||||
|
# Sintax: convertAVIWithSub
|
||||||
|
function convertAVIWithSub() {
|
||||||
|
videoFile=$(/usr/bin/zenity --title "ks-zui (ks-tools) ${VERSION} (${M_DATE}) \
|
||||||
|
| Select the video file" --file-selection)
|
||||||
|
# Enable in Cygwin
|
||||||
|
videoFile=$(cygwin-path -c "${videoFile}")
|
||||||
|
# Detect configuration
|
||||||
|
if [ -z "${videoFile}" ] ; then
|
||||||
|
echo null > /dev/null
|
||||||
|
else
|
||||||
|
videoTrackDefault=$(ks-avi-wrapper --show-video-default "${videoFile}")
|
||||||
|
audioTrackDefault=$(ks-avi-wrapper --show-audio-default "${videoFile}")
|
||||||
|
subtitleTrackDefault=$(ks-avi-wrapper --show-subtitle-default "${videoFile}")
|
||||||
|
resolutionDefault=$(ks-avi-wrapper --show-resolution-default)
|
||||||
|
nameDefault=$(ks-avi-wrapper --show-name-title-default "${videoFile}")
|
||||||
|
yearDefault=$(ks-avi-wrapper --show-year-default)
|
||||||
|
genreDefault=$(ks-avi-wrapper --show-genre-default)
|
||||||
|
# Ask the configuration
|
||||||
|
videoTrack=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the video track to map: " --entry-text "${videoTrackDefault}")
|
||||||
|
audioTrack=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the audio track to map: " --entry-text "${audioTrackDefault}")
|
||||||
|
subtitleTrack=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the subtitle track to map: " --entry-text "${subtitleTrackDefault}")
|
||||||
|
resolution=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the resolution: " --entry-text "${resolutionDefault}")
|
||||||
|
nameVideo=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "[METADATA] Enter the name title: " --entry-text "${nameDefault}")
|
||||||
|
yearVideo=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "[METADATA] Enter the year: " --entry-text "${yearDefault}")
|
||||||
|
genreVideo=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "[METADATA] Enter the genre: " --entry-text "${genreDefault}")
|
||||||
|
# Disable on Cygwin
|
||||||
|
#mkdir -p ${HOME}/Conv
|
||||||
|
#outputFile=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
#--text "Enter the path of ouput file prefix: " --entry-text "${HOME}/Conv/Default")
|
||||||
|
# Enable on Cygwin
|
||||||
|
mkdir -p /cygdrive/c/Conv
|
||||||
|
outputFile=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the path of ouput file prefix: " --entry-text "/cygdrive/c/Conv/Default")
|
||||||
|
/usr/bin/zenity --question --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" --cancel-label="No" \
|
||||||
|
--ok-label="Yes" --width=320 --text "Do you want apply '-thread_queue_size 2048' patch?"
|
||||||
|
outputPath=$?
|
||||||
|
if [ ${outputPath} -eq 0 ] ; then
|
||||||
|
ks-avi-wrapper --conv-with-sub "${videoFile}" "${outputFile}" ${videoTrack} ${audioTrack} \
|
||||||
|
${subtitleTrack} ${resolution} "${nameVideo}" ${yearVideo} ${genreVideo} patch
|
||||||
|
else
|
||||||
|
ks-avi-wrapper --conv-with-sub "${videoFile}" "${outputFile}" ${videoTrack} ${audioTrack} \
|
||||||
|
${subtitleTrack} ${resolution} "${nameVideo}" ${yearVideo} ${genreVideo}
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
echo -n "Press ENTER to continue " ; read null
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to convert AVI
|
||||||
|
# Sintax: convertAVIW
|
||||||
|
function convertAVI() {
|
||||||
|
videoFile=$(/usr/bin/zenity --title "ks-zui (ks-tools) ${VERSION} (${M_DATE}) \
|
||||||
|
| Select the video file" --file-selection)
|
||||||
|
# Enable in Cygwin
|
||||||
|
videoFile=$(cygwin-path -c "${videoFile}")
|
||||||
|
# Detect configuration
|
||||||
|
if [ -z "${videoFile}" ] ; then
|
||||||
|
echo null > /dev/null
|
||||||
|
else
|
||||||
|
videoTrackDefault=$(ks-avi-wrapper --show-video-default "${videoFile}")
|
||||||
|
audioTrackDefault=$(ks-avi-wrapper --show-audio-default "${videoFile}")
|
||||||
|
resolutionDefault=$(ks-avi-wrapper --show-resolution-default)
|
||||||
|
nameDefault=$(ks-avi-wrapper --show-name-title-default "${videoFile}")
|
||||||
|
yearDefault=$(ks-avi-wrapper --show-year-default)
|
||||||
|
genreDefault=$(ks-avi-wrapper --show-genre-default)
|
||||||
|
# Ask the configuration
|
||||||
|
videoTrack=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the video track to map: " --entry-text "${videoTrackDefault}")
|
||||||
|
audioTrack=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the audio track to map: " --entry-text "${audioTrackDefault}")
|
||||||
|
resolution=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the resolution: " --entry-text "${resolutionDefault}")
|
||||||
|
nameVideo=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "[METADATA] Enter the name title: " --entry-text "${nameDefault}")
|
||||||
|
yearVideo=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "[METADATA] Enter the year: " --entry-text "${yearDefault}")
|
||||||
|
genreVideo=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "[METADATA] Enter the genre: " --entry-text "${genreDefault}")
|
||||||
|
# Disable on Cygwin
|
||||||
|
#mkdir -p ${HOME}/Conv
|
||||||
|
#outputFile=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
#--text "Enter the path of ouput file prefix: " --entry-text "${HOME}/Conv/Default")
|
||||||
|
# Enable on Cygwin
|
||||||
|
mkdir -p /cygdrive/c/Conv
|
||||||
|
outputFile=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the path of ouput file prefix: " --entry-text "/cygdrive/c/Conv/Default")
|
||||||
|
/usr/bin/zenity --question --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" --cancel-label="No" \
|
||||||
|
--ok-label="Yes" --width=320 --text "Do you want apply '-thread_queue_size 2048' patch?"
|
||||||
|
outputPath=$?
|
||||||
|
if [ ${outputPath} -eq 0 ] ; then
|
||||||
|
ks-avi-wrapper --conv "${videoFile}" "${outputFile}" ${videoTrack} \
|
||||||
|
${audioTrack} ${resolution} "${nameVideo}" ${yearVideo} ${genreVideo} patch
|
||||||
|
else
|
||||||
|
ks-avi-wrapper --conv "${videoFile}" "${outputFile}" ${videoTrack} \
|
||||||
|
${audioTrack} ${resolution} "${nameVideo}" ${yearVideo} ${genreVideo}
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
echo -n "Press ENTER to continue " ; read null
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to convert VOB
|
||||||
|
# Sintax: convertVOB
|
||||||
|
function convertVOB() {
|
||||||
|
videoFile=$(/usr/bin/zenity --title "ks-zui (ks-tools) ${VERSION} (${M_DATE}) \
|
||||||
|
| Select the video file" --file-selection)
|
||||||
|
# Enable in Cygwin
|
||||||
|
videoFile=$(cygwin-path -c "${videoFile}")
|
||||||
|
# Detect configuration
|
||||||
|
if [ -z "${videoFile}" ] ; then
|
||||||
|
echo null > /dev/null
|
||||||
|
else
|
||||||
|
videoTrackDefault=$(ks-vob-wrapper --show-video-default "${videoFile}")
|
||||||
|
audioTrackDefault=$(ks-vob-wrapper --show-audio-default "${videoFile}")
|
||||||
|
resolutionDefault=$(ks-vob-wrapper --show-resolution-default)
|
||||||
|
# Ask the configuration
|
||||||
|
videoTrack=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the video track to map: " --entry-text "${videoTrackDefault}")
|
||||||
|
audioTrack=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the audio track to map: " --entry-text "${audioTrackDefault}")
|
||||||
|
resolution=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the resolution: " --entry-text "${resolutionDefault}")
|
||||||
|
# Disable on Cygwin
|
||||||
|
#mkdir -p ${HOME}/Conv
|
||||||
|
#outputFile=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
#--text "Enter the path of ouput file prefix: " --entry-text "${HOME}/Conv/Default")
|
||||||
|
# Enable on Cygwin
|
||||||
|
mkdir -p /cygdrive/c/Conv
|
||||||
|
outputFile=$(/usr/bin/zenity --entry --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" \
|
||||||
|
--text "Enter the path of ouput file prefix: " --entry-text "/cygdrive/c/Conv/Default")
|
||||||
|
/usr/bin/zenity --question --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" --cancel-label="No" \
|
||||||
|
--ok-label="Yes" --width=320 --text "Do you want apply '-thread_queue_size 2048' patch?"
|
||||||
|
outputPath=$?
|
||||||
|
if [ ${outputPath} -eq 0 ] ; then
|
||||||
|
ks-vob-wrapper --conv "${videoFile}" "${outputFile}" ${videoTrack} \
|
||||||
|
${audioTrack} ${resolution} patch
|
||||||
|
else
|
||||||
|
ks-vob-wrapper --conv "${videoFile}" "${outputFile}" ${videoTrack} \
|
||||||
|
${audioTrack} ${resolution} "${nameVideo}" ${yearVideo} ${genreVideo}
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
echo -n "Press ENTER to continue " ; read null
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Choose subtitles in MP4 convert
|
||||||
|
function subtitlesMP4() {
|
||||||
|
/usr/bin/zenity --question --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" --cancel-label="No" \
|
||||||
|
--ok-label="Yes" --width=320 --text "Do you want enable subtitles?"
|
||||||
|
outputPath=$?
|
||||||
|
if [ ${outputPath} -eq 0 ] ; then
|
||||||
|
convertMP4WithSub
|
||||||
|
else
|
||||||
|
convertMP4
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Choose subtitles in AVI convert
|
||||||
|
function subtitlesAVI() {
|
||||||
|
/usr/bin/zenity --question --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" --cancel-label="No" \
|
||||||
|
--ok-label="Yes" --width=320 --text "Do you want enable subtitles?"
|
||||||
|
outputPath=$?
|
||||||
|
if [ ${outputPath} -eq 0 ] ; then
|
||||||
|
convertAVIWithSub
|
||||||
|
else
|
||||||
|
convertAVI
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Show main menu
|
||||||
|
echo ""
|
||||||
|
echo "* Starting ks-zui (ks-tools) ${VERSION} (${M_DATE})"
|
||||||
|
echo ""
|
||||||
|
showMenu=0
|
||||||
|
while [ ${showMenu} -eq 0 ] ; do
|
||||||
|
clear
|
||||||
|
opcion=$(/usr/bin/zenity --width=420 --height=560 --list --title "ks-zui (ks-tools) ${VERSION} ($M_DATE)" \
|
||||||
|
--column "Available options:" "### CONVERSION OPTIONS ###" "Show video file information" \
|
||||||
|
"Convert video file to MP4" "Convert video file to AVI" "Convert video file to VOB" \
|
||||||
|
"########################" "### UPLOAD OPTIONS ###" "Upload videos file(s) to server" \
|
||||||
|
"Upload audio file(s) to server" "Upload common file(s) to server" "Upload recursively file(s) to server"\
|
||||||
|
"Remove configuration" "Show configuration" "Edit configuration" \
|
||||||
|
"About" "Exit")
|
||||||
|
opcion=$(echo ${opcion} | cut -d "|" -f 1)
|
||||||
|
# opcion=$(echo ${opcion} | cut -d "|" -f 1)
|
||||||
|
echo ${opcion}
|
||||||
|
if [ "${opcion}" == "### CONVERSION OPTIONS ###" ] ; then
|
||||||
|
echo null > /dev/null
|
||||||
|
elif [ "${opcion}" == "Show video file information" ] ; then
|
||||||
|
showVideoInfo
|
||||||
|
elif [ "${opcion}" == "Convert video file to MP4" ] ; then
|
||||||
|
subtitlesMP4
|
||||||
|
elif [ "${opcion}" == "Convert video file to AVI" ] ; then
|
||||||
|
subtitlesAVI
|
||||||
|
elif [ "${opcion}" == "Convert video file to VOB" ] ; then
|
||||||
|
convertVOB
|
||||||
|
elif [ "${opcion}" == "########################" ] ; then
|
||||||
|
echo null > /dev/null
|
||||||
|
elif [ "${opcion}" == "### UPLOAD OPTIONS ###" ] ; then
|
||||||
|
echo null > /dev/null
|
||||||
|
elif [ "${opcion}" == "Upload videos file(s) to server" ] ; then
|
||||||
|
ks-upv -i
|
||||||
|
/usr/bin/zenity --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" --info --width=300 \
|
||||||
|
--text "File(s) upload is complete!"
|
||||||
|
elif [ "${opcion}" == "Upload audio file(s) to server" ] ; then
|
||||||
|
ks-upa -i
|
||||||
|
/usr/bin/zenity --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" --info --width=300 \
|
||||||
|
--text "File(s) upload is complete!"
|
||||||
|
elif [ "${opcion}" == "Upload common file(s) to server" ] ; then
|
||||||
|
ks-upf -i
|
||||||
|
/usr/bin/zenity --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" --info --width=300 \
|
||||||
|
--text "File(s) upload is complete!"
|
||||||
|
elif [ "${opcion}" == "Upload recursively file(s) to server" ] ; then
|
||||||
|
ks-upr -i
|
||||||
|
/usr/bin/zenity --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" --info --width=300 \
|
||||||
|
--text "File(s) upload is complete!"
|
||||||
|
elif [ "${opcion}" == "Remove configuration" ] ; then
|
||||||
|
ks-upf -r
|
||||||
|
/usr/bin/zenity --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" --info --width=300 \
|
||||||
|
--text "The configuration has been removed!"
|
||||||
|
elif [ "${opcion}" == "Show configuration" ] ; then
|
||||||
|
ks-upf -c
|
||||||
|
echo -n "Press ENTER to continue " ; read null
|
||||||
|
elif [ "${opcion}" == "Edit configuration" ] ; then
|
||||||
|
ks-upf -e
|
||||||
|
elif [ "${opcion}" == "About" ] ; then
|
||||||
|
showAbout
|
||||||
|
elif [ "${opcion}" == "Exit" ] ; then
|
||||||
|
showMenu=1
|
||||||
|
else
|
||||||
|
/usr/bin/zenity --title "ks-zui (ks-tools) ${VERSION} (${M_DATE})" --warning --width=300 \
|
||||||
|
--text "Choose one of the menu options"
|
||||||
|
fi
|
||||||
|
done
|
Loading…
Reference in New Issue
Block a user