Skip to content

Instantly share code, notes, and snippets.

@Bilal2453
Bilal2453 / luvit_setup_linux.md
Last active August 22, 2023 16:13
Installing Luvit on Linux/MacOS

Note

This guide assumes you are on a UNIX-like system, such as Linux or macOS. For Windows instructions, please follow this for downloading and this for PATH installation.

TL;DR

Read the guide first, if you have already read it and want quick step by step follow this.

Execute the following in the shell:

  1. curl -fL https://github.com/truemedian/luvit-bin/raw/main/install.sh | sh
@Bilal2453
Bilal2453 / nvidiactl.lua
Created February 19, 2023 20:14
A simple automation I use to real-quick switch between my Nvidia dGPU and my iGPU on Fedora. This is NOT how you are supposed to do it, rather create a boot entry menu that sets the said cmdlines!
#!/bin/lua
local GRUB_CONFIG_PATH = "/etc/default/grub"
local GRUB_MKCONFIG = "sudo grub2-mkconfig -o /boot/grub2/grub.cfg"
local RD_BLACKLIST = "rd.driver.blacklist=nouveau"
local MODPROBE_BLACKLIST = "modprobe.blacklist=nouveau"
local DRM_MODSET = "nvidia%-drm.modeset=1"
local function enable(current_val)
local new_str = current_val
-- A simple showcase of how to possibly use miniz, this defines a function
-- extract, which takes a string to the path of a zip file
-- and extracts all of its contents into a folder in the same path of the same name of the file
local miniz = require('miniz')
local path = require('path')
local fs = require('fs')
local function extract(zip_file)
local reader = miniz.new_reader(zip_file)

These are the steps to add Luvit (that is luvit, luvi, lit) to your system PATH on Windows. These instructions will be slightly different on old Windows, so in that case you could follow this general guide https://bit.ly/2QfZ8Ii.

GUI Instructions:

1. Moveluvit.exe, luvi.exe and lit.exe to a folder made specificlly for them, where you won't need to move them again, and remember where is that.

2. Copy the directory path you just created; you can do that by clicking at the directory path bar, then CTRL+C, or by right click then copy. The copied path should be the parent directory of the executables, so for example if you have luvit at C:\Lua\Luvit\luvit.exe you will only copy C:\Lua\Luvit\ part. Step 2