/MFC_Linux_File_Explorer

A Bash Script Library that acts as a Dialog based File Explorer on the Command Terminal (CUI).

Primary LanguageShellGNU General Public License v3.0GPL-3.0

MFC_Linux_File_Explorer


A Bash Script Library that acts as a Dialog based File Explorer on a Linux Command Terminal (CUI).



This repository contains 4 MAIN files :

1.  mfc_linux_fileexplorer.sh                 =>  Main Source (Library) File
2.  *headerdesign.sh                          =>  Supplementary Library File
3.  fileexplorer_demo_1.sh                    =>  Demo 1 File
4.  fileexplorer_demo_2.sh                    =>  Demo 2 File
5.  mfc_linux_fileexplorer_demo_output.txt    =>  Youtube links to the outputs of Demos 1 and 2

* REF - https://github.com/melwyncarlo/Bash_Header_Design
  For Designing CUI-based Heading Banners



The source library contains 1 MAIN function.
Given below is a sample function call and descriptive lists of arguments :

1. Including the Main Source File in Demo Script Files and Function Call

start_directory="/"
root_access="0"

gnome-terminal --title="MFC Linux File Explorer" -- bash -c \ 'source src/mfc_linux_fileexplorer.sh 24 80 37 150; mfc_fileexplore "$start_directory" "0" "0" "0" "0" "0" "1" "1" "load" "$root_access"'

NOTE :

  • The main source file is located in the 'src' directory.
  • All temporary data and result based data will be stored in the 'src/bin' directory.
  • This application is meant to be used on a separate terminal window which is temporarily allocated.
  • If the variable start_directory="", then the user's 'Home' directory will be used.
  • If the variable start_directory="/", it implies the 'Root' directory.
  • If the variable root_access="0", then certain locked files and folders cannot be selected.
  • If the variable root_access="1", then a password will be requested to access root.
  • The values 24 80 37 150 are the inputted heights and widths of the command terminal for Simple and Complete modes respectively.
  • The values 24 80 37 150 must be within the limits as prescribed at the top of the main source file.

2. List of Arguments

mfc_fileexplore       -->   Parameter 1 - Start Directory
                            Parameter 2 - Complete Mode Options Mode
                            Parameter 3 - Complete Mode
                            Parameter 4 - Show Hidden Files Options Mode
                            Parameter 5 - Show Hidden Files Mode
                            Parameter 6 - Show Only ... Options Mode
                            Parameter 7 - Show Only ... Mode ( 1 => Files; 2 => Folders; 3 => Both )
                            Parameter 8 - Allow Multiple Selection Mode
                            Parameter 9 - File Explorer Action Text
                            Parameter 10 - Root Access Mode

NOTE :

  • Unless otherwise stated, in mode arguments, an input value of 1 is ON, and 0 is OFF.
  • Simple Mode is a smaller version with less visible details, whereas Complete Mode includes all details and is larger.
  • Options Mode implies whether the relevant options are to be made available for the user to switch.
  • If Parameter 8 is OFF, then only one file can be selected per dialog session.
  • If Parameter 8 is ON, then multiple files (within a particular folder) can be selected per dialog session.

4. List of Results

These results can be accessed :

  1. as Variables
mfc_fileexplorer_exit     :   0   => Process is Running
                              1   => Process has terminated Sucessfully
                             -1   => Proces has terminated Unsuccessfully
mfc_fileexplorer_dirpath  :   Contains the parent directory name and path of the select file(s) or folder(s)
mfc_fileexplorer_filename :   Contains the names of the selected file(s) or folder(s)
mfc_fileexplorer_filepath :   Concatenation of the Parent Directory Path and the Filename
  1. in Text Files
src/bin/mfc_fileexplorer_exit.txt
src/bin/mfc_fileexplorer_dirpath.txt
src/bin/mfc_fileexplorer_filename.txt
src/bin/mfc_fileexplorer_filepath.txt



For any other queries :

Email me on :