### Install Shelix Globally Source: https://github.com/webdev23/shelix/blob/main/README.md This command installs the Shelix project globally, making its executable available from any directory. It requires the user to have `./.local/bin` sourced in their PATH environment variable. ```shell ./shelix.sh --install ``` -------------------------------- ### Install File Explorer (LF) Source: https://github.com/webdev23/shelix/blob/main/README.md This command installs the 'lf' file explorer, which is one of the supported file explorers for Shelix. Other file explorers like ranger can also be used with adaptation. ```shell sudo apt install lf ``` -------------------------------- ### Clone and Run Shelix Project Source: https://github.com/webdev23/shelix/blob/main/README.md This snippet demonstrates how to clone the Shelix project repository and execute its main script. It requires Git to be installed and assumes the user is in a directory where they want to clone the project. ```shell git clone --depth 1 https://github.com/webdev23/shelix.git cd shelix ./shelix.sh ``` -------------------------------- ### Install Optional User-Level Tools Source: https://github.com/webdev23/shelix/blob/main/README.md This command installs several optional user-level tools that enhance Shelix functionality, including ripgrep, fzf, wmctrl, and git. These tools are commonly used for searching, fuzzy finding, window management, and version control. ```shell sudo apt install ripgrep fzf wmctrl git ``` -------------------------------- ### Basic Shelix Session Initialization (Bash) Source: https://context7.com/webdev23/shelix/llms.txt This command demonstrates the basic usage of Shelix to initialize a new development session. It takes a project path as an argument and creates a named session (e.g., 'project' for '/path/to/project'). This is the starting point for managing development environments with Shelix. ```bash # Create initial session shelix /path/to/project # Session name: "project" ``` -------------------------------- ### Install Tmux, PHP, and Helix Source: https://github.com/webdev23/shelix/blob/main/README.md This command installs the core dependencies for the Shelix project: Tmux, PHP, and the Helix editor, using the apt package manager. This is typically run on Debian-based Linux distributions. ```shell sudo apt install tmux php helix ``` -------------------------------- ### Create New Helix Editor Panes (Bash) Source: https://context7.com/webdev23/shelix/llms.txt This script intelligently creates new Helix editor panes. It handles the initial editor setup by splitting the current pane and launching Helix. For subsequent editors, it splits panes next to the last Helix instance or a marked pane, ensuring organized multi-pane layouts. It requires tmux to be installed and configured. ```bash #!/bin/bash # scripts/New_editor # Check if window has any Helix instances or running in popup if [ $(has_editor) == "0" ] || [ -z "$TMUX_PANE" ];then # No editors yet - split current pane tmux split-window -h tmux select-pane -T hx tmux send-keys "hx" Enter tmux popup -C else # Editors exist - check for marked pane MARKED=$(tmux display -p -t '~' '#D') if [ -z "$MARKED" ]; then # No marked pane - split next to last Helix tmux split-window -t $(to_last_hx) -h else # Marked pane exists - split next to it tmux split-window -t '~' -h fi tmux select-pane -T hx tmux send-keys "hx" Enter fi # Trigger from menu: Alt+Space ne (New_editor) # Behavior: # - First editor: splits current pane # - Subsequent editors: splits next to last editor # - With marked pane: splits next to marked pane ``` -------------------------------- ### Uninstall Shelix Source: https://github.com/webdev23/shelix/blob/main/README.md This command uninstalls the Shelix project from the system. It assumes Shelix has been previously installed globally. ```shell shelix --uninstall ``` -------------------------------- ### Custom Tool Scripts with JSON Output (Bash) Source: https://context7.com/webdev23/shelix/llms.txt This example demonstrates creating custom menu tools within the Shelix environment. Scripts placed in the `scripts/` directory can be invoked from the Shelix menu. They can return a JSON array of strings to create dynamic submenus. If an item in the JSON array is appended with '🚀', it's executed immediately upon selection. Otherwise, the script is re-executed with the selected option as the first argument ($1) to perform an action. Supports any scripting language with a shebang. Requires tmux and Shelix. ```bash #!/bin/bash # Example: scripts/My_Custom_Tool if [ -z "$1" ]; then # No argument - return submenu items as JSON echo '["Option A", "Option B", "Option C", "🚀"]' # 🚀 at end means execute selection immediately else # Argument provided - execute action case "$1" in "Option A") notify "You selected Option A" ;; "Option B") tmux split-window -h "htop" ;; "Option C") echo "Processing C..." >> /tmp/output.log ;; esac fi # Usage: # 1. Create executable script in scripts/ directory # 2. Alt+Space -> My_Custom_Tool (shows submenu) # 3. Select option (script re-runs with option as $1) # 4. Script performs action and exits # Script capabilities: # - Bash, PHP, Python, or any hashbang language # - Return JSON array for submenus # - Access tmux environment variables # - Call other Shelix libs from PATH ``` -------------------------------- ### Shelix Command Line Usage Source: https://github.com/webdev23/shelix/blob/main/README.md This section details various ways to use the shelix command from the terminal. It covers opening/creating sessions, specifying directories, attaching to existing sessions, passing commands for startup, and applying themes. It also explains how to feed elements into the menu via pipes and use built-in capabilities for creating layouts. ```shell shelix Open or create a new session in the current directory shelix /path/to/dir Create a session in that dir shelix Re-attach to a session, create anew, or extend to multi-screen shelix -c -c '...' Pass (multiple) commands to run on multiple pane on startup shelix --theme monokai Specify a theme (See themes directory for names) ``` ```shell shelix history | shelix - ls | shelix - ``` ```shell shelix --theme Visiblue -c 'php -S localhost:8080' -c 'hx index.html' ``` -------------------------------- ### Launch Shelix Session (Bash) Source: https://context7.com/webdev23/shelix/llms.txt Launches or attaches to a tmux-based development session. Supports specifying a directory, theme, and startup commands. It creates a tmux session named after the directory, sets up the environment, pane layout, applies themes, and makes the Alt+Space menu available. ```bash # Create session in current directory shelix # Create session in specific directory shelix /path/to/project # Create session with theme and startup commands shelix --theme monokai -c 'npm run dev' -c 'hx src/index.js' # Attach to existing session (or extend to multi-screen) shelix my-project ``` -------------------------------- ### Shelix Keybindings for Popup Menu Source: https://github.com/webdev23/shelix/blob/main/README.md Details the keybindings for interacting with the shelix popup menu. This includes opening the menu, navigating selections, triggering actions, and exiting. It also specifies how actions are dispatched to the focused pane before the popup. ```text Alt + Space Popup menu Space q Quit Escape Ctrl + c Up/Down arrows Move selection Mouse wheel Right arrow Trigger dispatch action Enter Ctrl + click Left arrow Back up one level in the tree Ctrl + right Insert text file at cursor in marked editor pane Ctrl + Enter Ctrl + Shift + right Edit scripts source file Ctrl + Shift + Enter Keys Trigger elements by first letter after underscores (Example: New_shelix_Window = nsw) Escape Quit and force close popup ! Copy selection to system clipboard Ctrl + Up/Down Move selection faster Ctrl + PageUp/Down Move selection even faster ``` -------------------------------- ### Tmux Keybindings Configuration (Bash) Source: https://context7.com/webdev23/shelix/llms.txt This configuration sets up comprehensive tmux shortcuts for IDE-like pane and window management. It includes mouse support, pane navigation using Shift+Arrows, window cycling with F9/F10, a Shelix menu popup, layout saving/restoring, multi-cursor synchronization, and Vi-mode keybindings for copy-pasting. Requires tmux and xclip. ```bash # env/tmux.conf.sh # Mouse support set -g mouse on bind -Troot DoubleClick1Pane resizep -Zt= # Double-click to zoom # Pane navigation with Shift+Arrows bind-key -n S-Up select-pane -U bind-key -n S-Down select-pane -D bind-key -n S-Left run-shell 'select_pane_right' bind-key -n S-Right run-shell 'select_pane_left' # Window cycling bind-key -n F9 previous-window bind-key -n F10 next-window # Shelix menu popup (Alt+Space or Space) bind Space popup -w 50% -h 50% -E "shelix" bind -n M-Space popup -w 50% -h 50% -E "shelix" # Save/restore layouts bind M-Space run-shell 'save_layout' # Alt+Space bind C-M-Space run-shell 'restore_layout' # Ctrl+Alt+Space # Multi-cursor mode (synchronize all panes) bind-key X set-window-option synchronize-panes\; \ display-message "synchronize-panes is now #{?pane_synchronized,on,off}" # Vi-mode copy/paste setw -g mode-keys vi bind -T copy-mode-vi v send -X begin-selection bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -sel clipboard" bind P paste-buffer # Usage: # Shift+Arrows: Move focus between panes # F12: Zoom current pane # Alt+Space: Open Shelix menu # X: Toggle synchronize-panes (multi-cursor) ``` -------------------------------- ### Shelix Menu Interactions within Tmux Source: https://github.com/webdev23/shelix/blob/main/README.md Demonstrates how to interact with shelix when already inside a tmux session. This includes displaying the menu, mounting the shell to the working path, and using pipe commands to feed elements into the menu for selection or action. ```shell shelix ``` -------------------------------- ### Interactive Menu System (PHP) Source: https://context7.com/webdev23/shelix/llms.txt The core interactive menu loop, implemented in PHP. It reads scripts from the 'scripts/' directory and displays an interactive buffer for user navigation and action dispatching. Users can interact using arrow keys, mouse, or acronym shortcuts. Supports actions like opening new windows, copying to clipboard, and editing scripts. ```php // Main menu loop in main (PHP script) // Reads scripts/ directory and displays interactive buffer // Example: Trigger "New_Shelix_Window" by typing: // Alt+Space nsw // User interaction flow: $LIST = scandir("scripts/"); $IN = new Buffer($LIST, Nox::$W, Nox::$H - 1, 0, 0, 0); // Returns: Buffer::$SELECTION (selected index) // Menu behavior: // - Arrow keys or mouse wheel to navigate // - Enter or Right arrow to execute // - Left arrow to go back one level // - Acronyms: "nsw" -> New_Shelix_Window // - "!" copies selection to clipboard // - Ctrl+Right inserts file content at cursor // - Ctrl+Shift+Right opens script for editing ``` -------------------------------- ### Project Search with Ripgrep and Helix (Bash) Source: https://context7.com/webdev23/shelix/llms.txt This script enables searching within project files using ripgrep and displaying results interactively in Helix. It prompts the user for a search term, uses ripgrep to find matching lines, formats the output, and pipes it to `shelix -` for interactive selection. Selecting a result opens the file in Helix at the specific line number. Requires ripgrep, Helix, and Shelix. ```bash #!/bin/bash # scripts/Search/Search_project_rg cd $(session_path) # Prompt for search term read -p "Search: " term # Search and format results results=$(rg -n "$term" 2>/dev/null | while IFS=: read -r file line content; do echo "$file:$line: $content" done) # Display in interactive menu echo "$results" | shelix - # User selects result, opens in Helix: # Result format: "filename:line: matched content" # Selection triggers: open_file filename +line # File opens at exact line number with match ``` -------------------------------- ### Focus Switching and Window Management (X11) Source: https://context7.com/webdev23/shelix/llms.txt Enables focus switching across all windows and screens using Shift+Arrows. It utilizes 'wmctrl' for X11 window management, facilitating cross-screen actions initiated from menus. ```bash # Uses wmctrl for X11 window management ``` -------------------------------- ### Tmux Enhancements with Shelix Keybindings Source: https://github.com/webdev23/shelix/blob/main/README.md Outlines additional keybindings that enhance tmux functionality when used with shelix. This includes saving and restoring pane layouts, moving focus between panes and windows, zooming panes, and accessing pane-related menu operations. ```text Tmux is Ctrl + b Alt + Space Save pane layout Ctrl + Alt + Space Restore previously saved pane layout Shift + Arrows Move focus betweeen panes F8 F9 Move focus between windows F12 Zoom pane Double click Alt + Tab Tmux related operations in a menu < or > Panes related menu operations can be accessed with ``` -------------------------------- ### Attach or Restart Shelix Session (X11) Source: https://context7.com/webdev23/shelix/llms.txt Manages existing Shelix sessions. Options include attaching to an existing session, killing and restarting it, or extending it to the right or left screen, creating new session variants. ```bash shelix project ``` -------------------------------- ### Git Status and Diff (Bash) Source: https://context7.com/webdev23/shelix/llms.txt These scripts integrate Git operations into the Shelix menu. 'Stats' displays a short, summarized status of modified files. 'Diff_ahead' provides a more detailed view of uncommitted changes for each modified file, showing the last 20 lines of the diff. Results are piped back into the menu for navigation. Requires Git. ```bash #!/bin/bash # scripts/Git/Stats # Show git status in menu git status --short ``` ```bash #!/bin/bash # scripts/Git/Diff_ahead # Show uncommitted changes with context # Get list of changed files files=$(git diff --name-only HEAD) # For each file, show diff for file in $files; do echo "=== $file ===" git diff HEAD "$file" | head -n 20 echo "" done ``` -------------------------------- ### Buffer Class - Interactive List Selection (PHP) Source: https://context7.com/webdev23/shelix/llms.txt A PHP class for displaying scrollable lists with keyboard and mouse navigation. It returns the index of the user's selection. Advanced usage includes returning JSON for submenus, with special handling for emojis like '🚀' for immediate execution. Supports various keybindings for navigation, selection, quitting, and clipboard operations. ```php File_watcher # Monitors entire project directory # Excludes .git and shelix.logs # Reloads on any file modification ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.