Bad Bluetooth Audio on Ubuntu

Every now and again I’d connect my Soundcore Q30 bluetooth headphones to my ubuntu laptop and they would sound like garbage. I finally decided to look up what the deal was and found this.

The solution that worked is to edit /etc/bluetooth/main.conf

sudo nano /etc/bluetooth/main.conf

In that file, copy and paste this right under the [General] heading

# Automatically connect both A2DP and HFP/HSP profiles for incoming
# connections. Some headsets that support both profiles will only connect the
# other one automatically so the default setting of true is usually a good
# idea.
AutoConnect=true

Then search in that file for MultiProfile and change it from off to multiple

MultiProfile = multiple

Then restart the bluetooth service by running

sudo systemctl restart bluetooth 

I reconnected my headphones and they sound great!

Manjaro + Barrier/Snap Fontconfig Issue

I was unable to start barrier after an update. The GUI would crash immediately. I tried running it in a terminal ( by running the command barrier directly) and got the error:

▶ barrier               
Fontconfig warning: FcPattern object weight does not accept value [0 205)
[1]    8790 segmentation fault (core dumped)  barrier

Some googling led me to this fix:

sudo rm /var/cache/fontconfig/*
rm ~/.cache/fontconfig/*
fc-cache -r

After those three commands, I was able to launch barrier without issue.

KDE with Progressive Web Apps (PWAs)

After installing progressive web apps on KDE, the icons don’t appear correctly in the task bar, like this:

That second app is Google Messages. This gets confusing, especially if you have applications grouped (which is the default option in Manjaro KDE). The fix is pretty simple and the solution is completely from here. I’m documenting it here, just in case.

First, you need xdotool. This can be installed in Manjaro like this

sudo pacman -S xdotool

Next you need to browse to ~/.local/share/applications/

It’s pretty easy to tell which desktop file is which, thanks to them having the appropriate icon.

Last step is to edit the Exec= line of the desktop file by appending this text:

; xdotool search --sync --classname <value> set_window --class <value>

Make sure to replace <value> with the value in the StartupWMClass line. It should look like this when you are done:

Save the file, kill the app, and restart it. It may take a second or two, but it should do the trick.

EDIT

If you are using brave, the path has changed from /usr/lib/brave/brave to /usr/lib/brave-browser/brave

Edit 2

I switched from && xdotool to ; xdotool

They both should work, but a semicolon should guarantee it runs.

Framework Laptop + Ubuntu 21.04 + Multi-touch

I got my framework laptop today. I had intended to put Manjaro/KDE on it, but ended up with stock Ubuntu 21.04 (a story for another time). The trackpad is big and pretty nice, so setting up 3 finger swipe was an initial priority.

I didn’t have to do anything special to get the trackpad working. There were reports on reddit of it not working out of the box on certain distros. It’s a bit odd about how far you have to click to the right and to the left to get the respective clicks, but nothing too terrible.

For 3 finger swipes i went with Comfortable Swipe. The instructions are each to followo, but after giving permissions I had to do a full reboot. They claimed a log out would be sufficient, but was not for me. In any case, it works great.

— UPDATE —

For Manjaro/KDE I went with fusuma. The steps to install were roughly:

sudo pacman -S libinput
sudo pacman -S ruby
sudo gem install fusuma --no-user-install
sudo pacman -S xdotool

I ran this from the home directory to set it up to run on login (requires logout):

printf "$(which fusuma) & disown \n" >> .profile  #.zprofile if using zsh

Right now my config has some things that don’t exist, but it got me the thing I wanted (moving workspaces with 3 fingers and moving windows with 4 fingers). I had to set a few of the shortcuts in System Settings > Shortcuts > KWIN

~/.config/fusuma/config.yml

swipe:
  3:
    left:
      command: "xdotool key ctrl+alt+Right" # History forward
    right:
      command: "xdotool key ctrl+alt+Left" # History back
    up:
      command: "xdotool key ctrl+alt+Up" # Activity
    down:
      command: "xdotool key ctrl+alt+Down" # Activity
  4:
    left:
      command: "xdotool key ctrl+alt+Down" # Switch to next workspace
    right:
      command: "xdotool key ctrl+alt+Up" # Switch to previous workspace
    up:
      command: "xdotool key ctrl+alt+shift+Up" # Switch to next workspace
    down:
      command: "xdotool key ctrl+alt+shift+Down" # Switch to previous workspace
pinch:
  in:
    command: "xdotool keydown ctrl click 4 keyup ctrl" # Zoom in
  out:
    command: "xdotool keydown ctrl click 5 keyup ctrl" # Zoom out

XPS 13 9300 – Switching to Linux

First thing is to go into bios (Hit F2 early in the boot). In “System Configuration” change SATA Operation to AHCI.

Nothing special about the install. Throw Ubuntu on a thumb drive, throw it in, install it.

After install:

sudo sh -c 'cat > /etc/apt/sources.list.d/focal-dell.list << EOF
deb http://dell.archive.canonical.com/updates/ focal-dell public
# deb-src http://dell.archive.canonical.com/updates/ focal-dell public

deb http://dell.archive.canonical.com/updates/ focal-oem public
# deb-src http://dell.archive.canonical.com/updates/ focal-oem public

deb http://dell.archive.canonical.com/updates/ focal-somerville public
# deb-src http://dell.archive.canonical.com/updates/ focal-somerville public

deb http://dell.archive.canonical.com/updates/ focal-somerville-melisa public
# deb-src http://dell.archive.canonical.com/updates focal-somerville-melisa public
EOF'
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F9FDA6BED73CDC22
sudo apt update -qq

sudo apt install oem-somerville-melisa-meta libfprint-2-tod1-goodix oem-somerville-meta tlp-config -y

sudo add-apt-repository ppa:boltgolt/howdy -y
sudo apt update -qq
sudo apt install howdy -y

MS Teams on Ubuntu 20.04

I ran into a problem where Teams was stuck loading. On the few times I could get it to load, it would display an error page telling me to “Try Again” and to try “signing out”, neither of the links would do anything.

I was able to fix it by running:

pkill teams && rm -rf ~/.config/Microsoft/Microsoft\ Teams/Application\ Cache/Cache/* 

Teams is kind of a disappointment on Linux. I have to use it, so hopefully that helps someone ( or me again in the future).

Manjaro Network Connection Woes (Kernel v5)

After I updated my desktop to Linux kernel version 5 when I logging in my network would disconnect/reconnect every 15 seconds or so. I wasn’t able to get on the internet. My ethernet cable was plugged directly into my motherboard and I don’t have wifi capabilities.

The Solution

I added this conf:

/etc/NetworkManager/conf.d/default-wifi-powersave-on.conf

With this content:

[connection]
wifi.powersave=0

After a reboot all was well.

Synergy Stop Job Problem

On Linux I was plagued with a stop job on synergy.service for 90 seconds on every reboot/shutdown. To make it stop faster do this:

sudo systemctl edit --full synergy.service

Then add this line under [Service]

TimeoutSec=6

Manjaro + Dotnet Core + Rider

I had a bit of trouble getting Rider set up initially to handle my dotnet core projects on Manjaro. Rider wouldn’t open the projects complaining about not being able to find SDKs like razor and web. My first stop was Settings->Build, Execution, Deployment->Toolset and Build. I messed around with those settings to no avail.

Here’s what did work. I added this to ~/.bashrc:

export MSBuildSDKsPath=/opt/dotnet/sdk/$(dotnet --version)/Sdks

I ended up with these settings in Rider:

Pointing to the MSBuild.dll within my dotnet installation seemed to be the kicker, over the one that came with mono. But I also changed my dotnet core executable path to /opt/dotnet/dotnet from /usr/bin/dotnet at the same time. Once I got it working, I didn’t want to mess with it anymore, so here it sits.

Conky

A reddit post clued me in to Conky, a system monitor that grafts on to your background wallpaper. I played around with a configuration, and I have something that I’m pretty happy with.

To install:

sudo apt-get install conky-all

Here’s my config. You can place this in the file ~/.conkyrc (you’ll have to create it).

use_xft yes
xftfont 123:size=8
xftalpha 0.1
update_interval 1
total_run_times 0

own_window yes
own_window_type conky
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_colour 000000
own_window_argb_visual yes
own_window_argb_value 0
own_window_class override

double_buffer yes
#minimum_size 250 5
#maximum_width 500
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color ffffff
default_shade_color red
default_outline_color green
alignment top_right
gap_x 0
gap_y 0
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale no
use_spacer no


minimum_size 0 0
TEXT
${voffset 1}${offset 12}${font Ubuntu:size=10}${color FF00AA}HD ${offset 9}$color${fs_used /} / ${fs_size /}${offset 30}${color FF00AA}RAM ${offset 9}$color$mem / $memmax${offset 30}${color FF00AA}CPU ${offset 9}$color${cpu cpu0}%

or for lighter backgrounds:

use_xft yes
xftfont 123:size=8
xftalpha 0.1
update_interval 1
total_run_times 0

own_window yes
own_window_type conky
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_colour 000000
own_window_argb_visual yes
own_window_argb_value 0
own_window_class override

double_buffer yes
#minimum_size 250 5
#maximum_width 500
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color 666666
default_shade_color red
default_outline_color green
alignment top_right
gap_x 0
gap_y 0
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale no
use_spacer no


minimum_size 0 0
TEXT
${voffset 1}${offset 12}${font Ubuntu:size=10}${color FF00AA}HD ${offset 9}$color${fs_used /} / ${fs_size /}${offset 30}${color FF00AA}RAM ${offset 9}$color$mem / $memmax${offset 30}${color FF00AA}CPU ${offset 9}$color${cpu cpu0}%