GithubHelp home page GithubHelp logo

strix007 / wsl Goto Github PK

View Code? Open in Web Editor NEW
19.0 1.0 0.0 103.34 MB

My wsl config

License: GNU General Public License v3.0

Shell 11.44% Lua 24.63% Emacs Lisp 63.93%
emacs lf linux shell vim wsl zathura zsh zsh-plugin

wsl's Introduction

Arbab Khan’s Dotfiles

WSL Configuration Of Arbab Khan

This is my WSL configuration for my arch WSL instance.

Table of Contents

Caution

I have not tested these dotfiles on other WSL distributions and am not sure how will they work.

You also need to do simple little tweaks here and there to get things working, there are too many to list but they are simple enough that a simple google search should help you.

About

This is a very basic configuration for WSL2 on Windows 11 using yuk7’s ArchWSL.

This configuration also heavily relies on Aitor Alono’s article on how to use GUI apps in WSL2.

This configuration uses WezTerm on the Windows side to spawn directly into the WSL instance without going through powershell though any terminal can work.

What To Install

Windows 11

WSL

Shell

Tmux

NeoVim

lf

fzf

MPD

Emacs

Under WSLg, you would need to compile emacs yourself with pgtk and native-comp but due to some hibernation issues I faced with WSLg, I switched over to forwarding a X server with VcXsrv. So you don’t need to compile emacs from scratch anymore, but it is still the prefered method to install emacs as compared to a distro repository.
# Install the necessary developement tools
sudo pacman -S base-devel git --needed
sudo pacman -S libxpm libjpeg libpng libtiff giflib librsvg libxml2 gnutls gtk3 webkit2gtk --needed
# Clone the Emacs repository
git clone git://git.sv.gnu.org/emacs.git
# cd into the Emacs repository
cd emacs
# Generate build files
./autogen
# Configure the Emacs features per your needs
./configure --with-native-compilation=aot  --with-xwidgets --with-tree-sitter --with-json --with-imagemagick --with-mailutils
# Build Emacs
make
# Install Emacs
sudo make install

Setup Instructions

Windows

WezTerm

To setup WezTerm with wezterm.lua, after installing wezterm you need to move to move wezterm.lua to where you have installed WezTerm, typically C:\Program Files\WezTerm . Doing so might require administrator privilages.

VcXsrv

Firewall

After VcxSrv is installed, we need to ensure the proper rules for VcxSrv on our firewall. These steps assume you do not have custom firewall rules(like an antivirus). If you do have custom rules set, you may need to configure it manually.

To ensure the proper firewall rules, open Windows Security ,go to Firewall & network protection -> Allow an app through firewall and ensure VcXsrv windows xserver has both Private networks and Public networks permissions.

Startup

To automatically start VcXsrv on startup, move the Windows/config.xlaunch file to the %AppData%\Microsoft\Windows\Start Menu\Programs\Startup directory and enable it in TaskManager

Blurry Fonts

If you experience blurry fonts, follow this answer.

Shortcut

To make a shortcut for any GUI application for VcXsrv, right-click on desktop, click New -> Shortcut and put the shortcut command as such =C:\Windows\System32\wsl.exe –distribution Arch zsh -ic ”your command here”=

ArchWSL

Systemd

To enable systemd, you need to edit /etc/wsl.conf with sudo privileges i.e. sudo vim /etc/wsl.conf and add the following lines
[boot]
systemd=true

and then restart your WSL instance by going into the windows terminal and typing the followin command wsl --shutdown and then opening WezTerm.

Emacs Daemon

To enable Emacs daemon on WSL, we need to create a systemd user service for the Emacs daemon. We can do so by the following steps.

Create a service unit file for the Emacs daemon

vim ~/.config/systemd/user/emacs.service

Add the following content to the file

[Unit]
Description=Emacs text editor (daemon)

[Service]
Type=forking
ExecStart=/usr/local/bin/emacs --daemon
ExecStop=/usr/local/bin/emacsclient --eval "(progn (setq kill-emacs-hook 'nil) (kill-emacs))"
Restart=always

[Install]
WantedBy=default.target

Reload systemd user manager

systemctl --user daemon-reload

Enable the systemd user manager

systemctl --user enable emacs.service

Contributing

If you see me doing anything inefficiently in this config or you think something would be useful to me or you want to correct some error on my part, feel free to open a pull request.

wsl's People

Contributors

strix007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.