Skip to content

alaaibrahim/ala-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scripts That I use

Note: I moved old files to Archive Directory, these are scripts that I no longer use.

mg

A script to handle gvim server to only load one server per project, and it would switch to the already loaded one and open the file.

Requirements

  • gvim (or macvim) compiled with +clientserver :h clientserver
  • wmctrl for Linux (Optional).

nvt

A script to manage nvim server instances, ensuring only one nvim server per project or tmux session.

Description

nvt creates and manages nvim server instances with automatic switching:

  • In tmux: One nvim server per tmux session, automatically switches to the pane containing the server
  • Outside tmux: One nvim server per git project root directory

When you run nvt with files, it will:

  • If a server exists: Open files in the existing server and switch to that pane/window
  • If no server exists: Start a new nvim server

Requirements

  • Neovim with --remote support (built-in)
  • tmux (optional, for session management)
  • lsof (for finding nvim server processes)
  • git (optional, for project detection)

Usage

nvt [files...]

Examples

# Start nvim server (or connect to existing one)
nvt

# Open files in existing server or start new one
nvt file1.txt file2.txt

# In tmux: automatically switches to the pane with nvim
nvt myfile.js

eix-fzf

A script to use eix with fzf for interactive package searching.

Requirements

Usage

eix-fzf [options] [query]

Options

  • -f, --refresh: Refresh cache
  • -F, --refresh-silent: Refresh cache silently (for hooks/cron)
  • -i, --installed: Query only installed packages (Default)
  • -a, --all: Query all packages
  • -p, --preview: Show preview window with package details
  • -n, --no-preview: Don't show preview window (Default)
  • -E, --no-eix: Don't run eix on selection, just print package name
  • -h, --help: Show help message

Arguments

  • query: Optional prefilled search query for fzf

Completions

Bash and Zsh completion files are included:

  • Bash: eix-fzf-completion.bash
  • Zsh: _eix-fzf

uncrypt

A script to securely create, view, and edit encrypted GPG tar archives. It works by creating a temporary, encrypted, in-memory filesystem (a "vault") where the contents of the GPG tar archive are extracted. After you're done, the script re-encrypts the contents and cleans up the temporary vault, leaving no trace on the disk.

It uses hdiutil on macOS to create a sparse bundle and gocryptfs on Linux/BSD to create an encrypted directory, providing a seamless and cross-platform experience.

Requirements

  • gpg
  • gocryptfs (for Linux/BSD systems)

Usage

uncrypt [-r recipient]... <gpg-file>
  • <gpg-file>: The path to the GPG-encrypted tar archive.
  • -r recipient: Optional. Specify a GPG recipient for encryption. This flag can be used multiple times.

Workflow

The script operates in one of two modes:

  1. Recipient Mode: If you provide one or more -r flags, the archive will be encrypted for those recipients and signed.
  2. Passphrase Mode: If no recipients are provided, the script will use symmetric encryption (gpg -c). You will be prompted for a passphrase to encrypt and decrypt the archive.

Once the vault is mounted, you can access the files inside the temporary directory shown in the script's output. When you are finished, you can choose one of the following options:

  • (s)ave & encrypt: Re-packages the contents of the vault, encrypts them, and saves them back to the original GPG file.
  • (d)estroy & exit: Discards all changes and tears down the temporary vault.

About

Holds a collection of my scripts that makes parts of my life easier

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors