Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- PLIK=""
- TMP=0
- menu()
- {
- ARRAY=("Nowy Katalog")
- ARRAY+=("Kopiuj")
- ARRAY+=("Wklej")
- ARRAY+=("Przenies")
- ARRAY+=("Zostaw")
- ARRAY+=("Usun")
- ARRAY+=("Koniec")
- ARRAY+=(" ")
- ARRAY+=($(ls))
- clear
- }
- while [ 1 ];
- do
- menu
- SCIEZKA=($(pwd))
- AKCJA=`zenity --list --text="Menedzer plikow" --column=Menu "${ARRAY[@]}" --height 720 --width 1280 --title $SCIEZKA`
- if [[ $? -eq 1 ]]; then
- cd ..
- menu
- fi
- if [[ "$AKCJA" == "Koniec" ]]; then
- break
- elif [[ "$AKCJA" == "Nowy Katalog" ]]; then
- NAZWA=`zenity --entry --title "Podaj nazwe" --text "Nazwa"`
- mkdir $NAZWA
- menu
- elif [[ "$AKCJA" == "Usun" ]]; then
- AKCJA=`zenity --list --text="Menadzer plikow" --column=Menu "${ARRAY[@]}" --height 720 --width 1280 --title $SCIEZKA`
- if [[ -e "$AKCJA" ]]; then
- rm -R "$AKCJA"
- zenity --error --text "$AKCJA Usunieto"
- menu
- fi
- elif [[ "$AKCJA" == "Kopiuj" ]]; then
- AKCJA=`zenity --list --text="Menadzer plikow" --column=Menu "${ARRAY[@]}" --height 720 --width 1280 --title $SCIEZKA`
- if [[ -e "$AKCJA" ]]; then
- PLIK="$SCIEZKA/$AKCJA"
- zenity --info --text "Kopiowanie $AKCJA"
- menu
- fi
- elif [[ "$AKCJA" == "Wklej" ]]; then
- cp -r "$PLIK" "$SCIEZKA"
- menu
- elif [[ "$AKCJA" == "Przenies" ]]; then
- AKCJA=`zenity --list --text="Menadzer plikow" --column=Menu "${ARRAY[@]}" --height 720 --width 1280 --title $SCIEZKA`
- if [[ -e "$AKCJA" ]]; then
- PLIK="$SCIEZKA/$AKCJA"
- zenity --info --text "Przenoszenie $AKCJA"
- menu
- fi
- elif [[ "$AKCJA" == "Zostaw" ]]; then
- mv "$PLIK" "$SCIEZKA"
- menu
- else
- for file in ${ARRAY[@]}
- do
- if [[ "$AKCJA" == "$file" && $TMP == 0 ]]; then
- if [[ -d "$file" ]]; then
- cd "$file"
- menu
- elif [[ $(mimetype -b "$file") == text/* ]]; then
- gedit $file &
- elif [[ $(mimetype -b "$file") == application/* ]]; then
- gnome-terminal --working-directory="$HOME/randomdir" -x bash -c "$SCIEZKA/$file; exec bash" &
- fi
- fi
- done
- fi
- done;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement