SIDEBAR
»
S
I
D
E
B
A
R
«
GNOME Shell: convenient audio output chooser
Aug 28th, 2023 by miki

GNOME has a long standing UX issue regarding choosing the audio output device when multiple audio devices (usually PulseAudio ALSA sinks) are available. In the default GNOME desktop (until v43) the user needs to navigate all the way to Settings->Sound and fiddle with drop-down dialogues to make this choice.

Some options to make this more convenient are available.

1) On GNOME 43+: Use Quick Settings

GNOME 43 adds a new Quick Settings feature which allows, amongst others, the audio device to be chosen directly from the “top bar”‘s “system menu” UI in the upper right corner.

The exact appearance and features exposed in the Quick Settings can be modified by installing the “Quick Setting Tweaker” GNOME Shell extension (GPL-3.0/MIT license).

GNOME 43 is present in Debian based distributions since Debian 12 (bookwoorm, 2023-07) & Ubuntu 23.04 (lunar). Note that after v3.38 a new GNOME versioning scheme was introduced meaning that the following release became v40.

2) Pre GNOME 43: Use GNOME Shell extensions

Option #1: Volume Mixer (I prefer UI of this)

The Volume Mixer GNOME Shell extension (GPL-2.0 license) makes the sound output selection available from the top bar’s system menu in a nice an uncluttered way, hiding unnecessary distractions (fx. no input selection when no application is recording).

Volume Mixer when choosing output device

Option #2: Sound Input & Output Device Chooser

Similarly the Sound Input & Output Device Chooser GNOME Shell extension (GPL-3.0 license) also makes the selection available in the system menu. However, the UI is slightly more convoluted with the width of the dialogue expanding dynamically making the UX a bit unintuitive and jumpy.

Sound Input & Output Device Chooser when choosing output device (input device selection visible below)

3) Non-GNOME: Use Ubuntu AppIndicator

If you use multiple desktops or just prefer a non-GNOME specific solution another way is to install the Ubuntu AppIndicator compatible “Sound Switcher Indicator” (GPL-3.0 license) in combination with the GNOME Shell extension “AppIndicator and KStatusNotifierItem Support” (GPL-2.0 license), which will make Ubuntu AppIndicators appear as tray icons in the GNOME top bar.

The support and non-support of tray icons, requiring the use of extensions like the above, has been a long standing discussion in the GNOME community since the GNOME3 redesign work decided that no existing systray/indicator/status icon protocol was adequate for the GNOME UI requirement.

Curiously the Ubuntu AppIndicator standard is a remnant of Canonical’s attempted desktop/mobile convergence environment Ubuntu Unity (distributed in parallel on mobile OS Ubuntu Touch and standard Ubuntu desksop). This has now been abandoned by Canonical/Ubuntu but still lives somewhat on in the community; see ubuntu-touch.io & ubuntuunity.org.

EDIT 2023-09-20: add screenshots minor text corrections

Ubuntu 18.04 Tweaks for a 16.04 User
Jun 24th, 2019 by miki

This post will detail some stuff I’ve done to a plain Ubuntu 18.04 Desktop (bionic) to make me feel a little more at home in the transition from my daily driver for years the 16.04 release using Canoncial’s Unity as the primary desktop interface to the GNOME Shell of 18.04. Canonical abandoned the former after shifting focus from the convergence and personal device market to cloud and IoT in 2017 leaving development of its mobile OS, Ubuntu Touch which Unity is a part of, to the community formed UBports project (Unity8 is now known as Lomiri). I’ve been putting off this transition exactly because I knew it would require me to make some tweaks to my daily routines, but this system is not one I use on a daily basis so it will make the transition a gentle ride.

The intention is to update this as the experience progresses.

EDIT 2021-08-25: clean up and publish dormant draft post

Browsing GNOME Extensions

To be able to install GNOME Extensions directly from a browser while perusing the directory at extensions.gnome.org, add the GNOME Shell Integration extension/add-on to your browser (Firefox add-on, Chrome Web Store), then install the Integration extension in GNOME to communicate with the browser extension:

sudo apt install chrome-gnome-shell

After this you can go to extensions.gnome.org/local/ to see, configure and update installed extensions.

Useful GNOME Extensions

Time Keeping

World/Alarm/Stopwatch/Timer application

GNOME includes a nice Clock application which is available in the package repository but not installed by default;

sudo apt install gnome-clocks

Installing the Alarm Clock extension described above, will also show the application’s alarms in the notification area.

Notification bar

I like both the date and seconds to be displayed in the head of the desktop, so to format the text a couple of extensions are available;

Automating wav to ogg conversion
Jun 6th, 2019 by miki

EDIT 2021-07-11: the script described below has been added to the author’s hometools repository on sourcehut.org

Needed some space on the disk.

Had some music, some of it were wav files.

Threw together this script to transmogify it into ogg using ffmpeg.

Statistics say that 24 wav files occupying 1,7 GiB was made into 24 ogg files occupying 105 MiB, a reduction to ~6% (du -h calculates 2^10 numbers but uses SI 10^3 prefixes..).

miki@filly:~/Music$ find . -iname "*.wav" -print0 | sed s/.wav/.ogg/g |du --files0-from=- -h -c|tail -1
105M	total
miki@filly:~/Music$ find . -iname "*.wav" -print0 | sed s/.wav/.wav/g |du --files0-from=- -h -c|tail -1
1,7G total
miki@filly:~/Music$ find . -iname "*.wav" -print0 | sed s/.wav/.ogg/g |du --files0-from=- -h |wc -l
24
miki@filly:~/Music$

Script

Install prerequisite ffmpeg and ffprobe utilities on apt distributions by doing “apt install ffmpeg”.

BEWARE: script deletes any wav files in current directory and below without warning if conversion to ogg is fine according to ffmpeg return code and stdout/err.

Manual confirmation of all deletions can be enabled by uncommenting line 8 (CONFIRM=..).

It could (very) easily be amended for conversion between any container or compression format supported by ffmpeg by replacing “wav” and “ogg” in glob pattern and OGG variable definition (for completeness also in echo output…).

miki@filly:~/wavtest$ cat ~/hometools/wav2ogg.sh
#! /bin/bash
#
# Make .ogg out of all .wav in cwd and below, remove .wav!
#
# When converting remove only if conversion is ok.
# ffprobe any present .ogg and check if playtime is same as wav, remove only if all is good.

#CONFIRM=-i # confirm deletion?

REQS="ffmpeg ffprobe"
which $REQS  >/dev/null
if [ ! $? -eq 0 ]; then
    echo We need $REQS to do stuff!
    exit 1
fi

shopt -s globstar nullglob nocaseglob # enable 2-star magic
for f in **/*.wav; do
    OGG=$(dirname "$f")/$(basename "$f" wav)ogg
    echo -n "$f: "
    if [ ! -f "$OGG" ]; then
        echo -en "\e[33mno ogg\e[0m"
        CONVERT=1
    else
        echo -en "\e[32malready there\e[0m"
        if [ ! "$(ffprobe "$f" 2>&1|grep Duration|cut -d, -f1)" = "$(ffprobe "$OGG" 2>&1|grep Duration|cut -d, -f1)" ]; then
            echo -en " - \e[31mogg corrupt\e[0m"
            CONVERT=1
            rm $CONFIRM "$OGG"
        else
            OGGOK=1
        fi
    fi
    if [ $CONVERT ]; then
        echo -en " - \e[33mconverting\e[0m"
        OUT=$(ffmpeg -loglevel error -i "$f" "$OGG" 2>&1)
        if [ ! $? -eq 0 ]; then
            echo -e " \e[31mfatal error!\e[0m\nffmpeg output was:\n\n$OUT\n"
            rm $CONFIRM "$OGG"
        elif [ ! -z "$OUT" ]; then
            echo -e " \e[31mnon-fatal error!\e[0m\nffmpeg output was:\n\n$OUT\n"
        else
            OGGOK=1
        fi
    fi
    if [ $OGGOK ]; then
        echo -e " - all good removing wav"
        rm $CONFIRM "$f"
    fi
done
miki@filly:~/wavtest$ 

Usage and Output

Before

miki@filly:~/wavtest$ ls -lR
.:
total 59964
drwxrwxr-x 3 miki miki     4096 Jun  6 22:33 one
-rw-rw-r-- 1 miki miki 61390864 Jun  6 22:32 Sordid Affair (Man Without Country Version).wav

./one:
total 30720
drwxrwxr-x 3 miki miki     4096 Jun  6 22:34 two
-rw-rw-r-- 1 miki miki 31451304 Jun  6 22:30 Vision Man MASTER.wav

./one/two:
total 55352
-rw-rw-r-- 1 miki miki 56675660 Jun  6 22:34 Bye Barat - Going For Broke (UNKWON´s Autumn Remix) LIM_02.wav
drwxrwxr-x 2 miki miki     4096 Jun  6 22:34 three

./one/two/three:
total 375112
-rw-rw-r-- 1 miki miki 384108056 Jun  6 22:30 Rigoremix - Pornographe - Final2.wav
miki@filly:~/wavtest$ du -hs .
509M	.
miki@filly:~/wavtest$

During

In real life, also in technicolor!

miki@filly:~/wavtest$ ~/hometools/wav2ogg.sh 
one/two/Bye Barat - Going For Broke (UNKWON´s Autumn Remix) LIM_02.wav: no ogg - converting - all good removing wav
one/two/three/Rigoremix - Pornographe - Final2.wav: no ogg - converting - all good removing wav
one/Vision Man MASTER.wav: no ogg - converting - all good removing wav
Sordid Affair (Man Without Country Version).wav: no ogg - converting - all good removing wav
miki@filly:~/wavtest$

After

miki@filly:~/wavtest$ ls -lR
.:
total 4952
drwxrwxr-x 3 miki miki    4096 Jun  6 22:35 one
-rw-rw-r-- 1 miki miki 5066460 Jun  6 22:35 Sordid Affair (Man Without Country Version).ogg

./one:
total 2528
drwxrwxr-x 3 miki miki    4096 Jun  6 22:34 two
-rw-rw-r-- 1 miki miki 2580752 Jun  6 22:35 Vision Man MASTER.ogg

./one/two:
total 4680
-rw-rw-r-- 1 miki miki 4785594 Jun  6 22:34 Bye Barat - Going For Broke (UNKWON´s Autumn Remix) LIM_02.ogg
drwxrwxr-x 2 miki miki    4096 Jun  6 22:35 three

./one/two/three:
total 19456
-rw-rw-r-- 1 miki miki 19922936 Jun  6 22:35 Rigoremix - Pornographe - Final2.ogg
miki@filly:~/wavtest$ du -hs .
31M .
miki@filly:~/wavtest$

Metadata

ffmpeg does some nice metadata conversions out of the box;

miki@filly:~/Music$ ffprobe ~/"wavbak/Delayscape  A Short While Rigolin Edit Audaccity.wav" 2>&1| grep Input -A 1000
Input #0, wav, from '/home/miki/wavbak/Delayscape  A Short While Rigolin Edit Audaccity.wav':
  Metadata:
    title           : Delayscape - A Short While (Rigolin Edit)
    artist          : rigolin
    comment         : Love Melody
    date            : 2018
  Duration: 00:06:33.97, bitrate: 3072 kb/s
    Stream #0:0: Audio: pcm_f32le ([3][0][0][0] / 0x0003), 48000 Hz, 2 channels, flt, 3072 kb/s
miki@filly:~/Music$ ffprobe "./Delayscape - Heinz Beauvaix/Soundcloud/Delayscape  A Short While Rigolin Edit Audaccity.ogg" 2>&1| grep Input -A 1000
Input #0, ogg, from './Delayscape - Heinz Beauvaix/Soundcloud/Delayscape  A Short While Rigolin Edit Audaccity.ogg':
  Duration: 00:06:33.97, start: 0.000000, bitrate: 99 kb/s
    Stream #0:0: Audio: vorbis, 48000 Hz, stereo, fltp, 112 kb/s
    Metadata:
      ENCODER         : Lavc56.60.100 libvorbis
      TITLE           : Delayscape - A Short While (Rigolin Edit)
      ARTIST          : rigolin
      comment         : Love Melody
      DATE            : 2018
miki@filly:~/Music$

Source Material

»  Substance:WordPress   »  Style:Ahren Ahimsa
© 2023 Mikkel Kirkgaard Nielsen, contents CC BY-SA 4.0