Skip to content

Latest commit

 

History

History
240 lines (168 loc) · 9 KB

README.md

File metadata and controls

240 lines (168 loc) · 9 KB

Pixel Manager


Welcome to the Pixel Manager, a lightweight console based file manager for Linux systems! This has been developed as a part of the CS 301 Operating Systems Course, IIT Gandhinagar by Arpita Kabra, Devvrat Joshi, Viraj Shah and Vrutik Shah.

Table of contents

  1. Installation
  2. Features
    1. File Management System
    2. Terminal
    3. Editor
    4. File Search
  3. All Commands
  4. Statistics and Comparision

The main features of the Pixel Manager are:

  • File System Management
  • Built-In Terminal
  • Built-In File Editor
  • Quick File Search

Installing Pixel Manager

  1. Clone this repository
git clone https://github.com/devvrat-joshi/Pixel-Manager.git
  1. Navigate to the folder
cd Pixel-Manager
  1. Run make This will automatically install dependencies as well as run the pixel manager. In case make does not work. Try running
python3 main.py
  1. If it runs into any error, try running Ctrl + c to restore into normal state. Run it again to exit from the File Manager!

Directory Structure 📂

Pixel Manager
├─ README.md                   -- Readme
├─ main.py                     -- main
├─ depend.py                   -- main dependencies
├─ stats.py                    -- stats
├─ create.py                   -- create file/folders
├─ terminal_lib.py             -- terminal
├─ search.py                   -- search frontend
├─ preprocess_trie_hash.py     -- Trie generation
├─ powerful_editor.py          -- editor
├─ search_files                -- stores trie
└─ makefile                    -- makefile

Main Features Explained

File Management System

The main window of the File Manager provides an easy way to navigate through any files and directories on the system. The left panel shows the contents of the current directory, and highlights the selected content with green color. The center panel is for search window and shows the contents of the selected directory (if not a file). The right panel shows stats of the selected file/directory along with CPU and RAM usage. Here is the preview of the main window:

File Manager Main window

Navigate using the arrow keys! Right key opens to the selected directory and left key moves back to the previous directory.

Scrolling through current directory

The bottom row bar displays all the possible commands to copy, move, delete and create new files and folders, search through directories, and start the Terminal!


Terminal

The built-in terminal can be toggled by pressing Shift+TAB It can run all Linux commands and system calls. It can also execute user defined programs. However, it does not support interactive programs yet.

Here's a preview of how it looks:

Terminal Preview

The input can be given at the bottom most line and the output will be presented in the Terminal Output panel. The terminal panel becomes orange if your program is still executing. The terminal also supports scrolling if the output is more than the screen size.


Editor

To edit files on the go, navigate to the file and pressing e would open the file in the built-in editor. The editor is line-by-line scrollable and we have made sure to handle several corner cases that may arise.

The current editor is customized for python files, highlighting keywords, adding indentation spaces and auto-completing brackets and strings.

Editor Preview

Editor Screenshot

The editor currently also supports cut/copy/paste and find-replace utilities. Following are the screenshots for the same.

Selecting Lines

Selecting Files

Highlighting the found words

Highlighting the found words


Quick Search

To enable the search bar, enter ctrl + a. It initiates a trie creation from the current folder in a different process. As soon as the trie is created, it is returned to the main process (the File Manager) to initiate the search. Larger the folder size, larger the size of the trie and more RAM used for storing. However, once created, the trie is stored for further use in Pickle File format which uses very less space and saves trie creation time! Here is a preview of search!

Search Preview

The top bar shows the trie creation process!

Here is how searching looks:

Searching through files/folders

It can search for thousands of files giving results instantly. Scroll and navigate through the found items. The search_files folder stores the pickle files created after intiating search.

Scrolling through results

When searching, top right corner shows the number of search results. Scrolling through the search results and then pressing enter will take you to the paths on which the actual file/folder is present.

After selecting result, scrolling through the locations where result appear

After pressing enter on one of the paths, you will be redirected to that location.

Search implementation flowchart


List of All Commands

In the Manager

Command Action
Arrows Keys Navigate through the files
e (when on a file) Open the file editor
g Create a new folder
c Copy the current file or folder
k Create a new file
m Move the current file or folder
v Paste the cut/copied item
d+r (will ask for confirmation) Delete the current File or Folder
Shift + TAB Open the terminal
Ctrl + a Start a search within the selected folder
END key Close the Pixel Manager

In the Terminal

Command Action
Shift+Tab Start Terminal
Shift+Tab Close Terminal
Enter To execute the command
Up Down Arrow Keys To scroll through the output of terminal
Esc To return control to terminal after viewing output in terminal window

In the Editor

Normal Mode

Command Action
e Start editor
Ctrl+f Find
Ctrl+r Replace Text
Escape Enter Command Mode

Command Mode

Command Action
s Enter Visual Mode (for cut/copy/paste)
i Enter normal Mode
q Quit Editor (option to save and discard changes)

Visual Mode

Command Action
c Copy Text
x Cut Text
v Paste Text
Escape To return to normal mode

During Search

Command Action
Ctrl+a To begin search
Ctrl+a To return from search
Up Down Arrow Keys To scroll through search results
Enter To navigate to any search result

Some Statistics

.



TODO list

  • Bind Delete, Home and End key
  • Clean code
  • Undo/Redo in editor
  • Folder-Wise Trie building and processing
  • Fuzzy search within editor

Known Issues

  • Error with backspace after bracket autocomplete
  • Not able to navigate during find
  • Find phrase length more than allocated space
  • Single replace