Sunday, January 24, 2021

Ubuntu 20.10

 

This is my personal Ubuntu 20.10 setup guide, it includes GNOME extensions that I like and minor tweaks. 

My list of GNOME extensions

One of the benefits of using the GNOME shell as the default graphical shell on Ubuntu, is that we now have the ability to use GNOME extensions, which can modify the behaviour of the GNOME shell - BUT be aware that the extensions are not developed by the official GNOME team, but by third party developers, which I have experience myself, can lead to a unbootable system. I have however found a list of extensions that both are compatible with the latest version of GNOME shell and they are quite useful.

But first, if you want to get GNOME extensions, then you have to install the following:
sudo apt install gnome-shell-extensions
and
sudo apt install chrome-gnome-shell
Now you are ready to install my recommended list of extensions: 


  • SomaFM internet radio
    • A small extensions that adds a SomaFM internet radio player in the top panel of the desktop, it includes the ability to select favorites.
    • First install these packages: 
      • sudo apt-get install python3-gi gstreamer1.0-tools gir1.2-gstreamer-1.0 gir1.2-gst-plugins-base-1.0 gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-fdkaac git 
    • Then use these commands:
      • git clone 'http://github.com/alireza6677/somafm-radio-gnome-ext'
      • cd somafm-radio-gnome-ext
      • cp -r 'SomaFm-Radio@alireza6677.gmail.com' ~/.local/share/gnome-shell/extensions/SomaFm-Radio@alireza6677.gmail.com
    • Then manually edit the "metadata.json"-file:
      • gnome-text-editor ~/.local/share/gnome-shell/extensions/SomaFm-Radio\@alireza6677.gmail.com/metadata.json
        • Add the proper shell-version (e.g. 44)
        • Save
    • Finally logout, use "alt+F2" and the r-command or reboot
    • Activate the extension on the extensions page for the SomaFM internet radio
    • Enjoy
  • Todo.txt
    • Create and manage a TODO list in the top panel
  • Remove Dropdown Arrows
    • It removes the dropdown arrows from apps that have that in the top panel.
  • Frippery Move Clock
    • It simply moves the clock/date/calendar to the right in the top panel. I have gotten used to have all of my apps to the right of the top panel.
  • Hide Activities Button
    • I hides the activities button. I find this button quite useless, as I hit the ‘super-key’ when I want to see my activities.
  • OpenWeather
    • A simple weather app embedded in the top panel, highly configurable.
  • Status Area Horizontal Spacing
    • There is a lot of horizontal spacing between the icons in the top panel, this extensions reduces the space between each app, which is neat.
  • TopIcons Plus
    • Used for displaying the icon of legacy apps in the top panel.
  • Show Desktop Button
    • Adds a show desktop button in the upper left corner of the screen.
  • Refresh Wifi Connections
    • Adds a WiFi refresh button to the manual network selection in the top panel.
  • ShellTile
    • A tiling window extension, which allows you to snap an application to quarters of screen, very handy if you are using applications which do not allow this behavior, such as Discord.
      • Minor tweak: Disable 'grouping edge tiling' of windows in settings
  • Pomodoro
    • A productivity tool for time-boxing yourself
    • First install these packages through the terminal (sudo dpkg -i gnome-shell-pomodoro[...]):
    • Install the following dependencies:
      • sudo apt-get install meson gettext valac pkg-config desktop-file-utils appstream-util libappstream-glib-dev libglib2.0-dev gsettings-desktop-schemas-dev gobject-introspection libgirepository1.0-dev libsqlite3-dev libgom-1.0-dev libgstreamer1.0-dev libgtk-3-dev libcanberra-dev libpeas-dev libjson-glib-dev gnome-shell-pomodoro
    • Then relog or reboot
    • Then go and enable the extension: Pomodoro

Minor tweaks

Gnome tweaks

Two things slightly annoy me about the default behavior of the dash to dock extension, the first being that when I re-select an item on the dock then the item doesn't minimize, which can by fixed through the terminal:
gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'
The other issue I have with the dock, is that I can't cycle through a list of opened items with my scroll-wheel, e.g. if I have opened multiple folders or browsers. This can also be fixed through the terminal:
gsettings set org.gnome.shell.extensions.dash-to-dock scroll-action 'cycle-windows'

Then I also like the following tweak, where I enable the weekdate in the desktop calendar:
gsettings set org.gnome.desktop.calendar show-weekdate true

Right-click create untitled document

I love to have the ability to right-click anywhere I like, and be able to create a new file. This behaviour was removed in Ubuntu 18.04. We can reenable this ability, by adding a new template, like this:
touch ~/Templates/"Untitled Document"

Legacy applications as startup applications

While I really enjoy the TopIcons Plus GNOME extension, there is seemingly a visibility issue when adding a legacy application to the list of startup application of the session (gnome-session-properties), this is due to the legacy applications starting before the GNOME extension, this can be fixed by adding a slight delay to the app in question, like this:
sh -c "sleep 10; exec clementine"
And if I want it to start the application to tray, then I will use:
sh -c "sleep 10; exec hexchat --minimize=2"
telegram-desktop -startintray

DVD codecs

First ensure that we have added the multiverse repository
sudo add-apt-repository multiverse
Then install the package
sudo apt-get install libdvd-pkg
Lastly reconfigure the package
sudo dpkg-reconfigure libdvd-pkg
Relog or reboot if it is not already working.

Handle lid switch

If you like me like to close your laptop lid, but do not want your machine to go into hibernation, then you will need to edit the following file: logind.conf
sudo gedit /etc/systemd/logind.conf
Change "#HandleLidSwitch=hibernate" (around line 24) to "HandleLidSwitch=ignore" and be sure to remove the hashtag: #
Save and lastly you need to reboot the systemd service:
systemctl restart systemd-logind.service

Firefox hardware acceleration

Firefox does not come with hardware acceleration enabled per default, so you might experience some screen tearing as I did. You can test if you have it or not, by watching this youtube video: https://www.youtube.com/watch?v=0RvIbVmCOxg

In order to fix this, you must enable hardware acceleration in the browser. Open a new window and type this in the addressbar:
about:config
Then search after this:
layers.acceleration.force-enabled
Change it from false to true. Close Firefox and start it again. You should now have eliminated your screen tearning. Feel free to watch the youtube video again.

SyncMaster913n

If you are using a old panel like me, then you might run into some issues, such as Ubuntu not correctly identifying your screens resolution (1024x768 vs 1280x1024) nor brightness (1 (too much) vs 0.85). We can fix our issues with xrandr.

Screen resolution fix
Firstly we need to identify our mode. Run the following command in the terminal:
cvt 1280 1024
Notice the Modeline, it should look something like this:
Modeline "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
Note: If you specify the refresh rate (_60.00), then you will run into a wall with multiple games. For example Minecraft will complain about "No OpenGL context found in the current thread" on Minecraft version 1.12.2 (openjdk version "1.8.0_x"). So remove that part.

Now create the mode without the refresh rate with xrandr (change the "mode" with the setting current for your screen, see the line above):
xrandr --newmode "1280x1024" 109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
Then add the mode with xrandr:
xrandr --addmode DVI-0 1280x1024"
Go to settings and check that you can change to your new resolution. If it works, then we want to automatically apply this change on boot. Open your gnome session properties by using the following command in the terminal:
gnome-session-properties
Then finally add a new item in the gnome session properties, give it a name of your choice (e.g. Resolution fix) and add the following code as the command (again remember to use your own mode):
/bin/bash -c "sleep 10 && xrandr --newmode "1280x1024_60.00" 109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync && xrandr --addmode DVI-0 1280x1024_60.00"
Note: We are letting our script sleep for 10 seconds, so our session is fully started before we apply our fix.

Brightness fix
Firstly, if you are using Night Light, then that will negate everything we are doing, so either go ahead and disable that or don't apply this fix. Run the following command in the terminal:
xrandr --output DVI-0 --brightness 0.85
If it works, then we are ready to add this on boot as well (a good test, is looking at a word document, page seperation). Open your gnome session properties by using the following command in the terminal:
gnome-session-properties
Then add a new item, give it a name of your choice (e.g. Brightness fix) and then add the following code as the command:
/bin/bash -c "xrandr --output DVI-0 --brightness 0.85"
Note: We are letting our script sleep for 15 seconds, so our session is fully started before we apply our fix. And in order to let the first xrandr command finish.