Skip to content

Cyxuan0311/FTB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

98 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

FTB (Terminal File Browser)

FTB Logo

C++17 FTXUI

Platform Tool SSH MySQL

A powerful terminal-based interactive file browser developed using FTXUI library, providing intuitive directory navigation, file management, SSH remote connection, and MySQL database management capabilities.

Demo

Demo

Features

๐Ÿ—‚๏ธ Core File Management

  • Real-time directory content display
  • Color-coded items (blue for directories/red for files)
  • Top status bar with current time
  • Path history stack (support backward navigation)
  • Keyboard navigation (โ†‘โ†“ keys for selection, Enter to enter directories)
  • Auto-refresh (100ms UI update interval)
  • Directory search functionality
  • Memory usage calculation for selected items

๐Ÿ› ๏ธ File Operations

  • File/folder creation and deletion
  • Copy, cut, and paste operations
  • File/folder renaming
  • Clipboard management
  • Attribute preview and file content inspection

๐Ÿ“ Advanced Features

  • Vim-Like editing mode - Built-in text editor
  • Image preview - Support for JPG, PNG, BMP, GIF
  • Video playback - MP4, AVI, MKV, MOV, FLV, WMV support
  • Binary file handling - Smart detection and protection

๐Ÿ”— SSH Remote Connection โœจ

  • Secure SSH connections to remote servers
  • Password and key-based authentication
  • Remote directory browsing
  • Command execution on remote hosts
  • Connection status monitoring
  • Easy-to-use connection dialog

๐Ÿ—„๏ธ MySQL Database Management โœจ

  • Local and remote MySQL connections with easy configuration
  • Graphical CRUD operations through intuitive button interface
  • Database management - create, delete, and select databases
  • Table operations - create, delete, and view table structures
  • Data manipulation - insert, update, delete, and query data
  • SQL query executor - direct SQL execution with result display
  • Connection status monitoring and error handling
  • Tabbed interface for organized database management

๐ŸŽจ Customizable Theme System โœจ

  • Multiple built-in themes: default, dark, light, colorful, minimal
  • Customizable colors for all interface elements
  • Real-time theme switching with hotkeys
  • Configuration file support (.ftb) for persistent customization
  • Color schemes for files, directories, status bars, and dialogs
  • Layout customization including panel ratios and item counts
  • Style options for icons, animations, and mouse support

๐ŸŽจ User Experience

  • Modern terminal UI with FTXUI
  • Responsive design and smooth animations
  • Intuitive keyboard shortcuts
  • Error handling and user feedback

Dependencies

# Install required libraries
sudo apt-get install libftxui-dev libssh2-1-dev

# Install MySQL development library
sudo apt-get install libmysqlclient-dev

# For video/image support (optional)
sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libx11-dev

Configuration

FTB uses a .ftb configuration file located in your home directory (~/.ftb) to customize the interface appearance and behavior.

Quick Setup

  1. Copy the template: cp config/.ftb.template ~/.ftb
  2. Edit the file: Customize colors, themes, and settings
  3. Restart FTB: Changes take effect immediately

Available Themes

  • default: Classic blue and white theme
  • dark: Dark background with high contrast
  • light: Light background for bright environments
  • colorful: Vibrant colors for visual appeal
  • minimal: Clean, monochrome design

Configuration Sections

  • Colors: Customize all interface colors
  • Layout: Adjust panel sizes and item counts
  • Style: Toggle icons, animations, and features
  • Themes: Switch between predefined themes
  • MySQL/SSH: Set default connection parameters

See Configuration Guide for detailed options.

Alternative Installation Methods

CentOS/RHEL/Fedora:

sudo yum install mysql-devel mysql
# or
sudo dnf install mysql-devel mysql

Arch Linux:

sudo pacman -S mysql

Build & Run

chmod +x ./build.sh
source ./build.sh      # Run build script
FTB             # Launch application

Uninstall(Local)

./uninstall.sh

Usage

๐Ÿ—‚๏ธ Navigation

  • โ†‘/โ†“: Navigate file list
  • Enter: Open selected directory
  • Backspace/โ†: Return to parent directory
  • ESC: Exit program
  • Search box: Filter files by keyword

๐Ÿ› ๏ธ File Operations

  • Ctrl+f: Create new file
  • Ctrl+k: Create new directory
  • Delete: Remove selected item
  • Alt+n: Rename selected item
  • Ctrl+t: Copy selected item
  • Ctrl+x: Cut selected item
  • Ctrl+n: Paste items
  • Alt+c: Add to clipboard
  • Alt+g: Clear clipboard

๐Ÿ“ Content Viewing

  • Space: View item attributes
  • Ctrl+p: Preview file content
  • Alt+v: Image/text preview
  • Alt+p: Video playback
  • Ctrl+e: Vim-like editor

๐Ÿ”— SSH Remote Connection

  • Ctrl+s: Open SSH connection dialog
    • Enter hostname/IP, port, username
    • Choose password or key authentication
    • Specify remote directory
    • Connect and browse remote files

๐Ÿ—„๏ธ MySQL Database Management

  • Alt+d: Open MySQL database management dialog
    • Configure local or remote MySQL connection
    • Manage databases and tables
    • Execute SQL queries with visual results
    • Perform CRUD operations through buttons

๐ŸŽจ Theme and Configuration

  • Ctrl+t: Switch between available themes
  • Ctrl+r: Reload configuration file
  • ~/.ftb: Customize colors, layout, and behavior
  • Multiple themes: default, dark, light, colorful, minimal

๐ŸŽฏ Advanced Features

  • Ctrl+E: Enter Vim editing mode for text files
  • Mouse support: Click to select and navigate

SSH Connection Example

Quick Start

  1. Press Ctrl+S to open the SSH connection dialog
  2. Fill in the connection details:
    • Hostname: 192.168.1.100 or server.example.com
    • Port: 22 (default SSH port)
    • Username: your_username
    • Authentication: Choose password or private key
    • Remote Directory: /home/username (default)
  3. Click "Confirm" to establish the connection
  4. Browse remote files and execute commands

Supported Authentication Methods

  • Password Authentication: Enter your SSH password
  • Key Authentication: Specify path to your private key file

Security Features

  • Encrypted SSH protocol (libssh2)
  • Secure password handling
  • Key-based authentication support
  • Connection status monitoring

MySQL Database Management Example

Quick Start

  1. Press Alt+D to open the MySQL database management dialog
  2. Configure connection settings:
    • Local Connection: Use localhost or 127.0.0.1 as hostname
    • Remote Connection: Enter remote server IP or hostname
    • Port: Default 3306 (MySQL standard port)
    • Username/Password: Your MySQL credentials
    • Database: Optional, can be selected after connection
  3. Click "่ฟžๆŽฅ" to establish the connection
  4. Use the tabbed interface for different operations:
    • ่ฟžๆŽฅ่ฎพ็ฝฎ: Configure and manage connections
    • ๆ•ฐๆฎๅบ“ๆ“ไฝœ: Create, delete, and select databases
    • ่กจๆ“ไฝœ: Manage tables and perform CRUD operations
    • ๆŸฅ่ฏขๆ‰ง่กŒ: Execute custom SQL queries

Supported Operations

  • Database Management: Create, delete, and switch databases
  • Table Operations: Create, delete, and view table structures
  • Data Manipulation: Insert, update, delete, and query data
  • SQL Execution: Run custom SQL statements with result display
  • Connection Monitoring: Real-time connection status and error handling

Features

  • Smart Connection Detection: Automatically identifies local vs remote connections
  • Visual CRUD Interface: Button-based operations for common database tasks
  • Real-time Results: Immediate display of query results and affected rows
  • Error Handling: Comprehensive error messages and connection status
  • Tabbed Interface: Organized workflow for different database operations

Project Structure

FTB/
โ”œโ”€โ”€ include/                    # Header files
โ”‚   โ”œโ”€โ”€ FTB/                   # Core FTB headers
โ”‚   โ”‚   โ”œโ”€โ”€ FileManager.hpp
โ”‚   โ”‚   โ”œโ”€โ”€ ThreadGuard.hpp
โ”‚   โ”‚   โ”œโ”€โ”€ FileSizeCalculator.hpp
โ”‚   โ”‚   โ”œโ”€โ”€ Vim_Like.hpp
โ”‚   โ”‚   โ”œโ”€โ”€ DirectoryHistory.hpp
โ”‚   โ”‚   โ”œโ”€โ”€ detail_element.hpp
โ”‚   โ”‚   โ”œโ”€โ”€ ConfigManager.hpp  # Configuration management
โ”‚   โ”‚   โ”œโ”€โ”€ ThemeManager.hpp   # Theme management
โ”‚   โ”‚   โ””โ”€โ”€ HandleManager/
โ”‚   โ”‚       โ”œโ”€โ”€ UIManager.hpp
โ”‚   โ”‚       โ””โ”€โ”€ UIManagerInternal.hpp
โ”‚   โ”œโ”€โ”€ UI/                    # User interface components
โ”‚   โ”‚   โ”œโ”€โ”€ RenameDialog.hpp
โ”‚   โ”‚   โ”œโ”€โ”€ NewFileDialog.hpp
โ”‚   โ”‚   โ”œโ”€โ”€ NewFolderDialog.hpp
โ”‚   โ”‚   โ”œโ”€โ”€ FilePreviewDialog.hpp
โ”‚   โ”‚   โ”œโ”€โ”€ FolderDetailsDialog.hpp
โ”‚   โ”‚   โ”œโ”€โ”€ SSHDialog.hpp      # SSH connection dialog
โ”‚   โ”‚   โ””โ”€โ”€ MySQLDialog.hpp    # MySQL database management dialog
โ”‚   โ”œโ”€โ”€ Connection/            # Connection backends
โ”‚   โ”‚   โ”œโ”€โ”€ SSHConnection.hpp  # SSH connection backend
โ”‚   โ”‚   โ””โ”€โ”€ MySQLConnection.hpp # MySQL connection backend
โ”‚   โ””โ”€โ”€ Video_and_Photo/       # Media handling
โ”‚       โ”œโ”€โ”€ ImageViewer.hpp
โ”‚       โ””โ”€โ”€ VideoPlayer.hpp
โ”œโ”€โ”€ src/                       # Source code
โ”‚   โ”œโ”€โ”€ FTB/                   # Core FTB implementation
โ”‚   โ”‚   โ”œโ”€โ”€ main.cpp
โ”‚   โ”‚   โ”œโ”€โ”€ FileManager.cpp
โ”‚   โ”‚   โ”œโ”€โ”€ DirectoryHistory.cpp
โ”‚   โ”‚   โ”œโ”€โ”€ detail_element.cpp
โ”‚   โ”‚   โ”œโ”€โ”€ ThreadGuard.cpp
โ”‚   โ”‚   โ”œโ”€โ”€ Vim_Like.cpp
โ”‚   โ”‚   โ”œโ”€โ”€ FileSizeCalculator.cpp
โ”‚   โ”‚   โ”œโ”€โ”€ ConfigManager.cpp  # Configuration management
โ”‚   โ”‚   โ”œโ”€โ”€ ThemeManager.cpp   # Theme management
โ”‚   โ”‚   โ””โ”€โ”€ HandleManager/
โ”‚   โ”‚       โ”œโ”€โ”€ UIManager.cpp
โ”‚   โ”‚       โ””โ”€โ”€ UIManagerInternal.cpp
โ”‚   โ”œโ”€โ”€ UI/                    # UI components
โ”‚   โ”‚   โ”œโ”€โ”€ RenameDialog.cpp
โ”‚   โ”‚   โ”œโ”€โ”€ NewFileDialog.cpp
โ”‚   โ”‚   โ”œโ”€โ”€ NewFolderDialog.cpp
โ”‚   โ”‚   โ”œโ”€โ”€ FilePreviewDialog.cpp
โ”‚   โ”‚   โ”œโ”€โ”€ FolderDetailsDialog.cpp
โ”‚   โ”‚   โ”œโ”€โ”€ SSHDialog.cpp      # SSH dialog implementation
โ”‚   โ”‚   โ””โ”€โ”€ MySQLDialog.cpp    # MySQL dialog implementation
โ”‚   โ”œโ”€โ”€ Connection/            # Connection backends
โ”‚   โ”‚   โ”œโ”€โ”€ SSHConnection.cpp  # SSH connection logic
โ”‚   โ”‚   โ””โ”€โ”€ MySQLConnection.cpp # MySQL connection logic
โ”‚   โ””โ”€โ”€ Video_and_Photo/       # Media handling
โ”‚       โ”œโ”€โ”€ ImageViewer.cpp
โ”‚       โ”œโ”€โ”€ VideoPlayer.cpp
โ”‚       โ”œโ”€โ”€ CommonMedia.cpp
โ”‚       โ””โ”€โ”€ FFmpegUtils.cpp
โ”œโ”€โ”€ tests/                     # Test cases
โ”‚   โ”œโ”€โ”€ UIManagerTest.cpp
โ”‚   โ”œโ”€โ”€ FileManagerTest.cpp
โ”‚   โ”œโ”€โ”€ main.cpp
โ”‚   โ”œโ”€โ”€ Vim_like_Test.cpp
โ”‚   โ”œโ”€โ”€ CMakeLists.txt
โ”‚   โ””โ”€โ”€ FileSizeCaculatorTest.cpp
โ”œโ”€โ”€ config/                    # Configuration files
โ”‚   โ””โ”€โ”€ .ftb.template         # Configuration template
โ”œโ”€โ”€ docs/                      # Documentation
โ”‚   โ””โ”€โ”€ CONFIGURATION.md      # Configuration guide
โ”œโ”€โ”€ bash_tool/                 # Build scripts
โ”‚   โ”œโ”€โ”€ build.sh
โ”‚   โ”œโ”€โ”€ package_build.sh
โ”‚   โ””โ”€โ”€ uninstall.sh
โ”œโ”€โ”€ .github/workflows/         # CI/CD
โ”‚   โ””โ”€โ”€ Release.yml
โ”œโ”€โ”€ CMakeLists.txt            # Build configuration
โ”œโ”€โ”€ README.md                 # Documentation
โ”œโ”€โ”€ QUICK_CONFIG.md           # Quick configuration guide
โ”œโ”€โ”€ test_config.sh            # Configuration test script
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ Release_notes.md
โ”œโ”€โ”€ cmake_uninstall.cmake.in
โ”œโ”€โ”€ .clang-format             # Code style
โ””โ”€โ”€ License

Development Environment

  • Compiler: g++ 11.0+
  • Build tool: CMake 3.20+
  • Dependencies: FTXUI 5.0+, libssh2, libmysqlclient

License

MIT License

About

The FTB is a file_brower based on FTXUI and Linux by C++ and CMake.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published