All Projects β†’ 4U6U57 β†’ Wsl Open

4U6U57 / Wsl Open

Licence: mit
Open files with xdg-open on Bash for Windows in Windows applications. Read only mirror from GitLab, see link πŸ‘‰

Programming Languages

shell
77523 projects

Labels

Projects that are alternatives of or similar to Wsl Open

RHWSL
Red hat UBI as a WSL Instance. Supports multiple install.
Stars: ✭ 91 (-69.57%)
Mutual labels:  wsl
nvim-ghost.nvim
πŸ‘» GhostText plugin for Neovim with zero dependencies πŸŽ‰ Supports neovim running inside WSL too! πŸ₯³ Windows/Linux/macOS supported out-of-the-box! πŸ˜„ (Other OSes need python3.6+ installed)
Stars: ✭ 32 (-89.3%)
Mutual labels:  wsl
Vimplus
πŸš€An automatic configuration program for vim
Stars: ✭ 3,372 (+1027.76%)
Mutual labels:  wsl
uniterm
🚧Universal Terminal Emulator, might be a great toy terminal front-end for geeks.
Stars: ✭ 22 (-92.64%)
Mutual labels:  wsl
WSL-Distro-Rootfs
Install anyrootfs as a WSL Instance (for Windows 10 FCU 64bit or later) [WSL-DistroLauncher](https://github.com/yuk7/WSL-DistroLauncher)
Stars: ✭ 22 (-92.64%)
Mutual labels:  wsl
dotfiles
Dotfiles & Developer Environment. Supports Ubuntu2004+, macOS Catalina+, Windows 10 w WSL
Stars: ✭ 30 (-89.97%)
Mutual labels:  wsl
dotfiles
Bootstrap your Ubuntu in a single command!
Stars: ✭ 85 (-71.57%)
Mutual labels:  wsl
Wsl Ssh Agent
Helper to interface with Windows ssh-agent.exe service from Windows Subsystem for Linux (WSL)
Stars: ✭ 298 (-0.33%)
Mutual labels:  wsl
ubuntu-win-bootstrap
DEPRECIATED! Use "linux-comfy-chair" instead. A very simple bootstrap script to install some development tools to the Windows 10 Ubuntu Bash system - Ruby, Perl, Python, Node, Sublime Text and more!
Stars: ✭ 27 (-90.97%)
Mutual labels:  wsl
Weasel Pageant
Deprecated: An ssh-agent compatible helper for interacting with Pageant from processes running on the Windows Subsystem for Linux.
Stars: ✭ 256 (-14.38%)
Mutual labels:  wsl
miniwsl
Mini Windows Subsystem for Linux Distribution
Stars: ✭ 60 (-79.93%)
Mutual labels:  wsl
wsl-agent-bridge
WSL compatibility bridge for ssh-agent on Windows
Stars: ✭ 17 (-94.31%)
Mutual labels:  wsl
bash-zsh-on-windows-cmder
Integration of Bash, ZSH on Windows with Cmder
Stars: ✭ 37 (-87.63%)
Mutual labels:  wsl
nix-config
NixOS configuration (also on WSL)
Stars: ✭ 51 (-82.94%)
Mutual labels:  wsl
Fedora Remix For Wsl
Fedora Remix for Windows Subsystem for Linux.
Stars: ✭ 284 (-5.02%)
Mutual labels:  wsl
proton wsl2
Proton Kernel for the Windows Subsystem for Linux 2 (WSL 2). Highly experimental and always at the mercy of Windows Update.
Stars: ✭ 23 (-92.31%)
Mutual labels:  wsl
wsl2exe
[TESTING]Use command in WSL from exe executable
Stars: ✭ 34 (-88.63%)
Mutual labels:  wsl
My Wsl Setup
Quick rundown on my current setup on the Windows Subsystem for Linux.
Stars: ✭ 298 (-0.33%)
Mutual labels:  wsl
Awesome Wsl
Awesome list dedicated to Windows Subsystem for Linux
Stars: ✭ 3,544 (+1085.28%)
Mutual labels:  wsl
gitwrap
Windows Wrapper for Linux git executable
Stars: ✭ 77 (-74.25%)
Mutual labels:  wsl

wsl-open (πŸ“‚ ➑️ πŸ’»)

pipeline status npm version

Utility for opening files within the Windows Subsystem for Linux command line in Windows GUI applications.

Usage

Just run wsl-open with the file/directory/URL that you want to open.

wsl-open { FILE | DIRECTORY | URL }

  • FILE paths can be relative or absolute
  • DIRECTORY paths are the same, with a possible limitation*
  • URLs must include the protocol (http://, https://, ftp://, etc) or begin with www, which is consistent with how xdg-open handles URLs

*If using a WSL build without the wslpath (prior to Build 1803 - released April 2018), only Windows directories can be opened

Examples

# Opens in your Windows default image viewer
wsl-open image.png

# Relative and absolute paths work
wsl-open ../Downloads/resume.pdf
wsl-open /home/other/README.txt

# Directories under Windows
wsl-open /mnt/c/Users/4u6u5/Music

# Opens your Windows default browser
wsl-open http://google.com

Set file associations

The real benefit of wsl-open is setting it as the default program in the Windows Subsystem for a particular filetype. This allow you to use Linux's standard xdg-open utility to open files, and wsl-open will handle the rest! This keeps your scripts platform agnostic.

# Set association for file type
wsl-open -a image.png

# Now, you can open up any PNG with xdg-open, and wsl-open will handle it
xdg-open another_image.png

# Unassociate wsl-open with a file type
wsl-open -d image.png

# Associate wsl-open with links (set wsl-open as your shell's BROWSER)
wsl-open -w

# Now URL's work as well!
xdg-open https://gitlab.com/4U6U57/wsl-open

# And this allows other programs that depend on xdg-open to use it as well!
npm repo wsl-open # Same as the previous command

Protip: I like to furthur generalize my scripts by setting alias open='xdg-open' on my Linux machines, which make them behave more like macOS

Full specification

For full details on how the script operates, feel free to check out the manpage or design specification

Installation

npm

The easiest way to get it is to use the Node Package Manager and install it globally.

# Get npm if you don't have it already
sudo apt-get install -yqq npm

# Install
sudo npm install -g wsl-open

Standalone

wsl-open is actually just a single, self contained bash script, so the bare minimum installation is simply downloading the script (either by cloning the repo or via curl) and then adding it to your path. Here is an example:

# Make a bin folder in your home directory
mkdir ~/bin

# Add the bin folder to your PATH in your bashrc
echo '[[ -e ~/bin ]] && export PATH=$PATH:~/bin' >> ~/.bashrc

# Download the script to a file named 'wsl-open'
curl -o ~/bin/wsl-open https://raw.githubusercontent.com/4U6U57/wsl-open/master/wsl-open.sh
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].