Step by Step Setup of Xubuntu 20.04 for General Development

Introduction

I decided to setup a clean work environment for my new project.
Here is basically what I did to setup my environment.

1. Install updates and basics

First thing is to do is always update the operating system.

sudo apt update
sudo apt upgrade

I always find that I need these programs installed.

sudo apt install build-essential wget curl ffmpeg p7zip-full p7zip-rar gnupg git rsync

2. Install Proprietary drivers OR NOT

I do not recommend installing proprietary drivers. If your system is working fine, don't bother installing these. It may cause it to be unstable.
If your system is already unstable, you have a specific need, or you are just excited to try the Nvidia or AMD drivers.

  1. Open up Software & Updates and then the Additional Drivers tab. (I use the Application Finder - hot key Windows-R and then search)
  2. If you have drivers available you can try to install them. Be prepared for instability.
  3. If you have no drivers available (like above), you will need to download directly from AMD or Nvidia.
    AMD 20.04 Drivers
    Nvidia Linux/Unix drivers

3. Install your favorite Browsers

I like to install all of the browsers. It is much easier to reproduce a bug on a website, if you have the same browser as the user.
Install only what you will actually use.

  1. Firefox - This is installed by default
  2. Chromium
    sudo apt install chromium-browser
  3. Google Chrome
  4. Microsoft Edge Insider
  5. Opera

4. Install VLC

VLC will take care of basically all your media setup requirements. DVD codecs, video playing, etc.

sudo apt install vlc

5. Install an image editor

  1. GIMP, it is installed by default.

  2. Pinta - My favorite editor. It is simple like MSPaint, but has many more features.

    Pinta is outdated when installed from the standard repository. But it can be installed from the Pinta PPA.

    sudo add-apt-repository ppa:pinta-maintainers/pinta-stable
    sudo apt update
    sudo apt install pinta

    If you have stability issues, you may want to update Mono and install mono-devel. This can be done from the Mono Project repository

    sudo apt install gnupg ca-certificates
    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
    echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
    sudo apt update
    sudo apt install mono-devel #Install development libraries
    sudo apt upgrade #Upgrade anything Mono related that is already installed
  3. Krita - It is designed for creating digital art.

    If I can do this, imagine what an artist could do!

    sudo apt install krita

6. General CLI tools setup

I tend to use the terminal a lot. These are the primary tools I use

  1. Screen - This is a very useful CLI tool. It allows both managing multiple terminals at once and prevents processes from being killed if you are using screen on a remote server.

    sudo apt install screen

    I recommend creating a .screenrc in your home directory. It is much easier to keep track of tabs this way.

hardstatus alwayslastline "%{b kw}%H %{r}%1` %{w}| %{g}%c %{w}| %{y}%Y.%m.%d %{w}| %{-b kw}%u %-Lw%{= rW}%50> %n%f %t %{-}%+Lw%<"
deflogin off
altscreen on
multiuser on
screen -t editor
screen -t bash

[Screen Hotkey Cheat Sheet](https://vhernando.github.io/gnu-screen-quick-guide-cheatsheet "Screen Cheat Sheet")

  1. VIM - My favorite editor on the terminal. If you aren't familiar with vim here is a helpful [VIM Cheat Sheet](https://vim.rtorr.com/ "VIM Cheat Sheet").

    sudo apt install vim

    At this step, you can also set your default editor to vim.

    git config --global core.editor "vim"
  2. FISH - My new default shell. It has better tab completion than bash and feels cleaner in general.

    sudo apt install fish
    chsh -s /usr/bin/fish
    # Log out and log in to complete the change.

    Set default editor in fish.

    echo "set -gx EDITOR vim" >>  ~/.config/fish/config.fish
    source ~/.config/fish/config.fish

7. SSH setup

If you are a developer, you probably use git. The ssh setup basically the same for GitLab, Github, bitbucket, etc...
[GitLab SSH key setup](https://docs.gitlab.com/ee/ssh/README.html#generating-a-new-ssh-key-pair "SSH key setup")

8. IDE setup

This is going to vary depending on the language you program in. [Visual Studio Code](https://code.visualstudio.com/docs/setup/linux "Visual Studio Code") is a good all around editor. [PyCharm](https://www.jetbrains.com/pycharm/download/#section=linux "PyCharm") is good for python. [Eclipse](https://www.eclipse.org/downloads/ "Eclipse") and [IntelliJ IDEA](https://www.jetbrains.com/idea/download/#section=linux "IntelliJ IDEA") are good for Java. I have yet to find a good free C/C++ IDE. So please leave a comment if you use one.

  1. Increase file watchers
    Regardless of IDE you will want to increase the number of files that can be watched by that IDE.
    Append this (or an appropriate number) to the end of /etc/sysctl.conf:

    fs.inotify.max_user_watches=524288

9. Python setup

My standard python3 setup uses pip and virtualenv.

sudo apt install python3-pip python3-virtualenv python3-dev

10. Java Setup

I still deal with a lot of Java 8 projects ("tsk tsk bad developer! Just update!"). So I install Java 8 and the latest version.
Pick what versions you need to get your job done.

sudo apt install openjdk-8-jdk
sudo apt install openjdk-14-jdk

If you install multiple Java versions, use update-alternatives to set your default java and javac.

sudo update-alternatives --config java
sudo update-alternatives --config javac

11. Browser Tuning

There are a lot of options for each browser. This will be rapid fire.

  1. Password manager - LastPass is very popular, but I recommend doing research to find the most trustworthy and secure.
  2. Adblocker - The standards are uBlock Origin and Adblock Plus.
  3. Search Engine - Set your default search engine.
  4. History/Cookie Policy - Set how long you want cookies and cache to stay around.
  5. Browser Syncing - Set Firefox, Chrome, etc to sync without other installs of those browsers.
  6. Set languages - I prefer to read pages in their native language (if I speak it). Set this to stop automatic translations.

12.Setup a backup system

Whether you backup to the cloud or to an external drive, you need to set it up.
My typical method is to use rsync to copy important directories to a second computer.
Use whatever works for you.

13. Disable unneeded audio devices

Nothing is more annoying then to join a conference call and discover your audio is set to use your hdmi port instead of your microphone.

  1. Launch the PulseAudio Volume Control app.
  2. Select your default input and output devices. Click the checkmark next to your desired default device.
  3. Disable unwanted audio devices in the Configuration tab

14. Install your collaboration software.

It seems like each person I need to speak with uses a different tool. Here is the list I have had to use at one point or another.

  1. Microsoft Teams
  2. Discord
  3. Skype
  4. Zoom
  5. Google Hangouts (Only useable in browser on Linux)

15. Setup Printers

This will either be extremely easy to do or extremely difficult. This is definitely an exercise for the reader...

Conclusion

Setting up a development computer is unique for each programmer, especially in the Linux world. Do whatever works for you.

Reboot of Mathan Games and a New Project

Since, I accidentally hit the irreversible "Make Live" button, I better put an entry out. Never know, somebody might stumble onto it.

I am officially resurrecting this dead blog.
"IT'S ALIVE!!!"
<insert Frankenstien GIF that I do not have a license for>

I have begun work on a new project. More to come in the future. For now, you can read the rough draft requirements page.

Future posts on this site will be almost exclusively about computer game development and problems solved during development.
I will probably throw in a few articles here and there about configuring systems, too. I actually have one written about setting up Xubuntu 20.04 for development. Just need to proofread it, should be out in a day or two.

I will probably enable comments in a day or two as well. I still need to configure the spam filters. So, if you are the 1 person that stumbled onto this URL and you really wanted to comment... Sorry?

Error: Screen cannot be larger than …

The Problem:
If you are reading this blog post, it is probably because you are getting one of the below errors when you setup dual monitors or increase your screen resolution.

xrandr: screen cannot be larger than 1920x1920 (desired size 3840x1080)

Check what your maximum screen resolution is. In your terminal execute, "xrandr". This should display text similar to:

james@linux001:~$ xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 1920 x 1920
DFP1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 474mm x 296mm
   1920x1080      61.1*+
   1776x1000      60.0 +
   1680x1050      61.0 +   60.0 
[continues with more monitor stuff]
What is highlighted is the maximum size of your "virtual screen". This is the maximum size that all monitors combined cannot exceed. Meaning if you want dual 1920x1080 monitors to display side by side, you will need a virtual screen size of 3840x1080.

To increase the maximum virtual screen size, we will need to modify xorg.conf. If you are using Xubuntu, you can find xorg.conf in /etc/X11/xorg.conf

The Fix:
1.  Backup your xorg.conf. To make a copy of the file, in the terminal execute:

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.confbackup

If you break X windows and you are using Ubuntu variants, you can press CTRL-ALT-F2 to get to a terminal. Press CTRL-ALT-F7 to return to your default terminal. To restore your backup execute:

sudo cp /etc/X11/xorg.confbackup /etc/X11/xorg.conf

2.  Open xorg.conf.  You can use whatever text editor you want.

sudo leafpad /etc/X11/xorg.conf

My xorg.conf looked like this:

Section "Screen"
    Identifier  "Default Screen"
    DefaultDepth    24
EndSection

Section "Module"
    Load    "glx"
EndSection

3.  Add the following to 'Section "Screen"':

SubSection "Display"
    Virtual 3840 1920
EndSubSection

The 'Virtual 3840 1920' is the critical part. Set the 3840 1920 to whatever max resolution you need.

My final xorg.conf looked like this:

Section "Screen"
    Identifier  "Default Screen"
    DefaultDepth    24
    SubSection "Display"
        Virtual 3840 1920
    EndSubSection
EndSection

Section "Module"
    Load    "glx"
EndSection

4.  Restart X windows i.e. reboot your computer.  If you computer comes back completely hosed and has no graphics. Restore that backup we made.

If you run execute "xrandr" now it should show the new screen maximum.

Conclusion:
Remember to clean up your backups after you are sure that your system is stable.

For further explanation of virtual screens visit this site. They explain it fairly well.
For those who prefer to read the manual, this is some nice bedtime reading.

Did this post help you? Is this post no longer accurate or just wrong? Please comment.

Creating a Shortcut to Take Regional Screen Shots in Xubuntu

Xubuntu has several standard keyboard shortcuts to take screen shots:

  • Print-Screen → Captures entire screen
  • ALT + Print-Screen → Captures current window

However it is missing a shortcut that lets the user use the mouse to select capture regions.
Well, here is how to set it up.

  1. Open the Application menu → Settings → Settings Manager
  2. Open Keyboard → Application Shortcuts
  3. Click Add
  4. Type xfce4-screenshooter -r as the command
  5. Click OK
  6. It will now prompt for the key combination. I used SHIFT + Print-Screen.

Press SHIFT + Print-Screen and select the area you wish to capture.

You can setup any shortcut you want this. I like to set CTRL + Print-Screen as window capture with mouse. To do this use xfce4-screenshooter -w -m as the command.