Upvote Upvoted 15 Downvote Downvoted
Linux & TF2 - Tutorial for Newbs
posted in Q/A Help
1
#1
0 Frags +

I decided to write a tutorial about TF2 & Linux.
Why? Because I feel like while it pretty much works out-of-the-box for most players, some do have certain requirements which involve digging deep.
Also this way I can maybe get a few people to just try it out.

A few things to consider:

  • fps are likely gonna be slightly lower than Windows
  • no counterpart to dx8 mode
  • at least for me, mouse sens is ~ 2x as high as Windows (not a problem, just change it in TF2)
  • several issues can occur related to distro/ compositor used
  • no way of getting stuff like esea client to work
  • commands I post work for debian based systems - ubuntu, mint, etc.
  • don't expect everything to work out the first time - be prepared to fiddle around!
  • no plugins like prec (thanks Kenneth)

If some command doesn't seem to work, apply the old rule: put a 'sudo' in front!
This runs the command as root - the linux version of Admin on Windows.

Currently included in this guide:

To start things off I'm gonna assume you have a current debian based system already installed -
e.g. Ubuntu 15.04
or Mint 17.2
or alternatively any other distro like Arch,
but you'd have to look up the according commands yourself (for instance: apt-get vs. pacman).

I use Ubuntu, because i always have.

Now, let's get started. One of the biggest mysteries regarding Linux is drivers.

Driver
In the linux world they are also called modules and generally you don't have to worry about them in the slightest - but we aren't general, are we? Not those Intel IGP laptop peasants right?
So just as we have to install current drivers in Windows, we have to do just that in Linux.

And even if you actually do use an Intel IGP, you might want to look into this.

Generally, you have the option between closed source and open source modules.

  • a) you have a nVidia GPU
    Your options are pretty limited. As nVidia doesn't give a **** about Open Source, they don't support the community building the open source driver which is called nouveau.
    Basically everything in this driver is based on reverse-engineering and it lacks a ton of features - and also performance. Not recommended at this point, but of course you can try it out for yourself. Read below if you dare.
    The good thing is, their closed source driver is pretty good. Download it here & choose Linux 64-bit

  • b) you use an AMD GPU
    This is a different but similar story. While AMD's Windows drivers are nowadays considered of equal quality compared to nVidia's, they seem to not give a **** about their Linux Catalyst. Painfully slow to fix stuff, and it always seems to break my system when I try to use it. In this case, I would recommend you first try the open source driver as they rebuilt it from scratch and it doesn't break anything - but it still isn't feature complete and usually offers less performance as compared to Catalyst.
    Download Catalyst here.
    For open source driver read below.

  • c) Intel GPU
    read below; procedure is same as all other open source drivers.

x) Open Source driver
The open source driver started as a community effort to provide free drivers for all the GPUs out there. It's mainly being developed by Intel and others like RedHat, vmware etc... and also AMD and a few other individuals...

To get the current version, you'll have to do some command line stuff.
At first, the basics. Hit Ctrl+Alt+T in Ubuntu/ Mint/ etc. to open the Terminal, or console. If you're using KDE desktop, the application to look for is Konsole. Either way, you'll find it.
To copy/paste something from/into the terminal, you'll have to hit Ctrl+Shift+C / Ctrl+Shift+V.

Now type

sudo apt-get update

to update the packet repository. Debian based systems use apt-get to manage software and all dependencies. While this guarantees everyone will always use the most current version of everything that's installed (no firefox using flasplayer 9 while IE is using its own shit etc), you can also break it if you force it to install software with broken dependencies - so try not to break it!

So the first thing you're going to install ppa-purge:

sudo apt-get install ppa-purge

This is a handy tool that can cleanup every repository you added before. Just type ppa-purge followed by the name of the repository you added before, if something goes wrong, i.e. sudo ppa-purge ppa:****; which is exactly what we are going to do right now:

sudo add-apt-repository ppa:oibaf/graphics-drivers

This adds oibaf's repository to our packet sources. It includes the latest open source drivers out there. Hit ENTER to confirm and update your packet repo once more:

sudo apt-get update

Now, to upgrade everything (including the old open source driver, which is installed by default) you type in

sudo apt-get dist-upgrade

This is also the way to update your whole system - which is the reason why this could take a while right now.

y) Installing the closed source drivers
If you want the installation to be hassle-free, start the program 'Additional Drivers' and choose the one tagged as 'proprietary'.

For most bleeding edge stuff, use the drivers downloaded before;
The nVidia driver is pretty easy. Open the terminal (Ctrl-Alt-T) and go to your Downloads folder:

cd Downloads

Make the file you downloaded executable:

chmod +x <bla.run>

Run the file & follow instructions

sudo ./<bla.run>

.... Reboot and type

sudo nvidia-xconfig

The AMD driver you have to unzip first:

unzip <file.zip>

Run the .run (same procedure as above); this generates .deb files:

sudo dpkg -i fglrx*.deb

After install, type

sudo amdconfig --initiall

If it doesn't work properly, something somewhere has f**d up - there can be literally 1 million issues. I counted them all. Try google - you'll definitely find the issue. Alternatively, just use the 'Additional Drivers' solution.

I decided to write a tutorial about TF2 & Linux.
Why? Because I feel like while it pretty much works out-of-the-box for most players, some do have certain requirements which involve digging deep.
Also this way I can maybe get a few people to just try it out.

A few things to consider:
[list]
[*] fps are likely gonna be slightly lower than Windows
[*] no counterpart to dx8 mode
[*] at least for me, mouse sens is ~ 2x as high as Windows (not a problem, just change it in TF2)
[*] several issues can occur related to distro/ compositor used
[*] no way of getting stuff like esea client to work
[*] commands I post work for debian based systems - ubuntu, mint, etc.
[*] don't expect everything to work out the first time - be prepared to fiddle around!
[*] no plugins like prec (thanks Kenneth)
[/list]

If some command doesn't seem to work, apply the old rule: put a 'sudo' in front!
This runs the command as [i]root[/i] - the linux version of Admin on Windows.

[b]Currently included in this guide:[/b]
[list]
[*] Driver updates
[*] Monitor
[*] [url=http://www.teamfortress.tv/post/457701/linux-amp-tf2-tutorial-for-newbs]Mouse accel[/url]
[*] Steam/ TF2 customisation
[*] [url=http://www.teamfortress.tv/post/457651/linux-amp-tf2-tutorial-for-newbs]prec alternative (?)[/url]
[/list]

To start things off I'm gonna assume you have a current debian based system already installed -
e.g. [url=http://www.ubuntu.com/download/desktop]Ubuntu 15.04[/url]
or [url=http://www.linuxmint.com/download.php]Mint 17.2[/url]
or alternatively any other distro like [url=https://www.archlinux.org/download/]Arch[/url],
but you'd have to look up the according commands yourself (for instance: apt-get vs. pacman).

I use Ubuntu, because i always have.

Now, let's get started. One of the biggest mysteries regarding Linux is [i]drivers[/i].

[b][u]Driver[/u][/b]
In the linux world they are also called [i]modules[/i] and generally you don't have to worry about them in the slightest - but we aren't general, are we? Not those Intel IGP laptop peasants right?
So just as we have to install current drivers in Windows, we have to do just that in Linux.

And even if you actually [i]do[/i] use an Intel IGP, you might want to look into this.

Generally, you have the option between closed source and open source [i]modules[/i].

[list]
[*] [u]a) you have a nVidia GPU[/u]
Your options are pretty limited. As nVidia doesn't give a **** about Open Source, they don't support the community building the open source driver which is called [url=http://nouveau.freedesktop.org/wiki/]nouveau[/url].
Basically everything in this driver is based on reverse-engineering and it lacks a ton of features - and also performance. Not recommended at this point, but of course you can try it out for yourself. Read below if you dare.
The good thing is, their closed source driver is pretty good. Download it here & [url=http://www.nvidia.com/Download/index.aspx?lang=en-us]choose Linux 64-bit[/url]

[*] [u]b) you use an AMD GPU[/u]
This is a different but similar story. While AMD's Windows drivers are nowadays considered of equal quality compared to nVidia's, they seem to not give a **** about their Linux Catalyst. Painfully slow to fix stuff, and it always seems to break my system when I try to use it. In this case, I would recommend you first try the open source driver as they rebuilt it from scratch and it doesn't break anything - but it still isn't feature complete and usually offers less performance as compared to Catalyst.
Download Catalyst [url=http://support.amd.com/en-us/download/desktop?os=Linux+x86]here[/url].
For open source driver read below.

[*] [u]c) Intel GPU[/u]
read below; procedure is same as all other open source drivers.
[/list]

[u]x) Open Source driver[/u]
The open source driver started as a community effort to provide free drivers for all the GPUs out there. It's mainly being developed by Intel and others like RedHat, vmware etc... and also AMD and a few other individuals...

To get the current version, you'll have to do some command line stuff.
At first, the basics. Hit [i]Ctrl+Alt+T[/i] in Ubuntu/ Mint/ etc. to open the Terminal, or console. If you're using KDE desktop, the application to look for is [i]Konsole[/i]. Either way, you'll find it.
To copy/paste something from/into the terminal, you'll have to hit Ctrl+Shift+C / Ctrl+Shift+V.

Now type
[code]sudo apt-get update[/code]
to update the packet repository. Debian based systems use apt-get to manage software and all dependencies. While this guarantees everyone will always use the most current version of everything that's installed (no firefox using flasplayer 9 while IE is using its own shit etc), you can also break it if you force it to install software with broken dependencies - so try not to break it!

So the first thing you're going to install [i]ppa-purge[/i]:
[code]sudo apt-get install ppa-purge[/code]
This is a handy tool that can cleanup every repository you added before. Just type ppa-purge followed by the name of the repository you added before, if something goes wrong, i.e. sudo ppa-purge ppa:****; which is exactly what we are going to do right now:
[code]sudo add-apt-repository ppa:oibaf/graphics-drivers[/code]
This adds [i]oibaf's[/i] repository to our packet sources. It includes the latest open source drivers out there. Hit ENTER to confirm and update your packet repo once more:
[code]sudo apt-get update[/code]
Now, to upgrade everything (including the [i]old[/i] open source driver, which is installed by default) you type in
[code]sudo apt-get dist-upgrade[/code]
This is also the way to update your whole system - which is the reason why this could take a while right now.

[u]y) Installing the closed source drivers[/u]
If you want the installation to be hassle-free, start the program 'Additional Drivers' and choose the one tagged as 'proprietary'.

For most bleeding edge stuff, use the drivers downloaded before;
The nVidia driver is pretty easy. Open the terminal (Ctrl-Alt-T) and go to your Downloads folder:
[code]cd Downloads[/code]
Make the file you downloaded executable:
[code]chmod +x <bla.run>[/code]
Run the file & follow instructions
[code]sudo ./<bla.run>[/code]
.... Reboot and type
[code]sudo nvidia-xconfig[/code]

The AMD driver you have to unzip first:
[code]unzip <file.zip>[/code]
Run the .run (same procedure as above); this generates .deb files:
[code]sudo dpkg -i fglrx*.deb[/code]
After install, type
[code]sudo amdconfig --initiall[/code]

If it doesn't work properly, something somewhere has f**d up - there can be literally 1 million issues. I counted them all. Try google - you'll definitely find the issue. Alternatively, just use the 'Additional Drivers' solution.
2
#2
2 Frags +

z) Kernel
For the most bleeding-edge hardware & features you will need a current kernel. The distros will provide newer kernels - but if you're using something like ubuntu (which is not a rolling release), newer kernels won't be installed by default. For instance, Ubuntu 15.04 won't go any further than kernel 3.19.

To get a newer kernel you'll have to visit ubuntu-kernel-ppa. Scroll down and locate some new kernel you'd like to try. But be careful - unstable actually does mean unstable - at least for a considerable amount of people who therefore filed a bug report! You might get lucky..

Generally you should only install a new kernel if you're using the open source driver!

Now, open the repository and locate 3 files: two of those will look like this: *-generic*amd64.deb, and also one *all.deb.
Download those. Then open the terminal (Ctrl-Alt-T) and go to your Downloads folder:

cd Downloads

Then, install the kernel:

sudo dpkg -i *.deb

and reboot.
Open the terminal again and type

uname -a

to confirm you successfully installed the kernel.

Most of the other stuff will just work out-of-the-box; the only thing I ever had any problems with is surround sound. I fixed it by installing a program called pavucontrol:

sudo apt-get install pavucontrol

This lets you configure everything related to sound cards and has more options than the integrated pulse audio control panel.

Monitor

So now let's get to another major thing of interest for a linux gamer - using your monitor to its full potential.

The tool you need is called xrandr. Type it into the terminal:

xrandr

This is what I get:

Screen 0: minimum 320 x 200, current 3600 x 1093, maximum 16384 x 16384
DisplayPort-0 disconnected (normal left inverted right x axis y axis)
DisplayPort-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1680x1050+1920+0 (normal left inverted right x axis y axis) 433mm x 271mm
   1680x1050      60.0*+
   1280x1024      75.0     60.0  
   1280x960       60.0  
   1152x864       75.0  
   1024x768       75.1     70.1     60.0  
   832x624        74.6  
   800x600        72.2     75.0     60.3     56.2  
   640x480        75.0     72.8     66.7     60.0  
   720x400        70.1  
DVI-0 connected primary 1920x1080+0+13 (normal left inverted right x axis y axis) 531mm x 299mm
   1920x1080      60.0 +  144.0*   120.0     99.9     59.9  
   1680x1050      59.9  
   1280x1024      75.0     60.0  
   1440x900       59.9  
   1280x720       59.9  
   1024x768      120.0    100.0     75.1     70.1     60.0  
   832x624        74.6  
   800x600       120.0    100.0     72.2     75.0     60.3     56.2  
   640x480       120.0    100.0     75.0     72.8     66.7     60.0     59.9  
   720x400        70.1  

It tells you about all the monitors connected. A '*' sigals the current setting, a '+' the default one.
Most likely your default and current setting will be the same.

Why is this, you may ask? Well, it's basically the guaranteed setting, it's always gonna work. In Windows it's just the same, your 120 or 144Hz monitor will always run at 60Hz by default.

Now let's do something about that. Just make sure you're using an appropriate cable, e.g. a dual link DVI cable.

Type in the following. You can basically always use TAB to auto-complete:

xrandr --output DVI-0 --mode 1920x1080 --rate 144.0

To make that change permanent, put this command into a file which gets executed on each login. To edit that file, type

gedit ~/.bashrc

and add the xrandr command at the bottom of that file.

And voilá - everything is smooth af. Or is it?
Well - depends. This is one major problem Ubuntu currently has (or compiz, the compositor of Unity, the Ubuntu desktop environment). It's locked at 60Hz and there's nothing one can do about it. It's likely never going to get fixed as everyone in the linux world is moving away from X.org, the default window system up until now. It's getting replaced by a new window protocol (e.g. Wayland) + an appropriate compositor.

Anyway, I can definitely understand why this is a major turnoff for a lot of guys. I got over it, but if it bothers you, you might look into something different than Ubuntu, e.g. Mint; Cinnamon doesn't have this problem and it's more Windows-like anyway.

Fullscreen and OpenGL applications don't have this problem btw. You can test this yourself. Install mesa-utils:

sudo apt-get install mesa-utils

and start

glxgears

It will print the current fps of this simple GL app to the terminal: 144 for my main monitor, 60 when I move it onto the other screen. TF2 is just as smooth as well.

[u]z) Kernel[/u]
For the most bleeding-edge hardware & features you will need a current kernel. The distros will provide newer kernels - but if you're using something like ubuntu (which is not a rolling release), newer kernels won't be installed by default. For instance, Ubuntu 15.04 won't go any further than kernel 3.19.

To get a newer kernel you'll have to visit [url=http://kernel.ubuntu.com/~kernel-ppa/mainline/]ubuntu-kernel-ppa[/url]. Scroll down and locate some new kernel you'd like to try. But be careful - unstable actually does mean unstable - at least for a considerable amount of people who therefore filed a bug report! You might get lucky..

Generally you should only install a new kernel if you're using the open source driver!

Now, open the repository and locate 3 files: two of those will look like this: *-generic*amd64.deb, and also one *all.deb.
Download those. Then open the terminal (Ctrl-Alt-T) and go to your Downloads folder:
[code]cd Downloads[/code]
Then, install the kernel:
[code]sudo dpkg -i *.deb[/code]
and reboot.
Open the terminal again and type
[code]uname -a[/code]
to confirm you successfully installed the kernel.

Most of the other stuff will just work out-of-the-box; the only thing I ever had any problems with is surround sound. I fixed it by installing a program called pavucontrol:
[code]sudo apt-get install pavucontrol[/code]
This lets you configure everything related to sound cards and has more options than the integrated pulse audio control panel.


[b][u]Monitor[/u][/b]

So now let's get to another major thing of interest for a linux gamer - using your monitor to its full potential.

The tool you need is called [i]xrandr[/i]. Type it into the terminal:
[code]xrandr[/code]
This is what I get:
[code]
Screen 0: minimum 320 x 200, current 3600 x 1093, maximum 16384 x 16384
DisplayPort-0 disconnected (normal left inverted right x axis y axis)
DisplayPort-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1680x1050+1920+0 (normal left inverted right x axis y axis) 433mm x 271mm
1680x1050 60.0*+
1280x1024 75.0 60.0
1280x960 60.0
1152x864 75.0
1024x768 75.1 70.1 60.0
832x624 74.6
800x600 72.2 75.0 60.3 56.2
640x480 75.0 72.8 66.7 60.0
720x400 70.1
DVI-0 connected primary 1920x1080+0+13 (normal left inverted right x axis y axis) 531mm x 299mm
1920x1080 60.0 + 144.0* 120.0 99.9 59.9
1680x1050 59.9
1280x1024 75.0 60.0
1440x900 59.9
1280x720 59.9
1024x768 120.0 100.0 75.1 70.1 60.0
832x624 74.6
800x600 120.0 100.0 72.2 75.0 60.3 56.2
640x480 120.0 100.0 75.0 72.8 66.7 60.0 59.9
720x400 70.1
[/code]
It tells you about all the monitors connected. A '*' sigals the current setting, a '+' the default one.
Most likely your default and current setting will be the same.

Why is this, you may ask? Well, it's basically the guaranteed setting, it's always gonna work. In Windows it's just the same, your 120 or 144Hz monitor will always run at 60Hz by default.

Now let's do something about that. Just make sure you're using an appropriate cable, e.g. a dual link DVI cable.

Type in the following. You can basically always use TAB to auto-complete:
[code]xrandr --output DVI-0 --mode 1920x1080 --rate 144.0[/code]

To make that change permanent, put this command into a file which gets executed on each login. To edit that file, type
[code]gedit ~/.bashrc[/code]
and add the xrandr command at the bottom of that file.

And voilá - everything is smooth af. Or is it?
Well - depends. This is one major problem Ubuntu currently has (or compiz, the compositor of Unity, the Ubuntu desktop environment). It's locked at 60Hz and there's nothing one can do about it. It's likely never going to get fixed as everyone in the linux world is moving away from X.org, the default window system up until now. It's getting replaced by a new window protocol (e.g. Wayland) + an appropriate compositor.

Anyway, I can definitely understand why this is a major turnoff for a lot of guys. I got over it, but if it bothers you, you might look into something different than Ubuntu, e.g. Mint; Cinnamon doesn't have this problem and it's more Windows-like anyway.

Fullscreen and OpenGL applications don't have this problem btw. You can test this yourself. Install mesa-utils:
[code]sudo apt-get install mesa-utils[/code]
and start
[code]glxgears[/code]
It will print the current fps of this simple GL app to the terminal: 144 for my main monitor, 60 when I move it onto the other screen. TF2 is just as smooth as well.
3
#3
1 Frags +

Steam & customising TF2
Now that we've set the stage, enters Steam. Sometimes you can just

sudo apt-get install steam

but most of the time you'll have to download it from the website. You'll end up with a .deb, which you can install with (after cd'ing into your Download folder)

sudo dpkg -i <file.deb>

After this start steam by typing 'steam' in terminal or just open it in the launcher/ start menu. But un momento - the SteamOS relationship shows why Steam on linux is still in beta imo. For steam to actually use the updated drivers/ libraries you installed in the sweat of your brow - you must force it to!

To do that, you'll delete Steam's versions of said libraries by copy-pasting the following commands into your terminal:

find ~/.steam/root/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" \) -print -delete
find ~/.local/share/Steam/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" \) -print -delete

//added, thanks to hpqoeu: (might work but requires more fiddling)
You can also define an env variable to make steam use your own libs: STEAM_RUNTIME=0
To use this variable, start steam like this:

STEAM_RUNTIME=0 steam

For not having to prefix it, open

gedit /etc/environment

and add a new line:

STEAM_RUNTIME="0"

Now you can restart steam, and everything should work out just fine. Except stuff like windowed mode for some reason - but this probably due to compiz yet again.

Your tf2 folder you can find here:

cd ~/.steam/steam/steamapps/common/Team\ Fortress\ 2/tf/

To open the folder you're currently in your terminal, type

nautilus .

Replace 'nautilus' by 'dolphin' if you're using KDE or by 'nemo' if you're using Mint or whatever your file manager is called. The '.' describes the current folder you're in. You might find that navigating this way is usually much quicker and less clunky.

Placing your HUD files works just as in Windows.

But I've got something better. Linux is the system for developers and advanced users, so why not make use of that?
Noone likes to update his HUD, especially if you've made your own customisations.

But thankfully, most of the guys making HUDs host them on github or something similar. Let's check it out! For example, we'll be using rayshud and we'll customise our crosshair!

Navigate to rayshud on github. You'll notice the HTTPS url on the right, just above the 'Download ZIP' button. This button is for peasants, ignore it.

Instead, open your terminal and install git:

sudo apt-get install git

done. Now navigate to a folder, where you'd like to keep your personal HUD edit. I for my part keep this in a Dropbox folder, because I have different PCs I've TF2 installed on.
Clone ray's repository by typing

git clone https://github.com/raysfire/rayshud.git

where the last part is the HTTPS url mentioned above.
Git will now create a folder 'rayshud' and copy everything in there. cd into this directory. Now we can make our edit. Open the relevant file by typing

gedit scripts/hudlayout.res

Replace 'gedit' by the text editor you have installed. I like the basic cross, so I search for 'BasicCross' and change 'visible' to 1, 'enabled' to 1 and give it a green color: 'fgcolor' to '0 255 0 255'.
Save the file & close the editor. Now you can review your changes by typing

git diff

Press ENTER to scroll the diff overview or/and press 'q' to exit. If you're confident you did it right, you will now make your own branch on ray's repository. It's gonna be a local branch, you can't upload it to his repository. (orly?)
To do that, type

git checkout -b "yourfancynewbranchname"

Git now creates a new branch with that exact name and switches to it. Type

git branch

to view all available local branches. You'll see 'master' and 'your....'.
Now we store our changes in this new branch. To do that, type

git commit -a -m "change basically the whole code-base"

You can choose whatever message you like. Now you can change back to master branch:

git checkout master

If you don't believe it, you can open scripts/hudlayout.res once again and you'll find that it doesn't include the changes you made.
If you accidentally make some changes, you can just ditch them by typing

git stash

which is necessary before checking out into another branch. Either that or commiting your changes.

Now, this is all cool, but what did you actually win by doing this?
Well, every time rays updates his hud, you can incorporate those changes into your branch, without losing your own changes. To do this, checkout into the master branch and type

git fetch
git pull

This will update your master branch. After this you checkout into your own branch and simply type

git merge origin master

which will merge the master branch into your own branch. Done!

To make it even more convenient, you can also create a shell script to copy all those files into your TF2 directory. Switch to your branch and open a new file:

gedit update-local

This creates a new empty file 'update-local' in your rayshud folder. Paste the following:

#!/bin/bash

USR_PATH="$HOME/.steam/steam/steamapps/common/Team Fortress 2/tf/custom/usr"

echo "use path: $USR_PATH"
rm -r "${USR_PATH}"
mkdir "$USR_PATH"
cp -r ./cfg "$USR_PATH"
cp -r ./materials "$USR_PATH"
cp -r ./resource "$USR_PATH"
cp -r ./scripts "$USR_PATH"
cp -r ./sound "$USR_PATH"

What this does is pretty much self-explanatory. So I'm not gonna explain it ;)
One thing, though... you'll notice I added the config folder as well, which includes all my custom cfgs. Add those to your branch by copying your cfg folder into your rayshud folder and typing

git add --all

Add this script file with

git add update-local

and make it executable:

chmod +x update-local

Commit this change as well to your branch!

Now, after updating / making changes you'll just have to type

./update-local

and it's done!

================
I hope you found that wall of text interesting and helpful. If you've followed through to the end, you might've also learned some stuff about the most popular revision control software in the world, a useful skill to have ;)

If you find any errors,let me know & feel free to add stuff!
edit: goddamnit kenneth
though thanks for the input, i'll add it

[b][u]Steam & customising TF2[/u][/b]
Now that we've set the stage, enters Steam. Sometimes you can just
[code]sudo apt-get install steam[/code]
but most of the time you'll have to download it from the website. You'll end up with a .deb, which you can install with (after cd'ing into your Download folder)
[code]sudo dpkg -i <file.deb>[/code]
After this start steam by typing 'steam' in terminal or just open it in the launcher/ start menu. But un momento - the SteamOS relationship shows why Steam on linux is still in beta imo. For steam to actually use the updated drivers/ libraries you installed in the sweat of your brow - you must force it to!

To do that, you'll delete Steam's versions of said libraries by copy-pasting the following commands into your terminal:
[code]
find ~/.steam/root/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" \) -print -delete
find ~/.local/share/Steam/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" \) -print -delete
[/code]
//added, thanks to hpqoeu: (might work but requires more fiddling)
You can also define an env variable to make steam use your own libs: STEAM_RUNTIME=0
To use this variable, start steam like this:
[code]STEAM_RUNTIME=0 steam[/code]
For not having to prefix it, open
[code]gedit /etc/environment[/code]
and add a new line:
[code]STEAM_RUNTIME="0"[/code]

Now you can restart steam, and everything should work out just fine. Except stuff like windowed mode for some reason - but this probably due to compiz yet again.

Your tf2 folder you can find here:
[code]cd ~/.steam/steam/steamapps/common/Team\ Fortress\ 2/tf/[/code]
To open the folder you're currently in your terminal, type
[code]nautilus .[/code]
Replace 'nautilus' by 'dolphin' if you're using KDE or by 'nemo' if you're using Mint or whatever your file manager is called. The '.' describes the current folder you're in. You might find that navigating this way is usually much quicker and less clunky.

Placing your HUD files works just as in Windows.

But I've got something better. Linux is [i]the[/i] system for developers and advanced users, so why not make use of that?
Noone likes to update his HUD, especially if you've made your own customisations.

But thankfully, most of the guys making HUDs host them on github or something similar. Let's check it out! For example, we'll be using rayshud and we'll customise our crosshair!

Navigate to [url=https://github.com/raysfire/rayshud]rayshud on github[/url]. You'll notice the HTTPS url on the right, just above the 'Download ZIP' button. This button is for peasants, ignore it.

Instead, open your terminal and install git:
[code]sudo apt-get install git[/code]
done. Now navigate to a folder, where you'd like to keep your personal HUD edit. I for my part keep this in a Dropbox folder, because I have different PCs I've TF2 installed on.
Clone ray's repository by typing
[code]git clone https://github.com/raysfire/rayshud.git[/code]
where the last part is the HTTPS url mentioned above.
Git will now create a folder 'rayshud' and copy everything in there. cd into this directory. Now we can make our edit. Open the relevant file by typing
[code]gedit scripts/hudlayout.res[/code]
Replace 'gedit' by the text editor you have installed. I like the basic cross, so I search for 'BasicCross' and change 'visible' to 1, 'enabled' to 1 and give it a green color: 'fgcolor' to '0 255 0 255'.
Save the file & close the editor. Now you can review your changes by typing
[code]git diff[/code]
Press ENTER to scroll the diff overview or/and press 'q' to exit. If you're confident you did it right, you will now make your own branch on ray's repository. It's gonna be a local branch, you can't upload it to his repository. (orly?)
To do that, type
[code]git checkout -b "yourfancynewbranchname"[/code]
Git now creates a new branch with that exact name and switches to it. Type
[code]git branch[/code]
to view all available local branches. You'll see 'master' and 'your....'.
Now we store our changes in this new branch. To do that, type
[code]git commit -a -m "change basically the whole code-base"[/code]
You can choose whatever message you like. Now you can change back to master branch:
[code]git checkout master[/code]
If you don't believe it, you can open scripts/hudlayout.res once again and you'll find that it doesn't include the changes you made.
If you accidentally make some changes, you can just ditch them by typing
[code]git stash[/code]
which is necessary before checking out into another branch. Either that or commiting your changes.

Now, this is all cool, but what did you actually win by doing this?
Well, every time rays updates his hud, you can incorporate those changes into your branch, without losing your own changes. To do this, checkout into the master branch and type
[code]
git fetch
git pull
[/code]
This will update your master branch. After this you checkout into your own branch and simply type
[code]
git merge origin master
[/code]
which will merge the master branch into your own branch. Done!

To make it even more convenient, you can also create a shell script to copy all those files into your TF2 directory. Switch to your branch and open a new file:
[code]gedit update-local[/code]
This creates a new empty file 'update-local' in your rayshud folder. Paste the following:
[code]
#!/bin/bash

USR_PATH="$HOME/.steam/steam/steamapps/common/Team Fortress 2/tf/custom/usr"

echo "use path: $USR_PATH"
rm -r "${USR_PATH}"
mkdir "$USR_PATH"
cp -r ./cfg "$USR_PATH"
cp -r ./materials "$USR_PATH"
cp -r ./resource "$USR_PATH"
cp -r ./scripts "$USR_PATH"
cp -r ./sound "$USR_PATH"
[/code]
What this does is pretty much self-explanatory. So I'm not gonna explain it ;)
One thing, though... you'll notice I added the config folder as well, which includes all my custom cfgs. Add those to your branch by copying your cfg folder into your rayshud folder and typing
[code]git add --all[/code]

Add this script file with
[code]git add update-local[/code]
and make it executable:
[code]chmod +x update-local[/code]
Commit this change as well to your branch!

Now, after updating / making changes you'll just have to type
[code]./update-local[/code]
and it's done!



================
I hope you found that wall of text interesting and helpful. If you've followed through to the end, you might've also learned some stuff about the most popular revision control software in the world, a useful skill to have ;)

If you find any errors,let me know & feel free to add stuff!
edit: goddamnit kenneth
though thanks for the input, i'll add it
4
#4
2 Frags +

/

/
5
#5
1 Frags +
AndKennethNo prec as well unfortunately.

There is blink_record. Although it's nowhere near as convenient as prec, it's definitely better than manually recording demos.

[quote=AndKenneth]No prec as well unfortunately.
[/quote]

There is [url=https://github.com/nisseblink/blink_record]blink_record[/url]. Although it's nowhere near as convenient as prec, it's definitely better than manually recording demos.
6
#6
0 Frags +

Prec is a signed plugin, so we'd need to get valve approval for it. Someone made something a while ago when prec broke and I was looking at trying to get valve to sign it. It kind of fell through when prec was updated and then valve just reverted the changes.

Prec is a signed plugin, so we'd need to get valve approval for it. Someone made something a while ago when prec broke and I was looking at trying to get valve to sign it. It kind of fell through when prec was updated and then valve just reverted the changes.
7
#7
2 Frags +

Should probably have other things X.org messes with in the guide as well, for example mouse acceleration is controlled by X, I had to use this to disable it when realized I still had mouse accel when the slider was down.
https://wiki.archlinux.org/index.php/Mouse_acceleration

Should probably have other things X.org messes with in the guide as well, for example mouse acceleration is controlled by X, I had to use this to disable it when realized I still had mouse accel when the slider was down.
https://wiki.archlinux.org/index.php/Mouse_acceleration
8
#8
0 Frags +

Well, for me raw input actually fixed it, I don't have any mouse accel ingame. Can't tell for sure for everything else though.

Well, for me raw input actually fixed it, I don't have any mouse accel ingame. Can't tell for sure for everything else though.
9
#9
1 Frags +

>find ~/.steam/root/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" \) -print -delete
>find ~/.local/share/Steam/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" \) -print -delete

why would you do that. STEAM_RUNTIME=0 does that without messing with the files that steam installs.

>find ~/.steam/root/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" \) -print -delete
>find ~/.local/share/Steam/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" \) -print -delete

why would you do that. STEAM_RUNTIME=0 does that without messing with the files that steam installs.
10
#10
-1 Frags +

.

.
11
#11
1 Frags +
hpqoeu>find ~/.steam/root/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" \) -print -delete
>find ~/.local/share/Steam/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" \) -print -delete

why would you do that. STEAM_RUNTIME=0 does that without messing with the files that steam installs.

nice find, didn't know about that. Added in the tutorial!

[quote=hpqoeu]>find ~/.steam/root/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" \) -print -delete
>find ~/.local/share/Steam/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" \) -print -delete

why would you do that. STEAM_RUNTIME=0 does that without messing with the files that steam installs.[/quote]
nice find, didn't know about that. Added in the tutorial!
12
#12
0 Frags +
AndKennethPrec is a signed plugin, so we'd need to get valve approval for it. Someone made something a while ago when prec broke and I was looking at trying to get valve to sign it. It kind of fell through when prec was updated and then valve just reverted the changes.

Valve won't sign stuff anymore iirc. I think SizzlingCalamari tried to get them to sign a prec for linux/mac and they didn't reply to his messages

[quote=AndKenneth]Prec is a signed plugin, so we'd need to get valve approval for it. Someone made something a while ago when prec broke and I was looking at trying to get valve to sign it. It kind of fell through when prec was updated and then valve just reverted the changes.[/quote]

Valve won't sign stuff anymore iirc. I think SizzlingCalamari tried to get them to sign a prec for linux/mac and they didn't reply to his messages
13
#13
3 Frags +

Some info regarding mouse accel

You may or may not be able to disable mouse accel with m_rawinput 1, my G400 can't do this, logitech release software on windows to disable mouse accel, so unless mouse accel is disabled by default or there is a hardware button on the mouse you're out of luck using m_rawinput 1.

Luckily, input lag on linux is a lot lower in general. With m_rawinput 0 you can always disable mouse accel with xinput

To disable mouse accel with xinput run:
find the ID of your mouse (number)

xinput

find the mouse accel option and note it's ID, gernerally we want to set the accel prop to -1 to disable. May be called something like AccelerationProfile

xinput list-props MOUSE-ID

Disable mouse accel

xinput set-prop MOUSE-ID ACCEL ID -1 

e.g.

xinput set-prop 8 271 -1

put the line to disable mouse accel into ~/.bashrc so it executes on every login.
May differ for different mouse vendors

Some info regarding mouse accel

You may or may not be able to disable mouse accel with m_rawinput 1, my G400 can't do this, logitech release software on windows to disable mouse accel, so unless mouse accel is disabled by default or there is a hardware button on the mouse you're out of luck using m_rawinput 1.

Luckily, input lag on linux is a lot lower in general. With m_rawinput 0 you can always disable mouse accel with xinput

To disable mouse accel with xinput run:
find the ID of your mouse (number)
[code]xinput[/code]

find the mouse accel option and note it's ID, gernerally we want to set the accel prop to -1 to disable. May be called something like AccelerationProfile
[code]xinput list-props MOUSE-ID[/code]

Disable mouse accel
[code]xinput set-prop MOUSE-ID ACCEL ID -1 [/code]
e.g.
[code]xinput set-prop 8 271 -1[/code]

put the line to disable mouse accel into ~/.bashrc so it executes on every login.
May differ for different mouse vendors
Please sign in through STEAM to post a comment.