Posts

Showing posts with the label linux

Fix Controller Input when a Game Doesn't Use Steam Input

Background Knowledge Steam Input is an interface for developers to use the controller configuration built into Steam for their games. It is entirely optional and not all games use it. Steam gives you the option to enable and disable Steam Input on a per game basis. Steam has controller button mapping for in-game, Big Picture Mode, and on desktop (outside of games), and mappings for individual games. By default Steam will give certain controllers a desktop mapping that lets you move the mouse and bring up an on-screen keyboard, which is not what you want in a game. If you press F11 in a game and Steam Overlay doesn't appear and you have it configured to appear, Steam thinks that you are not in a game, and therefore it will use the desktop mapping instead of the in-game mapping. Steam Input works by capturing inputs from your controller, suppressing them from the rest of your system and emitting the inputs that you desire instead to the rest of your system. Problem If you are playin...

Gaming on Linux Gotchas

I've been PC gaming solely on Linux since the beginning of 2020 and generally things that are meant to work just work; it's just a case of installing a game through Lutris or switching on Proton for all games in Steam. But I've definitely experienced problems that have been some effort to resolve. I'll update this article over time as I find more things. Sometimes the Default Version of Proton Used is Out of Date At any time you will likely have many different versions of proton installed, so that if you have an issue, you can just toggle the version in the game's settings. For some reason when its set to "default" that doesn't always mean the latest version. I'm not sure if this is a bug or something Valve has done to certain games. In my case this was with Doom Eternal. GSync can Default to the Wrong Screen In your NVidia settings, there is a tab called "X Server XVideo Settings", which chooses which of your screens to apply GSync to. I...

Fix Inability to Move Files to Trash in VSC

You need to configure an environment variable to tell Electron (what VSC is built on) how to trash things. In ~/.profile add: export ELECTRON_TRASH=trash-put You'll need to install trash-put separately. "gio trash" might be a pre-installed alternative. I thought that's what I was using but apparently not.

Fixing Gnome's Gnonsense

Although I spent a long time not liking Gnome, I've come round to it, and think it's the only desktop environment (on any OS) I can confidently recommend (I have not tried them all) (I used to be able to recommend Unity). Specifically, I recommend Gnome with Ubuntu's defaults and some additional extensions to improve the experience. Extensions Hide Top Bar — Makes the top bar only visible in the window spread / app list view. This makes the desktop cleaner and it's nice having the top of a window at the top of a screen. I prefer this to moving the top bar to the bottom because the top bar can only appear on one screen and I want my screens to look the same. No Topleft Hot Corner — It's too easy to trigger this by accident. Better OSD & Transparent OSD — I use these to improve the appearance of the volume indicator. By default it's too big, too central, and too opaque. These extensions change all of that. Volume Mixer —This lets you independ...

Hiding non-hidden files in your file manager

Create a file called .hidden and fill it with a newline separated list of files. Works in Nautilus and Dolphin. Perfect for ~/snap.

Solution to Unity Desktop Fullscreen Graphical Glitch

You may find that your out of the box installation of Unity Desktop has the following glitch: Connect a second screen Fullscreen a window on one of those screens Do something on the other screen e.g. focusing or maximising a window The exact actions that cause an issue aren't very consistent. Solution: Install CompizConfig Utility → Workarounds Set "Force full screen redraws (buffer swap) on repaint" to true.

Custom Date Display in Unity Desktop (and probably some others)

I found that the date and time displayed by Unity Desktop can be customised. In dconf-editor (or in the terminal) com.indicator.datetime contains many options about date formatting. Set time-format to custom . This allows custom-time-format to be used for formatting. Set custom-time-format to a format string. When I discovered this was possible, it was difficult to find out the exact properties the format string could have. Not all of the placeholders are intuitive: `%w %d/%b/%Y %R`. It's easier to work it out with context from snippets online but I wanted a complete list of the options I had available. It turns out the C function called strftime is used, which means the syntax can easily be looked up on the internet or in the manpages. This reminded me of PHP's date format function , but it's different and not just the lack of percent signs.

En Dash with ComposeKey (Shift+AltGr)

AltGr is short for "alternative grammar". It doesn't do much on Windows, outside of adding acute accents to vowels and turning '4' into '€'. On Linux it does a much wider variety of things and more things still with 'AltGr+Shift', just give it a try. It's not just for foreign characters but also fractions and arrows. There is also a program called ComposeKey , which Ubuntu and probably many other distros, comes with automatically. If you type 'Shift+AltGr' the next few characters you type will be composed into  a character that sort of resembles that combination e.g. Shift+AltGr, s, s => ß  and Shift+AltGr, =, > => ⇒ . You can alter the config for combinations here:   /usr/share/X11/locale/en_US.UTF-8/Compose  (or similar). Although 3 hyphens does make an 'em dash', 2 hyphens doesn't make an 'en dash'. What I didn't realise until I looked in the config file was that you need 2 hyphens followed by...

Mass File Renaming

The rename command uses a regular expression to modify a list of files given to it. The regular expression is formatted like as with  sed  i.e. rename 's/find/replace/' file1 file2 file3 It's installed by default.

Internal Domain Names

You can edit /etc/hosts/  to add domain names and which IP addresses they refer to. Any IP address 127.0.0.0.1 through to  127.255.255.254 "loop back" to the machine itself. [x] Apache2 listens to anything coming to the machine itself regardless of IP Address, then the configs in /etc/apache2/sites-enabled  are used to decide what to do based on the domain name used. So any domains that loop back can be used to access separate internal sites by whatever name you like. /etc/hosts/ can only contain IP addresses that refer to the machine itself, so unfortunately you can't visit facebook.com via zuckerborg.land

'scp' Outside of Userspace

When performing for the first time a command such as scp ./src user@url:dir , one immediately learns that the directory after the colon is relative to "user's" home folder. So one assumes that if you write scp ./src user@url:/dir ,   the string "/dir" will be concatenated to "user's" home directory path and therefore still refer to the contents of the home directory. However this isn't the case; "/dir" will refer to "dir" at the file system's root. So scp can be used to modify any part of a file system so long as the permissions are right.

Rsync Remote Sync and Folder Merging

The 'r' in 'rsync' Stands for Remote I knew that you were able to sync folders such as with a USB but it I didn't realise that you can synchronise folders with a server, including those in your ~/.ssh/config . You just need to put a colon after the name so it knows it's not a directory. Good Defaults and a Million Options When I first used rsync I copied a very long command from Stack Overflow, having read what each argument was for and deciding well this is going to take ages to learn. I'll wait until I need this tool again so I don't forget. When I went to use it again, I had a look at the manpage. It turns out that -a (short for archive) does basically everything you need; it's short for -rlptgoD . I've seem some examples online that use those letters in combination with -a unnecessarily. This looks daunting but in fact only does the following: -r recursive -l copying symlinks as symlinks preserve file metadata: -p perm...