From a88b875013fcb54b4d997a79d6fe7504d114ab6d Mon Sep 17 00:00:00 2001 From: q3aql Date: Mon, 8 Mar 2021 01:49:48 +0100 Subject: [PATCH] Prompt files for Cygwin/Windows --- cygwin/prompt/.bashrc | 140 +++++++++ cygwin/prompt/.minttyrc | 4 + cygwin/prompt/ks-tools-zui.cmd.disabled | 18 ++ cygwin/prompt/ks-tools.ico | Bin 0 -> 102052 bytes cygwin/prompt/ks-tools.png | Bin 0 -> 1871 bytes cygwin/prompt/ks-zui.disabled | 380 ++++++++++++++++++++++++ 6 files changed, 542 insertions(+) create mode 100644 cygwin/prompt/.bashrc create mode 100644 cygwin/prompt/.minttyrc create mode 100644 cygwin/prompt/ks-tools-zui.cmd.disabled create mode 100644 cygwin/prompt/ks-tools.ico create mode 100644 cygwin/prompt/ks-tools.png create mode 100644 cygwin/prompt/ks-zui.disabled diff --git a/cygwin/prompt/.bashrc b/cygwin/prompt/.bashrc new file mode 100644 index 0000000..cdc8d56 --- /dev/null +++ b/cygwin/prompt/.bashrc @@ -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 "" diff --git a/cygwin/prompt/.minttyrc b/cygwin/prompt/.minttyrc new file mode 100644 index 0000000..e33a6d7 --- /dev/null +++ b/cygwin/prompt/.minttyrc @@ -0,0 +1,4 @@ +Font=Consolas +FontHeight=11 +Columns=120 +Rows=27 diff --git a/cygwin/prompt/ks-tools-zui.cmd.disabled b/cygwin/prompt/ks-tools-zui.cmd.disabled new file mode 100644 index 0000000..247181b --- /dev/null +++ b/cygwin/prompt/ks-tools-zui.cmd.disabled @@ -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 diff --git a/cygwin/prompt/ks-tools.ico b/cygwin/prompt/ks-tools.ico new file mode 100644 index 0000000000000000000000000000000000000000..8c1ae783b932dac8464d4ece0f25e5b60c3fcf5f GIT binary patch literal 102052 zcmeI52V4}__Q!`{FlsD`iROuD5*JWoK_!#`irBKEpdd}U2pAPHHdLgjiJkad{Ra~j zPB+d->h~NWxhd!T0g~RLg$XXI+9&?=6^ZX4z@yi2by+UaDcS=PBnk* z=xIyuJkQ~;^L5hED*km}RC}{sXZ!b>F=y-E?rUeY>u2(y+tK%@U9n2F`at*IHV4Ou zPR6VH4_x)m`1jh4bD#D8uz{n$Y}frmfl0UM8B+}ObObgIPEL!@gbqndoVa0HLQauG z-o)y#u6n7H)@16Z_Dn82GeIxby))HOJ5giNrPmW4_b9X$c;AT% zTXs#+ebX!x#G3E^g26nxDIO zWKb{a13l^|0}bli4pje1l%@AuRLAbrl-s-v%_p}KMph=+*SucsdFEJVetBW0c~-&0 z-DzEmf<5wVSN8denzEe=Ki5uj58Ctkq}-iU6;t*W9ZNS|LAdLUx;){tb)`GvDc<7>X6@}JKx*cDdkzFCj& zaV%_^dmsPH2S&Rszi%gaG$#7R;I(&lMT{(exKY6CWIZAzS@%exA=Up-xz;tEl3&ZC z=tUmGXTN3anHP1*KXm@rf|=V7CgpwVY)qWZ2-bX(R#tvI-}8COxWgUXf{(a|oT%F4 z9x_U|c6&_8uYcyQ%`UARniD&Mzu?hRf4_`?gx;oq=6TXt)&6B`uEZaugM*5mRUKZr zc)y0F_Zj2xp3lrmW9i7Sm(PN0O5@^g6rPMfw&GKM+~Uh_n~S;}8cHA(oY8n>XkV4@ zmu-JHA>s3tPoLh({L?n1ix-__5t3|m`-sSe;{ROy_>T<{itzx z`eA!&2ly1QUF*p7pv6CFXD;z8(Aa67_2Y%R&kkmO`b|gSE{(!V6m_YC%;lJveV(@ZGC-uO*cR6+c***vB#< zf7I(7qd+ge44sv?U%v_DoZzB^`?Hsp7!xLeNpZV6ov8UMen^UL&v?IUho1(;_lV5y zI4WmxO=6$BKk`mK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t}f%XfGKky7r4!hB~a*Gi)S>Ji5 z!j6rez*_$=wC@IN#5FS*$uhMDsxb3JQ8-Siv;WiCBU)&(hy>|N^Yr*c>~>I>WJ9o? zMXfr)MCkZdbYXY^Xi9ycVVg@0*Ngyut-IHnmndz4>u)QGB5Wk=H94~p*>4l*mov%o z(0gn^xUDvRy3o%su6LoqFv3@ZP{P;tvaR%pOFIs&S0HWJTfRkn41)Y#EPB*Nu4r-Y zX*cbCz{HSQ*Y5`i_8ea)yiCDDG}@)YFamf(ib-OW`3qMz@DXP8n+S4cS+Q$dX&~@h zi(7rEhfHlDh}>B8y@_lp8CMan4~SqR4d#FDLAdpl{0Y7uwL*7rl|u^&b?5RwJ$z~k zMu3$>utac+H(P9U>(0=aTU%@{i0GhGqb_O{*X5=_#V{Lt9>{bgG4ihgxwD9{MGe6o z^}||^39G3lR8cQtduWilL(er#FGFhcORFmI=>|N3Yu?kos6ixAx>J^@(DTvuu8i@uf0JN-L+?4nQZZ<<-qIK9R1*2*W;UPr5;h{QA;@@(yFmsRQ zkRa7UMTDe^oN}Zi_18Rw5b6~7M3sUmWiF7@G04>BuWi~pe@SL#z;0mo`zMdEWnl9emj z+~uUm*UqUrVK1+9;r_rRtb9}Z#OPrAlq_8u&HP|0C36 z7t;tJTvKnwWzO#Q8g&6kX /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