Linux MCSR
- A documentation repository to help setting up Linux for MCSR.
Getting Started
- The instructions start from the very basics and explain each step verbosely. Feel free to skip some steps if you know what you are doing.
- You can get started right here.
License
The documentation was all written under GNU GPLv3. You can check the license here.
Introduction
The instructions given below will be the pre-install setup. By the end of it, you will have a bootable USB stick with Fedora installed on it.
Distributions
- Linux, being a free and open source operating system, comes in several different flavours a.k.a distributions a.k.a distros.
- Some of the popular distributions are Ubuntu, Fedora, Arch Linux(btw), etc.
- For MCSR, we recommend a distribution based on RHEL called Fedora.
- Make sure to go here and download the latest ISO for Fedora.
- Click on the ISO file under For Intel and AMD x86_64 systems. This is what we will be using to flash the USB.
- You can learn more about Linux Distributions here.
Installing Fedora Workstation
- After downloading the distribution ISO from the official Fedora Project website, pick up a USB stick of at least 5GB space or above.
- NOTE: The USB stick will be formatted during the install process and all data on it will be erased.
- To install the ISO into the USB stick, use Balena Etcher from here. Click on the Windows installer link to download it.
- Run through the Balena Etcher installer as per usual.
- Plug in the USB stick to your PC and open Balena Etcher.
- Under Select Image, locate to wherever you downloaded the Fedora Workstation ISO from before and select it.
- Under Select Drive, select the USB device name. It should be auto-selected for you, just make sure its the right USB.
- Then click Flash to start creating your Bootable USB!
- Wait for it to finish Flashing and Verifying as well. Don't quit Balena until all of it is done.
- Congratulations! You just created a bootable Fedora USB!
Moving Ahead
- Make sure to have Secure Boot disabled in your motherboard settings and make sure to have CSM/BIOS mode disabled before you proceed to other sections.
- Now we start with the difficult part of the installation. We make decisions based on your PC configuration. So make sure to follow through the instructions very carefully.
Live Environment
The instructions given below will be the setup step to start installing Fedora on your hard drive.
Booting into the Live USB
- After going through and installing the ISO onto your USB stick, it is now time to install Fedora on your system.
- Plug in the USB stick to your PC.
Figuring out the BIOS key for your motherboard
- Mind you, this step is very convoluted and varies from one motherboard manufacturer to the other. So, googling about this is the best way to find out what your BIOS key is.
- Usually its one of the function keys or the Escape key.
- You can try spamming those keys a couple of times just as you start up your computer until you get to the BIOS menu.
- Under the BIOS menu, look for an option that talks about Boot Options. Under here, select the USB you just installed Fedora on and the boot should continue from there and drop you into a live environment of Fedora.
- If you can't find Boot Options then changing the Boot Order is an alternative. Under here, reorder the options to have the USB stick at the top. Now save and quit and it should automatically reboot into a live environment of Fedora. You will be greeted with a boot screen listing some boot options initially, just hit enter on the first option to boot into Live USB mode.
- If you have any issues that you come across at this point, don't think twice to open a new issue on this regard. You will be greeted with a boot screen listing some boot options initially, just hit enter on the first option to boot into Live USB mode.
Testing on the Live Environment
- Now that you have the Live Environment running, you can test out the OS partially here.
- On the first dialog, click on Not Now to test out the live environment.
- Linux, given its versatility, doesn't require you to install the system on your physical hardware in order to test it. So whatever you do on here will not affect what you have already on your system.
- But of course, nothing that you do here would be reflected in your physical install as well. So feel free to mess around until you feel comfortable enough.
- Make yourself comfortable with the workflow of the system and when you are done, you can proceed with the installation procedure.
Installation
The instructions given below will install Fedora on your PC. Make sure to follow through the instructions here carefully.
From Zero to Hero
- After testing out Fedora on the live environment, you are now ready to install it on your PC.
- You can connect to your home network in order to install some updates during the installation. But this is optional, you can proceed to install Fedora even without connecting to the internet.
- There are two options for you at this point. You can either
- Have an empty hard drive to install Fedora on it.
- Or have it be installed on your hard drive with Windows on it. (It will be installed alongside Windows so you need not worry. Just make sure you have enough space on that hard drive to have Fedora on it. Recommended size is about 100 GB of free space or above).
- No matter what you pick above most steps remain the same.
- Now on the Live Environment, search for Install Fedora by hitting the windows key and starting to type.
- The first menu will open up asking you to pick your language.
- Select your preferred language and click on Continue.
- In this menu you can click on Time & Date and change it (by clicking on the map) if it doesn't show the right timezone for you (usually doesn't if you aren't connected to the internet).
- You can also click on Keyboard to change the layout that you want to use (if it hasn't detected it correctly).
Installation Destination
- Click on the Installation Destination icon under the SYSTEM option.
- The option you selected above matters only here. Be very sure that you have plugged in the right disks for installation. A gentle reminder to check and re-check them right now before continuing.
- If you chose to install Fedora on a separate empty hard drive, you will have that har drive directly listed under Local Standard Disks. You can click on it if it doesn't have a tick mark under it and click on the Continue button.
- If you chose to install Fedora alongside your Windows install, you will have to select the Custom option under Storage Configuration and hit the Continue button. Now you will be redirected to a new GUI where you can click on the drop down that says Btrfs and select ext4 instead. Now click on Click here to create them automatically and the installer will try to do it automatically for you. Then click on the Done button.
Continuation of Installation
- Click on Begin Installation and the installation of Fedora onto whatever disk/partition you chose will begin.
- Once it is done, click on the Finish Installation button. This will close the installer.
- Then you can click on the top right status tray and click on the power button to reboot the system. Make sure to reboot with the USB removed.
- After rebooting, you will be prompted to Start Setup and setup your username and password.
- Make sure to also enable third-party repositories during the setup. This will be required to install some software that might be proprietary but you might need them on a daily basis.
- Now logout of the system, and in the login screen click on the cog icon and choose the option that says GNOME on Xorg as Fedora defaults to a Wayland session on the first boot and resetti doesn't function on Wayland as of now. Now you can log back into your system.
- Also make sure to update your system as soon as you log back in by running the command
sudo dnf update
in a terminal.
Your Linux installation is now complete! We can now proceed with the post installation configuration.
Post Install
The following chapters will guide you through the post installation procedure of installing Linux for MCSR.
Software Manager
- The software manager is the best place for you to search and install packages and apps.
- If you cannot find any package on it for some reason, Googling about it is your best friend. If Google doesn't have an answer for it too, then you can open an issue in here.
Update Cycle
- Fedora usually doesn't remind you or bug you to update your packages over and over.
- Our recommendation is for you to follow a monthly update schedule, i.e., make sure to update all your packages by opening Software on a monthly basis.
- This is just to make sure you don't run into any problems and to get the latest software for your system as early as possible.
Linux Terminal
To use Linux on the Desktop casually, you wouldn't need to know the terminal at all. But to setup MCSR, we will have to go through some basic commands and how they work.
You can skip this altogether though and just blindly follow the instructions, but to debug stuff better, it is better to know these basics.
The following chapter introuduces you to some basic linux command line. It also contains some basic scripts that are great for MCSR quality of life!
Linux Terminal
In this document, we will be learning the basics of the Linux Terminal. We will go through all the basic commands with examples for each.
What is a terminal?
It's a part of every system (irrespective of Operating System) that helps you control the system from a very stripped down level (without a Graphical User Interface). Programs or Commands can be run from here to perform some task on the system.
It is a very powerful tool and most of the time, GUI applications have these commands running in the back when you click buttons to perform actions.
You can open up a terminal on Fedora by hitting the keybind Ctrl+Shift+T
.
Directories
A directory is like a folder on your computer under which files or other folders can exist.
In Linux, everything on your system, including the hardware devices that you have connected to your computer will be available for use as a file. It's a UNIX system convention.
The /
directory in your system is the root of your file system. It has everything that is on your storage that is mounted.
Here are some of the directories in /
and description of what they hold.
In the terminal type in this command
cd Desktop
The cd
command is used to change your current working directory (the current folder that you have open) to the directory that you specify. Desktop
in this case.
There are some shortcut characters that you can use to make your life easier while working with directories.
The symbol ~
is used to refer to the user's home folder (/home/<user_name>
).
cd
Now type
ls
The ls
command is used to list out the contents of your current directory.
You can use some flags to tell the command what to output.
ls -l
The -l
flag can be used to long list (or vertical list) out the contents along with the permissions on each file/folder.
ls -a
The -a
flag can used to show all files and folders in the current directory along with the hidden files. You can use both of the above commands in unison like this
ls -la
You can make directories inside your current directory using the mkdir
command.
mkdir test
If you want to create multiple directories inside of each other, then we use the -p
flag.
mkdir -p test1/test11
- This would create a
test1
directory in your current directory and create atest11
directory inside oftest1
. - If you want to remove all these directories that you created just now, you can use either
rmdir
orrm
. rmdir
is used to delete directories that are empty.
rmdir test
- This would work because
test
is empty. But the same thing wouldn't work withtest1
as it has atest11
directory inside it. - So we use the
rm
command with the-r
flag to remove it.
rm -r test1
- The
-r
flag represents recursive removal. You can also use the-f
flag to force remove the directories. - Remember,
-f
would remove everything even if it is read-only. - You can create a new file using the
touch
command.
touch text.txt
- You can view the contents of this file by using the
cat
command.
cat text.txt
- This wouldn't output anything as the file is empty. You can open this file right in the terminal by using
nano
which is a terminal based editor.
nano text.txt
- Once you are done editing the contents you can hit
Ctrl+S
andCtrl+X
to save and quit. - You can remove this file now with
rm
.
rm text.txt
Super User Privileges
- Super user privileges are admin privileges or elevated privileges given to a user in any UNIX system.
- To execute commands as a super user, we use the
su
command.su
stands for switch user. - Try executing
su -
- Now a terminal would open with a different color to denote that you have super user privileges. In this terminal, you literally can nuke your whole system. So be careful about what you do in here.
- To get back to your normal user terminal, type
exit
- If you want to execute only some commands with super user privileges, you can use the wrapper command
sudo
. - This is safer as you can be sure to execute each command with the right permissions.
- Try out this command
sudo dnf update
- Super user privileges are required for package manager commands on any Linux system.
- So to install packages you will be prompted to give your password.
Pipe
- The Pipe symbol (
|
) is used to chain the outputs of certain commands into other commands. - There are several uses to this symbol, but the most common usage is to use it alongside the
grep
command. - Try this command
touch text.txt
ls | grep text.txt
grep
is used to print out all the lines within an output or a file withtext.txt
in it.- You can pipe the output of any command into
grep
and get the matching lines based on your search term.
File permissions
File permissions in a UNIX system are distributed per user.
The only permission we really care about is the executable flag. This flag tells the operating system that it can execute that file as a binary.
To set the executable flag on a file we use the chmod
command.
touch bin
chmod +x bin
- Now edit the contents of
bin
with
nano bin
- Add these contents in it
#!/bin/bash
echo "Hello World"
- Here the echo command is used to print out text to the console.
- To execute this script, we use this command
./bin
- You would see the console output
Hello World
. - There are other permissions too, but we mostly use
chmod +x
to set the executable flag on files. - We can also remove the executable flag from a file by using
chmod -x
.
chmod -x bin
Clearing out worlds
- Now that we know much about the Linux terminal, we can now make scripts to automate our filesystem tasks.
- We can declare variables in scripts using the syntax:
<variable_name>=<value>
- Here is a script to clear out saves in all your instances.
#!/bin/bash
instance_prefix="Speedrun"
instance_num=12
# DO NOT add a '/' at the end of mmc_prefix's value
mmc_prefix=~/.local/share/multimc/instances
for i in $(seq 1 $instance_num);
do
rm -r $mmc_prefix/$instance_prefix$i/saves/Random*
done
- Here in the
rm
command, we actually use a shorthand representation to expand every folder starting withRandom
in its name. So its matches would look something likeRandom Speedrun #12345
,Random Speedrun #12346
and so on - We also use the
seq
command which gives us a range which can be iterated over for example in a for loop. You can test it by trying outseq 1 12
in a terminal. - We also use a for loop in bash to loop over every instance number and delete every world folder.
Launch all instances
- We can launch all our instances by using a script too!
- Here is one to launch all instances of a particular format.
#!/bin/bash
instance_prefix="Speedrun"
instance_num=12
mmc_binary=multimc
for i in $(seq 1 $instance_num);
do
$mmc_binary -l $instance_prefix$i &
done
- The
multimc
binary has a flag-l
which you can pass to launch that instance. - We also use the
seq
command which gives us a range which can be iterated over for example in a for loop. You can test it by trying outseq 1 12
in a terminal. - Here we also use an
&
at the end of the command to background the process. This is done so that all instances launch together. - The profile for the instance would be the default profile as we are not specifying it during launch.
Going ahead
We are now proficient with the Linux terminal and bash scripting!
NVIDIA Drivers
- Before we proceed to install Minecraft and Java we need to first install the NVIDIA Drivers.
- If you are not on an NVIDIA GPU you can skip this section and proceed to the next one. You can still check in here to see if you have additional proprietary drivers that you might need to install.
- Open up a terminal and then type in these commands.
sudo dnf install kernel-devel kernel-headers gcc make dkms acpid libglvnd-glx libglvnd-opengl libglvnd-devel pkgconfig
sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf makecache
sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda
- This should install nvidia drivers on your system. Now you can restart your system and you should have GPU acceleration. Report any issues here.
- Remember! Do NOT install NVIDIA drivers from NVIDIA's official website. It creates some irreversible changes to the system that the package manager of Fedora cannot detect and might bloat your install with unnecessary packages. Moreover, everytime you need to update the driver, you would have to run through that process again. Whereas with the package manager, the driver updates will be rolled out after testing along with your normal upgrades. You can refer here for more information.
- Also NOTE: If you are using the driver version greater than 525, make sure to add
env __GL_THREADED_OPTIMIZATIONS=0
to your wrapper command alongside whatever you add with jemalloc (from resetti docs down below) as with driver versions greater than 525, preemptive doesn't seem to function as intended because of a driver-side optimization to the Minecraft renderer. Eg:env __GL_THREADED_OPTIMIZATIONS=0 $INST_JAVA
would be an example of the wrapper command.
Java
- Open up a terminal and type in these commands:
sudo dnf upgrade
sudo dnf install java-latest-openjdk
- This will install and setup the Java JDK for you.
- Remember! JDK versions will be named in the same format. So JDK 11 would be named as java-11-openjdk and so on. So if you want to install other versions of the JDK you follow the same format. Its easy, isn't it? :D
- If you want to install graalvm JDK, look here. Make sure to select the latesst Java version along with
Linux x64
for the platform. - After hitting the
Download
buttong you can unzip the zip that downloads by double clicking on it by openingFiles
. - You can then add it to your launcher by pointing to the binary in
bin/java
.
OBS
- If you want to install OBS on your system, you can proceed with this section of the instructions.
- Open up a terminal and type in this command
sudo dnf install obs-studio
- This should download and install OBS on your system.
- After downloading and installing it, you can open it and set it up as per usual.
- If you are using classic wall (without SeedQueue) you might want to look at these docs to setup OBS to work with resetti.
MultiMC
- Here, we will be installing a fork of MultiMC called Prism Launcher.
- Open up a terminal and type in these commands:
sudo dnf copr enable g3tchoo/prismlauncher
sudo dnf install prismlauncher
- This should install Prism Launcher. Make sure to select the correct Java Version while setting up the launcher.
- Make sure to enable
Skip Java compatibility checks
under your instance settings or global settings (Right click on instance -> Edit Instance -> Settings -> Skip Java compatibility checks).
resetti
Using SeedQueue with resetti
- This is the Single Instance Macro we would be using to run alongside SeedQueue. This would mainly be used to configure and manage your alternate resolutions and write your own custom hooks for each of those resolutions. You can refer to SeedQueue's setup video here.
- Go to this link and download resetti's latest version.
- You can use the
.rpm
file to download the binary through rpm or you can download the binary directly. NOTE With the RPM download, you'll be able to executeresetti
directly in your terminal without needing the./
in front of it. With the binary download, you'd have to change your current directory to the directory containing the downloaded binary and then use./resetti
to run resetti. You'd also have to set the executable flag on the binary by runningchmod +x ./resetti
in a terminal for the first time after you download the binary. - You can check if resetti is installed correctly by running
resetti version
in a terminal and seeing if it posts, into the terminal, the version of resetti that you installed from the github. - An example config can be found at
~/.local/share/resetti/default.toml
or/usr/share/resetti/default.toml
depending on how you installed it. - You can create a new profile from this example config running
./resetti new <profile_name>
in a terminal, by replacing the<profile_name>
with whatever profile name you'd want to give. Eg:./resetti new seedqueue1
- The hooks and their documentation can be found here
- You can now run resetti with
./resetti <profile_name>
in a terminal to run the macro :D.
Using classic wall with resetti
- If you would like to run resetti with its Wall features still, you can look here to download the binary for the last stable wall release of resetti.
- After downloading, do the same steps as listed in the 3rd, 4th, 5th and 6th points under
Using SeedQueue with resetti
above. - You can run the macro now same as above using
./resetti <profile_name>
in a terminal. - You would need to configure everything the same way as before but you'd have to take a lot of extra steps as listed clearly here.
If you have any questions, feel free to join the resetti discord and make a thread in the help
channel there.
NinjabrainBot
- Download the .jar for NinjabrainBot as per usual from here.
- Lets take an example where the .jar file is downloaded into the Downloads folder.
- Now to add it as an application to your list of applications, create this file with the following contents under
~/.local/share/applications/NinjabrainBot.desktop
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=NinjabrainBot
Icon=minecraft
Exec=java -jar /home/<user_name>/Downloads/Ninjabrain-Bot-1.4.1.jar
- If the directory does not exist, then make the directory/directories by executing the following command in a terminal
mkdir -p ~/.local/share/applications/
- Remember that the file name will change over versions. So as you update Ninjabrain Bot, you will have to change this file as well. Also, you will have to replace
<user_name>
with your username that you set during the install. - If you downloaded it elsewhere, then replace
/home/<user_name>/Downloads/Ninjabrain-Bot-1.4.1.jar
with the relevant path. - Now you can launch Ninjabrain Bot from your applications menu!
Setting up tmpfs
You should get better performance while running wall by symlinking your instance world folders into /tmp/mc/
and setting /tmp
as a tmpfs volume.
What that means is that files in these folders will be stocked in your memory and deleted on every reboot.
- First define
/tmp
as a tmpfs volume by adding the following line to/etc/fstab
tmpfs /tmp tmpfs defaults,size=Xg 0 0
Replace X with the number of gigabits you want to allocate, it won't use all of it if not needed but this sets a limit.
- E.g. While running PrismLauncher (a fork of MultiMC), I would symlink
~/.local/share/PrismLauncher/instances/Instance1/.minecraft/saves
to/tmp/mc/1/
and so on by using the command below for each, ensure you have deleted thesaves
folder beforehand.
ln -s /tmp/mc/1 ~/.local/share/PrismLauncher/instances/Instance1/.minecraft/saves
As the /tmp
folder is cleared on every restart you need to setup a script to create the folder on every boot, if your distribution uses systemd
you could do something like this:
- First create the file
/etc/rc.local
with the following content :
#!/bin/bash
mkdir /tmp/mc
for i in {1..X} # Replace X with the number of instances you use
do
mkdir /tmp/mc/$i
#---------Optional Part if you want to import your practice maps--------
# First you need to put all your practice maps in the same foder somewhere on your pc for me
# it's in /home/username/Documents/speedrun/maps
ln -s "/home/username/Documents/speedrun/maps/ZCrafting Practice v2" /tmp/mc/$i/
ln -s "/home/username/Documents/speedrun/maps/ZLBP 3.14.0" /tmp/mc/$i/
ln -s "/home/username/Documents/speedrun/maps/ZOW Practice V2" /tmp/mc/$i/
ln -s "/home/username/Documents/speedrun/maps/ZPortal Practice v2" /tmp/mc/$i/
ln -s "/home/username/Documents/speedrun/maps/ZRyguy2k4 End Practice v3.4.0-1.16.1" /tmp/mc/$i/
# adapt the previous commands depending on your maps and their location
#---------End Optional Part-------------
chown username -R /tmp/mc/$i # Replace username by yours
done
After the file is saved, execute
sudo chmod +x /etc/rc.local
Then run the following commands
sudo nano /etc/systemd/system/rc-local.service
And enter the following content
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99
[Install]
WantedBy=multi-user.target
Now run the following commands and check that the folders created successfully
sudo systemctl enable rc-local
sudo systemctl start rc-local
NOTE: If you don't have systemd on your distribution, you can use the same script and run it at the start of your session.
- And now you can keep clearing out these folders every 300s or so by running a simple script in the background.
- This script preserves the training maps (their folder name must start with "Z") and the last 5 random worlds for verification purposes.
- Replace "X" with your number of instances.
#!/bin/bash
IFS=$'\n'
while true
do
for i in {1..X}
do
for save in $(ls /tmp/mc/$i -t1 --ignore=Z* | tail -n +6)
do
rm -r "/tmp/mc/$i/$save"
done
done
sleep 300
done
- Here the "X" in the for loop is the total number of instances that you have. Make sure to name the folders exactly as in the above example for this script, i.e.,
/tmp/mc/1
and so on. - Now set the executable flag on the script by performing the following command in a terminal
chmod +x script.sh
- And execute it everytime you start your resetting session with the following command
./script.sh
- NOTE: Use this method IF AND ONLY IF you have some RAM to spare with all the instances running and resetting. DO NOT use it if you are using >70-80% of RAM during resetting as running that script in the background takes up memory as well!
Jemalloc setup for better Minecraft Performance
- To install
jemalloc
on Fedora as guided here, open up a terminal and type in the commandsudo dnf install jemalloc-devel
and type in the password as prompted. - This should setup jemalloc for you. Just make sure to add the wrapper commands as guided in resetti's docs.
GLFW Setup to prevent BadWindow crashes.
- To prevent GLFW's BadWindow crashes when you tab out of an instance of Minecraft, you can go into your launcher settings and look for the version of LWJGL. If the version is 3.2.2, we strongly recommend upgrading to a higher version like 3.3.3.
- If not, you can also use a system installation of GLFW by running the command
sudo dnf install glfw-devel
and then setting your launcher to use this GLFW shared object instead. This file exists at/usr/lib64/libglfw.so
.
Setup to prevent cursor warping on opening inventory.
- To prevent this we recommend using this formula to set your Coordinate Transformation Matrix to some value based on your cursor speed.
- You would need to look for the id for your mouse using
xinput
. - First install
xinput
using the commandsudo dnf install xinput
in a terminal. - Run
xinput
to see all the input devices it recognizes. - Search for the device that has the same name as your mouse and has a
[slave pointer (n)]
on the same line as the name. - Eg:
↳ Logitech G304 id=15 [slave pointer (2)]
- Take this id and this is the id that you would use to get your Coordinate Transformation Matrix as listed in the stackexchange thread.
- Eg: The id for my mouse from the above example is
15
. - After applying the matrix to your mouse, make sure to execute it on startup with an entry into
~/.config/autostart
or into your window manager's config file/startup script. - NOTE For i3 users, you can put
exec --no-startup-id <xinput_command>
into~/.config/i3/config
so that it works across reboots. - Eg: Since I use a cursor speed of
0.125
and want my mouse to always spawn at960, 540
on my screen, on applying the formula, I get the Transformation Matrix as0.125 0 840 0 0.125 472.5 0 0 1
. So I would putexec --no-startup-id xinput set-prop 15 "Coordinate Transformation Matrix" 0.125 0 840 0 0.125 472.5 0 0 1
into my i3 config.
Splitting audio
In this document we will be setting up Virtual Audio Inputs and splitting audio outputs in OBS. Remember! This method is highly untested and it works very well on my PC at the moment. But if you have any issues, post it here.
qpwgraph
This is the app that will let us split audio easily with a GUI. You can download it by executing this in your terminal
sudo dnf install qpwgraph
We now need to setup qpwgraph
such that it launches each time with the correct arguments on startup.
Copy the following contents into a file named qpwgraph.desktop
and drop it in ~/.config/autostart/
[Desktop Entry]
Name=qpwgraph
Version=1.0
GenericName=PipeWire Graph/Patchbay
Comment=qpwgraph is a PipeWire graph Qt GUI interface
Exec=qpwgraph %f -axm
Icon=org.rncbc.qpwgraph
Categories=AudioVideo;Audio;Video;Midi;X-Alsa;X-PipeWire;Qt;
MimeType=application/x-qpwgraph-patchbay;
Keywords=PipeWire;MIDI;ALSA;JACK;Qt;
Terminal=false
Type=Application
We will be using this application later on to setup output routing.
NOTE: If you are using a window manager, make sure to add qpwgraph <path_to_config> -axm
to your autostart script for your window manager by replacing <path_to_config>
with the path of the config you save later on during the setup.
Eg: In i3, say a config is in ~/Speedrunning.qpwgraph
, then we put exec qpwgraph ~/Speedrunning.qpwgraph -axm
in ~/.config/i3/config
.
Setting up Virtual Audio Devices
virtual-input-1
and virtual-input-2
can be renamed to make things more easily identifiable for yourself. But for the purpose of this guide, I'll be using those two names.
We're going to use .conf
files to configure virtual devices. These files should be placed in ~/.config/pipewire/pipewire.conf.d
(for user configuration) or /etc/pipewire/pipewire.conf.d
(for system-wide configuration).
First, add a file virtual-input-1.conf
with the following contents.
context.objects = [
{ factory = adapter
args = {
factory.name = support.null-audio-sink
node.name = "virtual-input-1"
media.class = Audio/Sink
}
}
]
Next, add another file virtual-input-2.conf
with the following contents.
context.objects = [
{ factory = adapter
args = {
factory.name = support.null-audio-sink
node.name = "virtual-input-2"
media.class = Audio/Sink
}
}
]
This will create two virtual audio devices whenever pipewire service starts. If you want to have more virtual devices, you may add more to your liking. To take immediate effect, you can simply restart pipewire service with the command
systemctl --user daemon-reload && systemctl --user restart pipewire
qpwgraph should now show two nodes with the names virtual-input-1
and virtual-input-2
.
Again, you can change out any instance of virtual-input-1
and virtual-input-2
to something else as they are just names. I just use them as it is to keep things consistent across the guide.
Setting up OBS
Now head to OBS and make a scene called Audio
for the sake of simplicity. Inside the scene, add two JACK Input Client
sources called virtual-input-1
and virtual-input-2
. Just leave the properties as default. After adding the sources within the scene, add the scene to the scenes that you want audio in.
Setting up Audio Splits
Open up qpwgraph and you should see the nodes OBS Studio: virtual-input-1
and OBS Studio: virtual-input-2
. Connect them to the virtual devices by dragging the monitor_FL
and monitor_FR
of virtual-input-1
to virtual-input-1:in_1
and virtual-input-1:in_2
of OBS Studio: virtual-input-1
respectively. Do the same for OBS Studio: virtual-input-2
.
If you wanna not have your Spotify music appear on VODs, you can route Spotify into one of the virtual devices, like virtual-input-2
, by dragging output_FL
to playback_FL
and output_FR
to playback_FR
.
Now on OBS, go into Settings
, then to the Output
tab. Under Streaming
, tick the Twitch VOD Track
box. If you're on simple output mode, it should default to 2. If you're in advanced output mode, pick 2.
Now go back to the your OBS scene and click on the gear icon under Audio Mixer
. There, you'll deselect track number 2 of the audio that contains your Spotify music. In this case, that is virtual-input-2
. So deselect track 2 of virtual-input-2
and now your Spotify music will not be inside your Twitch VODs.
Similarly, route any other audio that you want into your virtual devices, i.e. your Minecraft instances or lecture videos.
Now hit Ctrl + S
to save changes in qpwgraph.
If you have any issues regarding Spotify desktop app connections flickering from one virtual device to the other, you may post an issue here.
All done!
- We are done with setting up audio splitting on Linux.
- Again, this is very dependent on your hardware and setup and this is highly untested. If you get any issues while setting this up, post an issue here or even better, join the resetti Discord server and we'll try and help you.
Setting up i3
In this section, we will be dealing with setting up i3 on Fedora. By the end of it, you will have a working version of Fedora + i3 with some preset configurations.
Install Dependencies
To install all the dependecies of i3 run the following command in a terminal:
sudo dnf install polkit-gnome
systemctl enable --now polkit
sudo dnf install NetworkManager network-manager-applet i3 rofi xrandr flameshot i3status i3lock
systemctl enable --now NetworkManager
Here rofi
is used to make an app launcher for you. You can launch apps by hitting a keybind (similar to finder on Mac's :D).
xrandr
is used to determine what your main monitor and how you can arrange displays.
flameshot
is used to take screenshots.
polkit-gnome
is used to make a GUI to enter your super user password.
Preset Config
Copy the following config over to ~/.config/i3/config
by making the directories as required. Remember ~/.config/i3
is the directory and config
is just the file under ~/.config/i3
.
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
set $termcmd gnome-terminal
set $browsercmd firefox
set $screenshotcmd flameshot gui
set $monitor "exec xrandr | grep primary | awk -F ' ' '{print $1}'"
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
# font pango:FiraCode NerdFont 10
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
font pango:DejaVu Sans Mono 8
# font pango:DejaVu Sans Mono 0
# Start XDG autostart .desktop files using dex. See also
# https://wiki.archlinux.org/index.php/XDG_Autostart
exec --no-startup-id dex-autostart --autostart --environment i3
# The combination of xss-lock, nm-applet and pactl is a popular choice, so
# they are included here as an example. Modify as you see fit.
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use loginctl lock-session to lock your screen.
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
# NetworkManager is the most popular way to manage wireless networks on Linux,
# and nm-applet is a desktop environment-independent system tray GUI for it.
exec --no-startup-id nm-applet
# Use pactl to adjust volume in PulseAudio.
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# move tiling windows via drag & drop by left-clicking into the title bar,
# or left-clicking anywhere into the window while holding the floating modifier.
# tiling_drag modifier titlebar
# start a terminal
bindsym $mod+Return exec $termcmd
# kill focused window
bindsym $mod+q kill
# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+Ctrl+h split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+Ctrl+f fullscreen toggle
bindsym $mod+Shift+f floating toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
workspace $ws1 output $monitor
workspace $ws2 output $monitor
workspace $ws3 output $monitor
workspace $ws4 output $monitor
workspace $ws5 output $monitor
workspace $ws6 output $monitor
workspace $ws7 output $monitor
workspace $ws8 output $monitor
workspace $ws9 output $monitor
# switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
# reload the configuration file
bindsym $mod+Shift+c reload
#Shift restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+q exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the window’s width.
# Pressing right will grow the window’s width.
# Pressing up will shrink the window’s height.
# Pressing down will grow the window’s height.
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
# Remove window borders
for_window [class="^.*"] border pixel 0
# default_border pixel 0
# default_floating_border pixel 0
# Default layout setting
workspace_layout tabbed
# Window gaps
gaps inner 6
# Titlebar colors
# client.focused #5E81AC #5E81AC #ECEFF4 #5E81AC
client.focused #5E81AC #5E81AC #5E81AC #5E81AC
# Disable focus follow mouse
focus_follows_mouse no
# Custom binds
bindsym $mod+b exec $browsercmd
bindsym $mod+Shift+s exec $screenshotcmd
bindsym $mod+p exec rofi -show drun
for_window [class="Minecraft\* 1.16.1"] floating enable
for_window [class="ninjabrainbot-Main"] floating enable
for_window [title="Windowed Projector \(Scene\) - Mag"] floating enable, resize set width 1, resize set height 1, move position 0 0
for_window [title="Windowed Projector \(Scene\) - Wall"] floating enable, resize set width 1920, resize set height 1080, move position 0 0
focus_on_window_activation focus
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
position top
tray_output $monitor
status_command i3status
colors {
background #000000
statusline #ECEFF4
focused_workspace #ECEFF4 #5E81AC
active_workspace #ECEFF4 #333333
inactive_workspace #888888 #222222
urgent_workspace #ECEFF4 #900000
}
}
exec /usr/libexec/polkit-gnome-authentication-agent-1 & eval $(gnome-keyring-daemon -s --components=pkcs11,secrets,ssh,gpg)
Rofi Config
If you absolutely hate the light theme on rofi
, you can copy the following contents into ~/.config/rofi/config.rasi
and make the directories as required.
/**
* User: deadguy
* Copyright: deadguy
*/
@theme "/dev/null"
configuration {
display-drun: "Activate";
display-run: "Execute";
show-icons: true;
icon-theme: "Papirus";
sidebar-mode: true;
}
* {
background-color: rgb(18, 30, 37);
text-color: #d3d7cf;
selbg: rgb(0, 86, 136);
actbg: rgb(22, 37, 46);
urgbg: #e53935;
winbg: #26c6da;
selected-normal-foreground: @winbg;
normal-foreground: @text-color;
selected-normal-background: @actbg;
normal-background: @background-color;
selected-urgent-foreground: @background-color;
urgent-foreground: @text-color;
selected-urgent-background: @urgbg;
urgent-background: @background-color;
selected-active-foreground: @winbg;
active-foreground: @text-color;
selected-active-background: @actbg;
active-background: @selbg;
line-margin: 2;
line-padding: 2;
separator-style: "none";
hide-scrollbar: "true";
margin: 0px;
padding: 0px;
font: "Fira Code Nerd Font 10";
}
window {
x-offset: 0px;
margin-right: 60px;
height: 650px;
orientation: horizontal;
children: [mainbox];
}
mainbox {
spacing: 0em;
padding: 0px;
width:150px;
children: [ inputbar, listview, sidebar ];
expand: true;
}
button { padding: 5px 2px; }
button selected {
background-color: @active-background;
text-color: @background-color;
}
inputbar {
children: [ entry ];
}
textbox-prompt-colon {
text-color: inherit;
expand: false;
margin: 0 0.3em 0em 0em;
}
listview {
spacing: 0em;
dynamic: true;
cycle: true;
}
element {
padding: 16px;
border: 0 0 0 5px solid;
}
entry {
expand: true;
text-color: @normal-foreground;
background-color: rgb(25, 41, 51);
vertical-align: 1;
padding: 12px;
font: "Hack Nerd Font 13";
}
element normal.normal {
background-color: @normal-background;
text-color: @normal-foreground;
}
element normal.urgent {
background-color: @urgent-background;
text-color: @urgent-foreground;
}
element normal.active {
background-color: @active-background;
text-color: @active-foreground;
}
element selected.normal {
background-color: @selected-normal-background;
text-color: @selected-normal-foreground;
padding: 16px;
border: 0 0 0 5px solid;
border-color: @active-background;
}
element selected.urgent {
background-color: @selected-urgent-background;
text-color: @selected-urgent-foreground;
}
element selected.active {
background-color: @selected-active-background;
text-color: @selected-active-foreground;
}
element alternate.normal {
background-color: @normal-background;
text-color: @normal-foreground;
}
element alternate.urgent {
background-color: @urgent-background;
text-color: @urgent-foreground;
}
element alternate.active {
background-color: @active-background;
text-color: @active-foreground;
}
Logging into i3
- First logout of your current (GNOME) session.
- In the login screen, look for a cog icon on the bottom right corner.
- Click on it and choose the i3 option in it.
- Now you can login with your password and you will be put into the i3 session.
Keybinds
These are the list of basic keybinds in i3:
Windows + Enter
-> Opens Terminal.Windows + P
-> Opens app launcher (rofi). You can launch any other apps from there.Windows + <number>
-> Switch to Virtual Desktop <number>.Windows + Shift + <number>
-> Move the current window to Virtual Desktop <number>.Windows + W
-> Make all windows in the current Virtual Desktop maximized.Windows + Shift + F
-> Toggle the current window to be floating.Windows + Drag (Left Click)
-> Move the window under cursor around.Windows + Drag (Right Click)
-> Resize the window under cursor.Windows + Shift + Q
-> Logout of i3. Must be done to shutdown or restart the PC.Windows + Shift + C
-> Reload the config file of i3.Windows + Shift + R
-> Reload the complete i3 session.
Other QoL Stuff
You can also install arandr
using the command sudo dnf install autorandr
in a terminal. This is a GUI frontend for xrandr
which you can launch from the app launcher and you can arrange your connected displays as you want. Your primary display is the one that is underlined in the GUI there.
Congratulations! You have now setup i3! Now you can do boat eye without any hitches :D.
Boat Eye
Setting up boat eye on Linux is not as easy as it is on Windows. You might see some super weird behaviour while using it just because X11 handles mouse movement much different than Windows.
Make sure to follow instructions as closely as possible but if you do get any errors, make sure to post an issue here and I'll try and fix/debug the issue as far as possible.
The instructions given below will guide you through the procedure to setup boat eye on Linux.
Flagged WMs
- There are quite many window managers that this setup would never work on. Here, we will just list all of them that I found people report about.
- muffin (Linux Mint/Cinnamon Desktop Environment)
- xfwm (XFCE Desktop Environment)
- mutter (Gnome Desktop Environment)
- kwin (KDE Desktop Environment)
- More will be added to this list as errors are reported.
i3
i3 is a WM that has been tested a lot and it works very well with Fedora and all the tools. If you haven't setup i3 yet, you can do so in the Setting up i3 section of this guide.
Setting up mouse drivers
- Make sure that you have a Linux-compatible mouse (most Logitech and Razer mice should work. Make sure to check online if your mouse is Linux-compatible and is supported by any GUI software to configure DPI).
- Setup your mouse drivers by downloading the appropriate driver packages.
- Usually for Razer mice it is called
openrazer
for the GUI as well as the driver (I don't have a Razer mouse to cross-verify this. But do search around for the appropriate packages for your mouse). - Usually for Logitech mice it is called
piper
for the GUI andlibratbag
for the driver package. - After setting up your mouse drivers, make sure to open the GUI for setting up your mouse and check that your mouse is showing up on it.
Cursor speeds and DPI
- First of all, install
xinput
from your distribution's packages. It is required for setting cursor speeds in X11. - Refer to Priffin's calculator to figure out the proper boat eye cursor speed, DPI and sensitivity and setup any Minecraft related setup as explained here.
- To convert your cursor speeds to the appropriate multipliers (refer to the EPP off column here), use the table above.
- Set the DPI to the DPI that you took from the calculator in your mouse configuration application.
- Figure out the correct device ID for your mouse by running
xinput
in a terminal and analyzing the output. - Pick the correct id corresponding to your mouse and note it down.
- Eg:
Logitech G102 LIGHTSYNC Gaming Mouse id=11 [slave pointer (2)]
Here the device id would be11
. - Now set the cursor speed by executing the following command in a terminal:
xinput set-prop <device_id> 'Coordinate Transformation Matrix' <multiplier> 0 0 0 <multiplier> 0 0 0 1
- Here, replace
<device_id>
with the id and<multiplier>
with the multiplier that you took before well. - Eg:
xinput set-prop 11 'Coordinate Transformation Matrix' 0.125 0 0 0 0.125 0 0 0 1
wmctrl and xdotool
- wmctrl and xdotool are both command-line utilities used for desktop automation on Linux.
- Install
wmctrl
andxdotool
from your distribution's packages. - This will be required to be used along with
Autokey
in order to function as the Tall Macro.
Autokey
- Autokey, a desktop automation tool, is required in order to run our Tall Macro script.
- Download
autokey
from your distribution's packages and open it. - Hit
Ctrl+Shift+N
in order to create a new script. - Enter the name that you want to give to the script on the left.
- Go to the script tab that has the contents
#Enter script code
in it. - Paste in the below contents:
#Enter script code
import os
zoom_w = 320 # Change this to the width you want Minecraft to be in after Tall Resolution is toggled on.
zoom_h = 16384 # Do not change this unless you know what you are doing.
zoom_x = 800 # Change this to the x coordinate you want Minecraft to go to when Tall Resolution is toggled on.
zoom_y = (1080 - zoom_h) // 2 # Do not change this unless you know what you are doing.
normal_w = 1920 # Change this to the width you want Minecraft to be in after Tall Resolution is toggled off.
normal_h = 1080 # Change this to the height you want Minecraft to be in after Tall Resolution is toggled off.
normal_x = 0 # Change this to the x coordinate you want Minecraft to go to when Tall Resolution is toggled off.
normal_y = 0 # Change this to the y coordinate you want Minecraft to go to when Tall Resolution is toggled off.
normal_multiplier = 0.125 # Change this to the multipler you took from the table.
zoom_multiplier = 0.03125 # Change this to your pleasing by referring to the table (default = 0.0315 = cursor speed 1).
device_id = 11 # Change this to the correct device id that you noted down before.
# Do not change anything after this!
os.system("xdotool getactivewindow getwindowgeometry | grep Geometry > /tmp/res")
f = open("/tmp/res")
cur_h = f.read().strip().split(':')[1].strip().split('x')[1]
f.close()
if(int(cur_h) == normal_h):
if "Minecraft" in window.get_active_title():
os.system(f"wmctrl -R ':ACTIVE:' -e 0,{zoom_x},{zoom_y},{zoom_w},{zoom_h}")
os.system(f"xinput set-prop {device_id} 'Coordinate Transformation Matrix' {zoom_multiplier} 0 0 0 {zoom_multiplier} 0 0 0 1")
else:
os.system(f"wmctrl -R ':ACTIVE:' -e 0,{normal_x},{normal_y},{normal_w},{normal_h}")
os.system(f"xinput set-prop {device_id} 'Coordinate Transformation Matrix' {normal_multiplier} 0 0 0 {normal_multiplier} 0 0 0 1")
- Change the appropriate settings as indicated in the comments.
- Now go into the part that says
Hotkey
and click on theSet
button. - Now in the dialog box, click on
Record a key combination
and press the keys you would want to toggle Tall Resolution and click onOk
. This is usually just theJ
key. - Now go into the part that says
Window Filter
and click on theSet
button. - Now in the dialog box, in the text box that says
Regular expression to match:
type inMinecraft
and click onOk
. - Now press the
Run Script
button and the hotkey should be activated. You can close the Autokey window now but it will still run in the system tray. You can suspend hotkeys by just right clicking on the systray entry for Autokey and hittingExit Autokey
. - NOTE: You should run Autokey and run the script each time you want to have Tall Macro.
- You can also run custom scripts on every resolution toggle (eg. for setting DPI on toggling resolution for easier eye measurements by just adding a call to
os.system(<script_path>)
in the respective if/elif conditions, but this is out-of-scope of this document).
Polling Rate
- Setting the polling rate to a lower value is nicer just because having a higher polling rate somehow affects how X11 behaves in response to specific cursor speeds.
- Open your mouse configuration GUI and search for the tab that configures the polling rate of your mouse. Make sure to set it to a low value (such as 250Hz).
- This is not a de-facto standard for all cursor speeds and it doesn't fix the issue for all mice. So if you have any issues please report it here.
Finishing Up
- The zoom overlay for pixel counting could also be setup the same way as Windows by using the method for non-Julti macros (using a screen capture on OBS).
- However, this version of the Tall Macro doesn't support moving the projector under the Tall Minecraft Window and displaying it alongside. But it is possible to have another screen where it is always open and just peeking over at that to count pixels.
- Congratulations! We have successfully setup boat eye on Linux!
Rebinding Keys (for searchcrafting)
- Install
xdotool
andxmodmap
sudo dnf install xdotool xmodmap
- Now make a new file called
Rebinder.py
wherever you like and copy the following contents into it.
import os
# Settings
window_filter = "Minecraft*"
rebinds = {
25: "h",
43: "w",
}
reset_rebinds = {
43: "h",
25: "w",
}
rebound_keys = False
while True:
active_window = os.popen(
"xdotool getactivewindow getwindowclassname").read()
if window_filter in active_window and not rebound_keys:
for (keycode, keysym) in rebinds.items():
rebind_cmd = f"xmodmap -e 'keycode {keycode} = {keysym}'"
os.system(rebind_cmd)
print(f"Rebound Keycode: {keycode} to Keysym: {keysym}")
rebound_keys = True
elif window_filter not in active_window and rebound_keys:
for (keycode, keysym) in reset_rebinds.items():
reset_cmd = f"xmodmap -e 'keycode {keycode} = {keysym}'"
process = os.popen(reset_cmd)
os.system(reset_cmd)
print(f"Rebound Keycode: {keycode} to Keysym: {keysym}")
rebound_keys = False
- Here you can configure what keycodes can be rebound to what key symbols and how you can reset them to their original state (this happens when you are not focussed on a Minecraft instance).
- This information can be obtained by running
xev
in a terminal and hitting the respective key. You need to look for the Key Press or Key Release event in the output which will state the keycode and keysym in the following lines after it. The examples are a good place to start. Hith
andw
and see what the keycodes are. They should be43
and25
respectively. The example is a circular rebind fromh -> w
andw -> h
. - NOTE If you rebind keys using this method, you don't need to change your StandardSettings to indicate the change. Minecraft will automatically detect this change and poll for that rebound keycode instead.
- Now running
python3 Rebinder.py
will rebind your keys if focussed on a Minecraft window. - Note that you need to run
python3 Rebinder.py
in a terminal each time before you start your resetting session.