A comprehensive collection of Go-based scripts for enhancing the i3 window manager experience. This is a work-in-progress golang version of i3-scripts.
This project provides a suite of utilities to extend i3 window manager functionality with optimized Go implementations. Each script is designed to handle specific window management tasks, from basic operations like killing containers to advanced features like floating window management and workspace manipulation.
Debian 12:
- VolumeControl:
pulseaudio(install:apt install pulseaudio) - VolumeControl:
pactl(install:apt install pulseaudio-utils) - General:
i3-wmandi3-inputfor i3 window manager integration - Optional:
upx-uclfor binary compression (install:apt install upx-ucl)
# Build all scripts with optimizations
make build
# Build with maximum optimizations
make build-optimized
# Build with compression (requires UPX)
make build-compressed
# Install to system (requires root)
sudo make install
# Clean build artifacts
make cleanPurpose: Implements Alt-Tab like functionality for i3 containers, allowing quick switching between the current and previously focused containers.
Features:
- Maintains a history of the last 3 focused containers
- Can run as a daemon to continuously track focus changes
- Stores container history in
~/.BackAndForthContainer.json - Uses TCP port 63333 for daemon communication
Usage:
# Switch to previously focused container
./bin/BackAndForthContainers
# Run as daemon to track focus changes
./bin/BackAndForthContainers -daemonPurpose: Terminates the currently focused container/window.
Usage:
./bin/KillContainerPurpose: Locks or prevents interaction with the currently focused container.
Usage:
./bin/LockContainerPurpose: Adds marks to containers for easy identification and navigation.
Usage:
./bin/MarkContainerPurpose: Resizes floating windows using vim-style directional keys.
Features:
- Supports vim-style directions: h (left), j (down), k (up), l (right), w (widen)
- Accepts positive or negative values for expansion/contraction
- Input validation for direction and value format
Usage:
# Resize floating window left by 50 pixels
./bin/ResizeFloatContainer resize h -50
# Resize floating window down by 30 pixels
./bin/ResizeFloatContainer resize j +30Purpose: Moves floating containers to predefined positions.
Usage:
# Move to position (numeric argument determines position)
./bin/MoveFloatContainer position <position_number>Purpose: Advanced floating container management with save/restore functionality.
Features:
- Save current container state with marks
- Restore containers by mark
- Show/hide containers by mark
- Update container states
Usage:
# Save current container state
./bin/ManageFloatContainer --save
# Restore container by mark
./bin/ManageFloatContainer --restore <mark>
# Show container by mark
./bin/ManageFloatContainer --show <mark>
# Update container by mark
./bin/ManageFloatContainer --update <mark>Purpose: Resizes floating windows diagonally (both width and height simultaneously).
Usage:
# Increase size diagonally by 20 pixels
./bin/DiagonalResize size +20
# Decrease size diagonally by 15 pixels
./bin/DiagonalResize size -15Purpose: Resizes windows by adjusting their margins/borders in specific directions.
Usage:
# Resize border in specified direction
./bin/MarginResize border <direction>Purpose: Swaps the contents of two workspaces.
Usage:
./bin/SwapWorkspacesPurpose: Provides an interactive interface to rename the current workspace.
Usage:
./bin/RenameWorkspacePurpose: Changes the current workspace to a specified index number.
Usage:
# Switch to workspace 5
./bin/ChangeWorkspaceIndex index 5Purpose: Comprehensive audio volume management using PulseAudio.
Features:
- Toggle mute/unmute
- Adjust volume with +/- values
- Round volume to nearest 5
- Maximum volume limit (100 by default)
Usage:
# Toggle mute/unmute
./bin/VolumeControl toggle
# Increase volume by 10
./bin/VolumeControl adjust +10
# Decrease volume by 5
./bin/VolumeControl adjust -5
# Round volume to nearest 5
./bin/VolumeControl roundPurpose: Adjusts monitor brightness levels.
Usage:
# Increase brightness by 0.1
./bin/ChangeMonitorBrightness --change 0.1
# Decrease brightness by 0.2
./bin/ChangeMonitorBrightness --change -0.2Purpose: Cycles through multiple keyboard layouts.
Features:
- Supports multiple layouts separated by forward slashes
- Cycles through layouts in sequence
Usage:
# Cycle through US and Russian layouts
./bin/KeyboardLayout cycle us/ru
# Cycle through multiple layouts
./bin/KeyboardLayout cycle us/ru/de/frPurpose: Toggles the sticky state of the focused container (makes it appear on all workspaces).
Usage:
./bin/StickyTogglePurpose: Placeholder for future focus management functionality.
Status: Currently contains TODO comments for planned functionality to focus/hide floating containers by mark.
Common utilities for i3 operations including:
- Tree and workspace retrieval functions
- Node and output management
- Notification system integration
- i3-input dialog utilities
- Command execution helpers
Configuration management utilities for various scripts.
Public API for i3 operations with similar functionality to internal version but with different error handling approaches.
Performance-optimized versions of common i3 operations.
The project includes comprehensive performance analysis in PERFORMANCE_ANALYSIS.md covering:
- Build time optimizations
- Binary size reductions
- Runtime performance improvements
- Memory usage optimization
cmd/: Main application entry pointsinternal/: Internal packages and utilitiespkg/: Public packages for external useMakefile: Build automation and optimization
The project uses advanced Go build optimizations:
- Link-time optimizations (
-ldflags="-s -w") - Trimmed paths (
-trimpath) - Parallel builds
- Optional UPX compression
# Test all binaries
make test
# Run build benchmarks
make benchmark
# Check binary sizes
make sizesThis is an active project with ongoing development. Many scripts contain TODO comments indicating planned improvements and features.
This project follows the same license as the original i3-scripts project.