Skip to content
Snippets Groups Projects
Commit a617da5d authored by samvo's avatar samvo
Browse files

minor fixes

parent 856fa4fd
No related branches found
No related tags found
No related merge requests found
.vscode/settings.json
......@@ -12,6 +12,6 @@
### Install
Copy files `s2fLocalization.sh`, `selected2folder.desktop` and `selected2folder.s` to `~/.local/share/kservices5/ServiceMenus/`
Copy files `s2fLocalization.sh`, `selected2folder.desktop` and `selected2folder.sh` to `~/.local/share/kservices5/ServiceMenus/`
You may add your own language. Edit [`this file`](https://www.opencode.net/samvo/create-folder-from-selected-files/-/edit/master/selected2folder/s2fLocalization.sh) and send push request
......@@ -51,7 +51,6 @@ function window_message()
esac
}
#Standart system name for new folder
function def_name()
{
......
......@@ -3,23 +3,23 @@
function add_prefix_name() {
NUM=0
NEWNAME="$1"
while [ -d "$NEWNAME" ]
TEMP="$1"
while [ -d "$TEMP" ]
do
NUM="$(($NUM+1))"
NEWNAME="$1"\ "($NUM)"
TEMP="$1"\ "($NUM)"
done
printf "$NEWNAME"
printf "$TEMP"
}
function ask_name(){
kdialog --title "$(window_title)" --inputbox "$(window_message)" "$1" --icon "folder-add" --geometry 450x300
function ask_name() {
kdialog --title "$(window_title)" --inputbox "$(window_message)" "$1" --geometry 450x300
}
NAME="$(def_name)"
NAME=$(add_prefix_name "$NAME")
NAME="$(add_prefix_name "$NAME")"
NAME="$(ask_name "$NAME")"
while [ -d "$NAME" ]
do
NAME=$(add_prefix_name "$NAME")
NAME="$(add_prefix_name "$NAME")"
NAME="$(ask_name "$NAME")"
done
mkdir "$NAME" && cd "$NAME" && mv "$@"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment