Blog-Archiv

Samstag, 29. April 2023

Screenshots with Ubuntu on Wayland and Xorg

On my Ubuntu LINUX, I used Shutter as screenshot tool, but this did not work any more some years ago, so I changed to Ksnip.

After upgrading to Ubuntu 22.04, Ksnip behaved completely different. I couldn't mouse-select an area of the srceen any more, I had to take a shot of the whole desktop, then click "Options" and switch to selecting an area, then again take a shot where I could select the area.

As I couldn't take a screenshot of popup-menus that way, I decided to look for another screenshot tool. It turned out that Shutter is back, and as I was quite satisfied with it before, I installed it again.

But it turned out that Shutter behaved the same way as Ksnip. I couldn't mouse-select an area of the screen, the actions "Selection" and "Window" were disabled. Again I had to take a shot of the whole desktop, then click "Options", choose "Selection" and again take a shot.

What is going on?

As always, the way to a solution was found on stackoverflow. You have to switch back from new Wayland display server to old Xorg server, because Wayland not yet supports screen recorders sufficiently.

Switch to Xorg Display Server

  • Terminate all applications and log out.

  • When the login screen is presented to you, enter your user name and password, but do not press ENTER to log in yet.

  • Look for the gear ⚙ icon button on bottom right. If you click on it, a menu will pop up that lets you choose between "Ubuntu" (this is Wayland) and "Ubuntu on Xorg", and maybe some more display servers like "Unity" or "GNOME".

  • Select "Ubuntu on Xorg", then log in.

If you run Shutter now, you will see that the "Selection" button is enabled now.

You don't need to change to "Ubuntu on Xorg" any time you log in. Changing it once will make Ubuntu remember your decision. Only to change back to Wayland you will need the login-screen again.

Find Out Which Display Server Runs

On a Terminal command line you can enter

$ echo $XDG_SESSION_TYPE
x11

x11 denotes the Xorg server.

In UI you can see the type of display server in Ubuntu top right taskbar menu

  • "Settings" - "About" - "Windowing System"

I can't recommend any display server, but it looks like several applications do not run correctly under Wayland. What I can confirm is that mouse-dragging Firefox tabs to another screen works much better with Xorg than with Wayland, where I always needed several attempts to get the tab to the second screen.




Freitag, 28. April 2023

Ubuntu Firefox Won't Play Sounds

I use Ubuntu 22.04 and Firefox on my laptop, because I am convinced of the open-source-software idea.
Today, suddenly Firefox did not play sounds any more. Previous video worked fine, next was silent. Tried other videos, all were silent. Rebooted the machine, started Firefox, played a video - no sound.

First I checked the Ubuntu volume control, which is on upper right corner of the task bar. It was not muted.

Next I checked my computer's audio hardware via Ubuntu menu "Settings" (right upper side of primary screen). When you go there and click "Sound", there is a section "Output" on the right side where you have a "Test" button. If you click that, a dialog comes up that lets you test any speaker of your hardware. Both built-in speakers of my laptop worked fine! Besides, there is also a volume control in the "Sound" settings, but this wasn't muted.

Then I started another browser, which was Chrome. For many problems it is useful to have more than one browser installed. I pasted the video URL from Firefox into its address line, and - there was sound!

So what makes Firefox be silent from one moment to the next? What I didn't know is that you can switch off video and/or audio, for all websites, in Firefox's "Settings". I followed the instructions of a mozilla page about this.

Toggle Video and Audio in Firefox

  • Click the Firefox menu button (top right) and select "Settings".

  • Enter "autoplay" in the "Find in Settings" text field, or select "Privacy & Security" and scroll down to the "Permissions" section.

  • In the "Autoplay" line, click the right side "Settings..." button, a dialog comes up.

  • Use the "Default for all websites" drop-down menu to select how you want Firefox to handle audio and video. Below the drop-down is a list where you can do that for specific websites.

  • In the drop-down, select "Allow Audio and Video", then click the "Save Changes" button.

It turned out that "Block Audio" was selected in my Firefox. How can this happen? Maybe some keyboard shortcut that I triggered accidentally? I selected "Allow Audio and Video" as default, clicked the "Save Changes" button, and - sound was back again in Firefox!