Battery State - Waiting to charge https://askubuntu.com/questions/1560537/battery-state-waiting-to-charge

I recently installed Ubuntu 25.10 on a Lenovo X1 Yoga (4th gen) I got on eBay. It has been working very well lately, however a question about battery charging behavior has popped up.

This morning, I plugged my charger into the laptop (it is a USB-C connection) this morning and noticed that while the amber LED was lit indicating that the laptop recognizes that the AC is connected, Ubuntu does not show that the battery is charging. A quick look into battery statistics shows battery in state of "Waiting to charge"

battery statistics

I read a post elsewhere on this forum from 5 years ago suggesting that this is normal behavior, but it was not marked as solved, so I just want to confirm, is this expected behavior? I assume that once the battery discharges to a certain percentage, the battery will be allowed to charge.

It occurs to me that this this first time I plugged it in without it being below 20% or so, so this may very well be the case. I just wanted confirm before I unplug it and allow it to discharge. Right now it is holding 78% while plugged in.

Need a working Link to download Ubuntu 22.04 LTS for ARM Lenovo laptop? https://askubuntu.com/questions/1560535/need-a-working-link-to-download-ubuntu-22-04-lts-for-arm-lenovo-laptop

Brave AI gives link: https://cdimage.ubuntu.com/releases/22.04/release/ubuntu-22.04-desktop-arm64.iso, it only give NOT FOUND, tried many mirrored site, same, NOT FOUND.Tried with private window, clearing cache etc, always NOT FOUND.

Want to only use a virtual machine in Ubuntu for my arm laptop because windows 11 arm does not have any working virtual machine app for ARM.

I do have a dual boot Lenovo AMD laptop that MUMU Player works well in windows 11. I need and want my other Traveling Lenovo ARM snapdragon laptop windows 11 to have working virtual machine for ARM, want to setup dual boot. That is why I need to download ubuntu 22.04 LTS ARM for only android apps.

I tried ubuntu 24.04 LTS 3 clean installs with ubuntu updates but bottom line, Waydroid not binding correctly, AI said 22.04 will bind, but problems with 24.04 binding.

Please post a WORKING LINK for desktop ubuntu 22.04 LTS ARM laptop, not server. I then should be all set.

thanks

Firefox pops up and opens links from other apps but doesn't get typing focus https://askubuntu.com/questions/1560534/firefox-pops-up-and-opens-links-from-other-apps-but-doesnt-get-typing-focus

Firefox is my default browser. If I click on a link in an app like GNOME Terminal, the link opens in a new tab in an existing Firefox window, and the window comes to the front (in front of / on top of all other windows). But the typing focus remains in the (now underneath) terminal window! Is there any way to prevent or tweak this behavior? I'd like one of these (preference for #2):

  1. Click link in terminal, Firefox doesn't come to the front so it's obvious I'm still in the terminal. Typing focus remains in the terminal.

  2. Click link in terminal, Firefox comes to the front, typing focus shifts to Firefox.

Other notes/thoughts:

  • I'm using 64-bit Ubuntu 24.04.3 LTS desktop with the default window manager (wayland + mutter, I guess?). Firefox is from a snap and is at version 145.0.2.

  • My original "new tab" scenario/repro requires that Firefox is already open. If clicking a link starts Firefox, or if I run firefox --new-window https://example.com in the terminal, that new Firefox window does get typing focus after appearing (in front of all other windows).

  • If I make Chromium the default browser, it does get typing focus when it opens a link from the terminal, either when it does so in a new tab or new window.

  • Maybe this has something to do with focus stealing prevention?

snapd auth expired? https://askubuntu.com/questions/1560533/snapd-auth-expired

For a few weeks I have been getting timeouts when trying to update snaps from snapcraft.io. So I have been googling, and one of the fixes was to remove all snaps, remove snapd, then reinstall snapd and the various snaps. I am in the process of trying this and started getting this error: cannot refresh, install, or download: soft-expired device authorization needs refresh

system is:
Distributor ID: Ubuntu
Description:    Ubuntu 24.04.3 LTS
Release:        24.04
Codename:       noble
 BIOS Vendor ID:            Intel(R) Corporation
  Model name:                Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz
    BIOS Model name:         Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz Fill By OEM CPU @ 3.2GHz
    BIOS CPU family:         205
    CPU family:              6
    Model:                   58
    Thread(s) per core:      1
    Core(s) per socket:      4
    Socket(s):               1
Memory Device
        Form Factor: DIMM
        Locator: ChannelA-DIMM0
        Bank Locator: BANK 0

        Total Width: 64 bits
        Data Width: 64 bits
        Size: 4 GB
        Form Factor: DIMM
        Locator: ChannelA-DIMM1
        Bank Locator: BANK 1
        Type: DDR3
        Type Detail: Synchronous
        Speed: 1600 MT/s
        Manufacturer: Samsung
        Serial Number: 6306EA80
        Asset Tag: 9876543210
        Part Number: M378B5273DH0-CK0

        Form Factor: DIMM
        Locator: ChannelB-DIMM0
        Bank Locator: BANK 2

        Total Width: 64 bits
        Data Width: 64 bits
        Size: 4 GB
        Form Factor: DIMM
        Locator: ChannelB-DIMM1
        Bank Locator: BANK 3
        Type: DDR3
        Type Detail: Synchronous
        Speed: 1600 MT/s
        Manufacturer: Samsung
        Serial Number: 6306EA2E
        Asset Tag: 9876543210
        Part Number: M378B5273DH0-CK0

Snaps before I started trying to remediate:

bare                
bazarr-tak          
canonical-livepatch 
certbot             
core20              
core22              
core24              
firmware-updater    
gnome-42-2204       
gnome-46-2404       
gtk-common-themes   
mesa-2404           
plexmediaserver     
snap-store          
snapd               
snapd-desktop-integration

Snaps remaining:

canonical-livepatch  10.11.9   364    latest/stable  canonical✓  disabled
core22               20251009  2163   latest/stable  canonical✓  base
snapd                2.72      25577  latest/stable  canonical✓  snapd

snap changelog:

root@Rez-Plex:~# snap changes
ID   Status  Spawn                   Ready                   Summary
198  Done    yesterday at 13:55 CST  yesterday at 13:56 CST  Remove "bazarr-tak" snap
200  Done    yesterday at 17:12 CST  yesterday at 17:12 CST  Remove "certbot" snap
201  Done    yesterday at 17:12 CST  yesterday at 17:12 CST  Remove "core20" snap
202  Done    yesterday at 17:12 CST  yesterday at 17:13 CST  Remove "firmware-updater" snap
203  Done    yesterday at 17:13 CST  yesterday at 17:13 CST  Remove "gnome-42-2204" snap
204  Done    yesterday at 17:13 CST  yesterday at 17:13 CST  Remove "gnome-46-2404" snap
205  Done    yesterday at 17:13 CST  yesterday at 17:13 CST  Remove "gtk-common-themes" snap
206  Done    yesterday at 17:13 CST  yesterday at 17:13 CST  Remove "mesa-2404" snap
207  Done    yesterday at 17:13 CST  yesterday at 18:00 CST  Remove "plexmediaserver" snap
208  Done    yesterday at 18:00 CST  yesterday at 18:00 CST  Remove "snap-store" snap
209  Done    yesterday at 18:00 CST  yesterday at 18:00 CST  Remove "snapd-desktop-integration" snap
210  Done    yesterday at 18:12 CST  yesterday at 18:12 CST  Remove "bare" snap
211  Done    yesterday at 18:19 CST  yesterday at 18:19 CST  Remove "core24" snap
214  Done    today at 12:01 CST      today at 12:01 CST      Running service command

If anyone can tell me what I need to do to restore the snapd system to operability, it would be appreciated.

pinning firefox developer to Activities overview https://askubuntu.com/questions/1560529/pinning-firefox-developer-to-activities-overview

I'm new to Linux and Ubuntu 24.04. I was trying to install Firefox developer on my system. I downloaded firefox-146.0b9.tar.xz file and extracted and moved it to /usr/local/bin directory. When I tried to pin the app, I found out I should copy it .Desktop file to my /usr/local/share div and the Firefox subdirectory doesn't have any. Desktop file...

And I'm stumped. In the Firefox doc it didn't say how to create a.desktop file. What should I do?

Right-clicking on desktop no longer works (Kubuntu with Plasma KDE 6.3.4) https://askubuntu.com/questions/1560525/right-clicking-on-desktop-no-longer-works-kubuntu-with-plasma-kde-6-3-4

Right-clicking on the desktop usually brings up the option to edit your desktop settings.
I was messing around with it and set left-click to open the app menu.
I went to remove this left-click function and accidentally deleted the right-click instead. I can no longer find the Desktop Settings window or how to open it.
User Goncalo Andrade also had this problem but never solved it:
Can't right click in desktop anymore

Discover Update Fails in an Endless Loop https://askubuntu.com/questions/1560524/discover-update-fails-in-an-endless-loop

In October, I migrated from Win 10 to Ubuntu, rather than suffer Win 11. It has been going well, but I am getting this problem when Ubuntu Discover tries to do a "firmware update":

Ubuntu Discover update "failed to write-firmware: failed to write (null): failed to write data to efivarsfs: Error writing to file descriptor: Invalid argument"

Even more irritating, I dismiss the error message and it pops right back. The Discover updater captures the cursor too quickly to close the program, leaving me stuck. The cursor/mouse is captured by Discover, leaving me unable to do anything other than close the error message box, which pops right back endlessly.

The first time this happened, I tried the reset button on the PC, but that had the bad side effect of leaving a couple drives with "missing mount points", which I had to remove from the PC and put in my old Win 10 pc and run partition manager to scan them for errors, then back in to my main PC and all was happy again. Yes, I know there is a way to do this in Ubuntu, but I felt too newbie to try it and risk losing important data. And yes, I do have a back up, but some recent things might have been lost.

The second time this happened, just this morning, I was able to click on the Discover icon on the left of the Task Manager bar and manage to quit Discover after several tries. A quick right click on the icon and then a typed Q to quit, if done quickly enough was able to do the job.

Thank you for any help

The stuff everyone will ask:

  • Operating System: Ubuntu Studio 25.10
  • KDE Plasma Version: 6.4.5
  • KDE Frameworks Version: 6.17.0
  • Qt Version: 6.9.2
  • Kernel Version: 6.17.0-7-generic (64-bit)
  • Graphics Platform: Wayland
  • Processors: 16 × Intel® Core™ i7-6900K CPU @ 3.20GHz (overclocked -to 4.2GHz)
  • Memory: 128 GiB of RAM (125.7 GiB usable)
  • Graphics Processor: NVIDIA GeForce GTX 1070 Ti driving 3 monitors
  • Manufacturer: ASUS
  • Product Name: All Series
  • Motherboard - Asus X99-A II
sudo dmidecode -t 0
# dmidecode 3.6
Getting SMBIOS data from sysfs.
SMBIOS 3.0.0 present.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
        Vendor: American Megatrends Inc.
        Version: 1401
        Release Date: 11/08/2016
        Address: 0xF0000
        Runtime Size: 64 kB
        ROM Size: 16 MB
Characteristics:
                PCI is supported
                APM is supported
                BIOS is upgradeable
                BIOS shadowing is allowed
                ...
                BIOS boot specification is supported
                Targeted content distribution is supported
                UEFI is supported
        BIOS Revision: 5.11

        
How to fix stuck snap package in Ubuntu 24.04? `error: snap "chromium" has "remove-snap" change in progress` https://askubuntu.com/questions/1560523/how-to-fix-stuck-snap-package-in-ubuntu-24-04-error-snap-chromium-has-remo

I want to reinstall Chromium for reasons I no longer recall. Two weeks ago, I tried and it completely broke, only outputting error: snap "chromium" has "remove-snap" change in progress. I have not been able to resolve since. I am running Ubuntu 24.04.

Short of reinstalling the entire operating system from scratch for one single application - which I already had to do once because for some incomprehensible reason, uninstalling Thunderbird bricks the entire system upon the next boot - is there a way to fix this?

This error is reproduced by:

sudo snap remove chromium or

sudo snap remove --purge chromium

I have tried:

  • Turning it [the PC] off and turning it on again, at least 20 times incidentally
  • snap abort ID (which does absolutely nothing)
  • snap enable chromium
  • snap refresh && snap abort ID
  • Uninstalling through the Ubuntu Software window
  • sudo rm /var/cache/fontconfig/*
  • rm ~/.cache/fontconfig/*
  • sudo fc-cache -r -v
  • rm -rf ~/snap/chromium/common/.cache/fontconfig/
  • setting system clock 1 year ahead
  • sudo snap revert chromium && sudo snap refresh chromium && sudo snap remove chromium

Here is the feedback I get from various commands, much of it contradictory:

  • snap changes outputs 11 Undo 14 days ago, at 12:41 CST - Remove "chromium" snap
  • snap list outputs chromium 142.0.7444.162 3307 latest/stable canonical✓ disabled
  • chromium-browser outputs Command '/usr/bin/chromium-browser' requires the chromium snap to be installed. Please install it with: snap install chromium
  • snap install chromium outputs snap "chromium" is already installed, see 'snap help refresh'
  • sudo snap revert chromium outputs error: cannot revert "chromium": no revision to revert to
  • sudo snap refresh chromium outputs error: cannot refresh "chromium": refreshing disabled snap "chromium" not supported

Lastly, snap list 11 outputs:

Status  Spawn                      Ready                      Summary
Undo    14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Stop snap "chromium" services
Undo    14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Run remove hook of "chromium" snap if present
Done    14 days ago, at 12:41 CST  today at 09:39 CST         Disconnect interfaces of snap "chromium"
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Save data of snap "chromium" in automatic snapshot set #1
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Remove aliases for snap "chromium"
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Make snap "chromium" unavailable to the system
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Remove security profile for snap "chromium" (3307)
Done    14 days ago, at 12:41 CST  today at 09:39 CST         Remove data for snap "chromium" (3293)
Done    14 days ago, at 12:41 CST  today at 09:39 CST         Remove snap "chromium" (3293) from the system
Error   14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Remove data for snap "chromium" (3307)
Hold    14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Remove snap "chromium" (3307) from the system
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:opengl from snapd:opengl
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:home from snapd:home
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:42 CST  Disconnect chromium:browser-sandbox from snapd:browser-support
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:42 CST  Disconnect chromium:camera from snapd:camera
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:desktop-legacy from snapd:desktop-legacy
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:gtk-3-themes from gtk-common-themes:gtk-3-themes
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:hardware-observe from snapd:hardware-observe
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:upower-observe from snapd:upower-observe
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:audio-record from snapd:audio-record
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:dot-local-share-applications from snapd:personal-files
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:network-bind from snapd:network-bind
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:gsettings from snapd:gsettings
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:joystick from snapd:joystick
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:removable-media from snapd:removable-media
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:audio-playback from snapd:audio-playback
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:42 CST  Disconnect chromium:bluez from snapd:bluez
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:unity7 from snapd:unity7
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:wayland from snapd:wayland
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:chromium-config from snapd:personal-files
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:icon-themes from gtk-common-themes:icon-themes
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:dot-local-share-icons from snapd:personal-files
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:cups from cups:cups
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:u2f-devices from snapd:u2f-devices
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:42 CST  Disconnect chromium:system-packages-doc from snapd:system-packages-doc
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:42 CST  Disconnect chromium:sound-themes from gtk-common-themes:sound-themes
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:screen-inhibit-control from snapd:screen-inhibit-control
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:42 CST  Disconnect chromium:x11 from snapd:x11
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:desktop from snapd:desktop
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:41 CST  Disconnect chromium:network from snapd:network
Undone  14 days ago, at 12:41 CST  14 days ago, at 12:42 CST  Disconnect chromium:etc-chromium-browser-policies from snapd:system-files

......................................................................
Make snap "chromium" unavailable to the system

2025-11-21T12:41:50-06:00 INFO cannot link snap "chromium" back, some of its data has already been removed

......................................................................
Remove data for snap "chromium" (3307)

2025-11-21T12:41:50-06:00 ERROR failed to remove snap "chromium" base directory: remove /home/sean/snap/chromium: directory not empty
Please help me get wifi working on my Macbook Air https://askubuntu.com/questions/1560522/please-help-me-get-wifi-working-on-my-macbook-air

There are lots of questions around this, and lots of solutions, but not much explanation. I have tried a few things, but so far do not have a working wifi connection on my Macbook Air 7,2 A1466. It's a fresh install of Kubuntu 25.10, if it helps.

lspci shows I have a Broadcom BCM4360, so I have (whilst connected to my phone via bluetooth) done the following:

sudo apt install firmware-b43-installer
sudo modprobe -rv b43
sudo modprobe -v b43
sudo reboot now

But I still get no sign of wifi being available.

The entry for "kernel driver in use" for the Broadcom card says bcma-pci-bridge. Assuming this should be the b43 firmware instead, how do I change it?

I don't really understand any of this (hence asking again, as the other posts are confusing and I don't want to start randomly throwing terminal commands at a problem I don't understand) so any help would be appreciated.

sudo ubuntu-drivers autoinstall fails due to missing dependencies for nvidia drivers https://askubuntu.com/questions/1560520/sudo-ubuntu-drivers-autoinstall-fails-due-to-missing-dependencies-for-nvidia-dri

Unfortunately, I recently broke my installation of NVIDIA drivers and so I had been purging them for reinstallation. However, after purging, running sudo ubuntu-drivers autoinstall raises an error about missing dependencies.

After installing the listed dependency, the same error still shows up.

More explicitly, the process for purging and reinstalling nvidia packages was as follows:

sudo apt remove --purge nvidia-* cuda-* libnvidia-*
sudo apt autoremove
sudo apt autoclean
reboot
sudo ubuntu-drivers autoinstall

The final step yielded the error

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 linux-modules-nvidia-580-open-6.8.0-88-generic : Depends: nvidia-kernel-common-580 (<= 580.95.05-1) but 580.105.08-0ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.

I therefore followed the recommendation and ran update-drivers again

sudo apt-get install nvidia-kernel-common-580
sudo ubuntu-drivers autoinstall

But this yielded the same error, despite having installed the package.

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 linux-modules-nvidia-580-open-6.8.0-88-generic : Depends: nvidia-kernel-common-580 (<= 580.95.05-1) but 580.105.08-0ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.

What can I do to fix this? I would also love to take this as a learning moment and would appreciate explanations as to why this is occurring.

Permanently map a Windows drive in Ubuntu 22.04 https://askubuntu.com/questions/1560504/permanently-map-a-windows-drive-in-ubuntu-22-04

I need to permanently map a Windows drive on 2 Ubuntu 22.04 machines with the same setup and configuration.

The strange thing is one is working, but the other one just doesn't.

//serverip/path /home/ubuntu/pictures ctfs credentials=/home/ubuntu/.smbcredentials,uid=1000,gid=1000,x-systemd,automount 0 0 UUID=F47A-11C2 /boot/efi vfat defaults 0 1

When I try to mount it after reboot, the mapped drive will show Unable to access location mount.cifs: Permission denied. I have tried to add _Netdev to it, but it's still not able to permanently map the drive.

How to read desktop notifications in the terminal https://askubuntu.com/questions/1560426/how-to-read-desktop-notifications-in-the-terminal

I am trying to create a script that listens to the desktop notifications dbus and print the sender and message to the command line.... the final goal is to run a specific function when I get a specific notification.

I tried using dbus-monitor --session which prints stuff out when I get a notification, but I don't see the actual notification. I had Gemini AI help me write some python code, this code runs, but nothing happens when I get a notification.

import asyncio
from dbus_next.aio import MessageBus
from dbus_next.constants import BusType, MessageType
from dbus_next import Message, Variant
import logging

# Set up basic logging
# Note: We are only using INFO level for connection status, 
# message processing is handled via print() for clarity.
logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s')

# --- DBus Interface Constants ---
# The D-Bus service name for notifications
NOTIF_SERVICE = 'org.freedesktop.Notifications'
# The D-Bus object path for notifications
NOTIF_PATH = '/org/freedesktop/Notifications'
# The D-Bus interface for notifications
NOTIF_INTERFACE = NOTIF_SERVICE

# ANSI escape codes for bold text
BOLD_START = '\033[1m'
BOLD_END = '\033[0m'

def message_handler(message):
    """
    Generic handler for D-Bus messages, focusing only on new notifications 
    (Notify method calls) and printing the sender, summary, and message body.
    """
    if message.interface == NOTIF_INTERFACE:
        
        # --- Handle New Notification (Method Call) ---
        if message.message_type == MessageType.METHOD_CALL and message.member == 'Notify':
            # Notify arguments: (app_name, replaces_id, app_icon, summary, body, actions, hints, expire_timeout)
            
            # Ensure we have enough arguments (at least app_name and body)
            if len(message.body) >= 8:
                app_name = message.body[0] # App Name (Sender)
                summary = message.body[3] # Notification Summary (Title)
                body_text = message.body[4] # Notification Body (Main message)
                
                # Combine summary and body for the message
                # If both exist, use "Summary: Body". If only one exists, use that.
                if summary and body_text:
                    message_content = f"{summary}: {body_text}"
                elif summary:
                    message_content = summary
                else:
                    message_content = body_text

                output = f"[{app_name}] {message_content}"
                
                # Apply bold formatting if the sender is Discord (case-insensitive check)
                if app_name.lower() == 'discord':
                    output = f"{BOLD_START}{output}{BOLD_END}"
                
                print(output)
            
        # Log other relevant messages (like replies to GetCapabilities)
        else:
            logging.debug(f"[D-Bus Message] Type: {message.message_type.name}, Member: {message.member}, Body: {message.body}")


async def notification_listener(bus):
    """
    Configures the bus to listen for all messages related to the 
    org.freedesktop.Notifications interface.
    """
    # 1. Add the generic message handler
    bus.add_message_handler(message_handler)

    # 2. Use AddMatch to filter messages directed to this interface
    # This is crucial for catching the 'Notify' method call.
    # The rule is updated to match on the specific method call ('Notify') rather than 
    # relying solely on the destination service, which is a more robust way to capture 
    # new notification requests.
    match_rule = f"type='method_call', interface='{NOTIF_INTERFACE}', member='Notify'"
    
    await bus.call(
        Message(
            destination='org.freedesktop.DBus',
            path='/org/freedesktop/DBus',
            interface='org.freedesktop.DBus',
            member='AddMatch',
            signature='s',
            body=[match_rule]
        )
    )

    logging.info("Listening for ALL D-Bus Messages on org.freedesktop.Notifications interface.")
    logging.info("To test, send a notification, e.g., 'notify-send Hello World'")
    
    # Keep the asyncio loop running indefinitely
    await asyncio.get_running_loop().create_future()


async def main():
    """
    The main entry point for the script.
    """
    try:
        logging.info(f"Attempting to connect to the D-Bus session bus...")
        bus = await MessageBus(bus_type=BusType.SESSION).connect()
        logging.info("Successfully connected to the D-Bus session bus.")
        
        # Attempt to call the GetCapabilities method to ensure the service is running
        reply = await bus.call(
            Message(
                destination=NOTIF_SERVICE,
                path=NOTIF_PATH,
                interface=NOTIF_INTERFACE,
                member='GetCapabilities',
                signature='',
                body=[]
            )
        )
        
        if reply.message_type == MessageType.METHOD_RETURN:
            caps = reply.body[0]
            logging.info(f"Notification service capabilities retrieved: {caps}")
            await notification_listener(bus)
        else:
            # This often means no notification daemon (like dunst or a desktop environment's service) is running.
            logging.error("Could not retrieve notification service capabilities. Is a notification daemon running?")
    except Exception as e:
        logging.error(f"Error during D-Bus setup or initial capability check: {e}")

if __name__ == "__main__":
    try:
        # Run the main coroutine
        asyncio.run(main())
    except KeyboardInterrupt:
        logging.info("Notification listener stopped by user.")
    except Exception as e:
        logging.error(f"An unexpected error occurred: {e}")

It seems like this should be a simple task.... I would rather use a bash script if I could, but python would be fine too.

I did find this post which had a python script that I had to be update to work with py3. This script runs but nothing happens when I get a notification or send one via notify-send

import gi
gi.require_version("Gtk", "3.0") # or "4.0" depending on your target GTK version
from gi.repository import Gtk
import dbus
from dbus.mainloop.glib import DBusGMainLoop

def filter_cb(bus, message):
    # the NameAcquired message comes through before match string gets applied
    if message.get_member() != "Notify":
        return
    args = message.get_args_list()
    # args are
    # (app_name, notification_id, icon, summary, body, actions, hints, timeout)
    print("Notification from app '%s'" % args[0])
    print("Summary: %s" % args[3])
    print("Body: %s", args[4])


DBusGMainLoop(set_as_default=True)
bus = dbus.SessionBus()
bus.add_match_string(
    "type='method_call',interface='org.freedesktop.Notifications',member='Notify'")
bus.add_message_filter(filter_cb)
Gtk.main()

Thanks.

command passwd does not work entirely in 24.04 [closed] https://askubuntu.com/questions/1560394/command-passwd-does-not-work-entirely-in-24-04

With attempt to change my password with command passwd in terminal,

passwd Passworts für linux wird geändert. Geben Sie das aktuelle Passwort ein:

I typed in old password, then query comes for new password.

Geben Sie das neue Passwort ein :

I typed over 200 chars in new password and enter. Then passwd claims that my password would be too small "according to dictionary" ?!

As far as I know, Linux and Ubuntu allows passwords with up to 512 chars. What is up with command passwd ? In Ubuntu 24.04 ... after recent update one week before ?

This happened at Ubuntu already between version 12.04 and 18.04 ?

Is it possible to shutdown the LUKS unlocking by timeout? https://askubuntu.com/questions/1560334/is-it-possible-to-shutdown-the-luks-unlocking-by-timeout

I wonder if I can set the timeout to the boot time LUKS unlocking and let the PC shut down on timeout.

In other words, I want the PC to shut down automatically when I leave it without typing the password 1min.

This is particularly useful for laptops. Some computers turn on by shock or some other event. Without a timeout, the PC will wait for the password until the battery is fully discharged.

Screenshot of the disk unlocking screen:

Screenshot of the disk unlocking screen.

How can I temporarily override a change made in /etc/default/keyboard? https://askubuntu.com/questions/1559459/how-can-i-temporarily-override-a-change-made-in-etc-default-keyboard

In /etc/default/keyboard, I have XKBOPTIONS="ctrl:nocaps" set. Sometimes, I decide that I need my caps lock. In other words, I want to run something in my terminal to undo this setting.

I've tried setxkbmap -option caps:capslock, but that simply does nothing.

Android emulator segfaulting during startup when using hardware acceleration on Kubuntu 24.04, Intel Arc GPU https://askubuntu.com/questions/1555405/android-emulator-segfaulting-during-startup-when-using-hardware-acceleration-on

Hoping someone out there might be able to help point me in the right direction of resolving this. Somewhere over the last month or so, hardware acceleration on my emulators has broken for Android development. I'm running Kubuntu 24.04, on a Lenovo with an Intel ARC GPU on die (following Intel's instructions on figuring out what hardware I have here, I have a 7D55 PCI ID, so it's an Intel® Arc™ Graphics Xe-LPG Meteor Lake GPU, supported in kernel since 6.7. uname -a says I'm on Ubuntu's 6.14.0-29 generic kernel. So I guess from that perspective, I'm doing OK so far.

But when I run the emulator with -gpu host flag, I get the following output and it never starts:

me@me-thinkpad-SERIALNUM:~$ /home/me/Android/Sdk/emulator/emulator -netdelay none -netspeed full -avd Pixel_9_API_36 -gpu host
INFO         | Android emulator version 36.1.9.0 (build_id 13823996) (CL:N/A)
INFO         | Graphics backend: gfxstream
INFO         | Found systemPath /home/me/Android/Sdk/system-images/android-36/google_apis_playstore/x86_64/
WARNING      | Please update the emulator to one that supports the feature(s): VulkanVirtualQueue
INFO         | Guest GLES Driver: Auto (ext controls)
library_mode host gpu mode host
INFO         | emuglConfig_get_vulkan_hardware_gpu_support_info: Found physical GPU 'Intel(R) Arc(tm) Graphics (MTL)', type: VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU, apiVersion: 1.4.305, driverVersion: 25.0.7

INFO         | emuglConfig_get_vulkan_hardware_gpu_support_info: Found physical GPU 'llvmpipe (LLVM 19.1.1, 256 bits)', type: VK_PHYSICAL_DEVICE_TYPE_CPU, apiVersion: 1.4.305, driverVersion: 0.0.1

INFO         | Enabled VulkanAllocateHostMemory feature for gpu vendor Intel(R) Arc(tm) Graphics (MTL) on Linux

INFO         | GPU device local memory = 31867MB
INFO         | Checking system compatibility:
INFO         |   Checking: hasSufficientDiskSpace
INFO         |      Ok: Disk space requirements to run avd: `Pixel_9_API_36` are met
INFO         |   Checking: hasSufficientHwGpu
INFO         |      Ok: Hardware GPU requirements to run avd: `Pixel_9_API_36` are passed
INFO         |   Checking: hasSufficientSystem
INFO         |      Ok: System requirements to run avd: `Pixel_9_API_36` are met
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_btn_xr_environment_living_room_day_clicked() (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_btn_xr_environment_living_room_night_clicked() (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_new_posture_requested(int) (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_dismiss_posture_selection_dialog() (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_new_resizable_requested(PresetEmulatorSizeType) (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_dismiss_resizable_dialog() (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_xr_environment_mode_changed(int) (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_dismiss_xr_environment_mode_dialog() (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_xr_input_mode_changed(int) (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_dismiss_xr_input_mode_dialog() (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_sleep_timer_done() (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_unfold_timer_done() (:0, )
INFO         | Storing crashdata in: /tmp/android-me/emu-crash-36.1.9.db, detection is enabled for process: 28618
INFO         | Crash reports will be automatically uploaded to: https://clients2.google.com/cr/report
INFO         | Initializing hardware OpenGLES emulation support
I0829 10:33:33.356077   28618 opengles.cpp:291] android_startOpenglesRenderer: gpu info
I0829 10:33:33.356123   28618 opengles.cpp:292] 
INFO         | HealthMonitor disabled.
INFO         | SharedLibrary::open for [libvulkan.so]
INFO         | SharedLibrary::open for [libvulkan.so]: not found in map, open for the first time
INFO         | SharedLibrary::open for [libvulkan.so] (posix): begin
INFO         | SharedLibrary::open for [libvulkan.so] (posix,linux): call dlopen on [libvulkan.so]
INFO         | SharedLibrary::open succeeded for [libvulkan.so].
INFO         | Added library: libvulkan.so
INFO         | Selecting Vulkan device: Intel(R) Arc(tm) Graphics (MTL), Version: 1.4.305
INFO         | Disabling sparse binding feature support
INFO         | SharedLibrary::open for [libX11]
INFO         | SharedLibrary::open for [libX11]: not found in map, open for the first time
INFO         | SharedLibrary::open for [libX11] (posix): begin
INFO         | SharedLibrary::open for [libX11] (posix,linux): call dlopen on [libX11.so]
INFO         | SharedLibrary::open succeeded for [libX11].
INFO         | SharedLibrary::open for [libGL.so.1]
INFO         | SharedLibrary::open for [libGL.so.1]: not found in map, open for the first time
INFO         | SharedLibrary::open for [libGL.so.1] (posix): begin
INFO         | SharedLibrary::open for [libGL.so.1] (posix,linux): call dlopen on [libGL.so.1]
INFO         | SharedLibrary::open succeeded for [libGL.so.1].
MESA: error: dri3_alloc_render_buffer:1634 xcb_dri3_pixmap_from_buffer[s] failed
MESA: error: X error: 11
Segmentation fault (core dumped)

StackOverflow had me install this driver from Intel's PPA, but no change.

I've also tried disabling Vulkan w/ the emulator flag -feature -Vulkan which changed the stacktrace slightly to the following, but ultimately, looks like a crash in the same spot.

me@me-thinkpad-SERIALNUM:~$ /home/me/Android/Sdk/emulator/emulator -netdelay none -netspeed full -avd Pixel_9_API_36 -feature -Vulkan -gpu host
INFO         | Android emulator version 36.1.9.0 (build_id 13823996) (CL:N/A)
INFO         | Graphics backend: gfxstream
INFO         | Found systemPath /home/me/Android/Sdk/system-images/android-36/google_apis_playstore/x86_64/
WARNING      | Please update the emulator to one that supports the feature(s): VulkanVirtualQueue
I0829 10:46:28.619472   32945 FeatureControlImpl.cpp:374] Feature 'Vulkan' (21) is overridden to 'disabled'
INFO         | Guest GLES Driver: Auto (ext controls)
library_mode host gpu mode host
INFO         | Checking system compatibility:
INFO         |   Checking: hasSufficientDiskSpace
INFO         |      Ok: Disk space requirements to run avd: `Pixel_9_API_36` are met
INFO         |   Checking: hasSufficientHwGpu
INFO         |      Ok: Hardware GPU requirements to run avd: `Pixel_9_API_36` are passed
INFO         |   Checking: hasSufficientSystem
INFO         |      Ok: System requirements to run avd: `Pixel_9_API_36` are met
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_btn_xr_environment_living_room_day_clicked() (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_btn_xr_environment_living_room_night_clicked() (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_new_posture_requested(int) (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_dismiss_posture_selection_dialog() (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_new_resizable_requested(PresetEmulatorSizeType) (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_dismiss_resizable_dialog() (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_xr_environment_mode_changed(int) (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_dismiss_xr_environment_mode_dialog() (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_xr_input_mode_changed(int) (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_dismiss_xr_input_mode_dialog() (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_sleep_timer_done() (:0, )
INFO         | Warning: QMetaObject::connectSlotsByName: No matching signal for on_unfold_timer_done() (:0, )
INFO         | Storing crashdata in: /tmp/android-me/emu-crash-36.1.9.db, detection is enabled for process: 32945
INFO         | Crash reports will be automatically uploaded to: https://clients2.google.com/cr/report
INFO         | Initializing hardware OpenGLES emulation support
I0829 10:46:28.996830   32945 opengles.cpp:291] android_startOpenglesRenderer: gpu info
I0829 10:46:28.996846   32945 opengles.cpp:292] 
INFO         | HealthMonitor disabled.
INFO         | SharedLibrary::open for [libX11]
INFO         | SharedLibrary::open for [libX11]: not found in map, open for the first time
INFO         | SharedLibrary::open for [libX11] (posix): begin
INFO         | SharedLibrary::open for [libX11] (posix,linux): call dlopen on [libX11.so]
INFO         | SharedLibrary::open succeeded for [libX11].
INFO         | SharedLibrary::open for [libGL.so.1]
INFO         | SharedLibrary::open for [libGL.so.1]: not found in map, open for the first time
INFO         | SharedLibrary::open for [libGL.so.1] (posix): begin
INFO         | SharedLibrary::open for [libGL.so.1] (posix,linux): call dlopen on [libGL.so.1]
INFO         | SharedLibrary::open succeeded for [libGL.so.1].
MESA: error: dri3_alloc_render_buffer:1634 xcb_dri3_pixmap_from_buffer[s] failed
MESA: error: X error: 11
Segmentation fault (core dumped)

Ultimately, it seems I have a problem in Mesa, but I just don't know enough about the graphics stack to proceed further. Any help appreciated!

One laptop, multiple workstations, only one used at a time: Why does it flash the built-in screen? https://askubuntu.com/questions/1550628/one-laptop-multiple-workstations-only-one-used-at-a-time-why-does-it-flash-th

Some background first:

Screenshot: About this System

Operating System: Ubuntu Studio 24.04
KDE Plasma Version: 5.27.12
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.13
Kernel Version: 6.8.0-60-lowlatency (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-4940MX CPU @ 3.10GHz
Memory: 31.3 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 4600
Manufacturer: Dell Inc.
Product Name: Precision M6800
System Version: 00

I have 4 other monitors hooked up in addition to the built-in screen, using all 3 dock outputs and 1 USB adapter, and scripts to control which of the 5 are used at a given moment. A set of keyboard shortcuts triggers those scripts, so I can "call" my desktop to whichever station I'm at, and work from there.

A representative sample of those scripts:

Blank:

#!/bin/bash



SCRIPT_DIR=`dirname $0`



$SCRIPT_DIR/backlight_2_off.sh

kscreen-doctor                      \
    output.VGA-1.disable            \
    output.VGA-1.priority.0         \
                                    \
    output.eDP-1.disable            \
    output.eDP-1.priority.0         \
                                    \
    output.DP-1-2.disable           \
    output.DP-1-2.priority.0        \
                                    \
    output.DP-1-0.disable           \
    output.DP-1-0.priority.0        \
                                    \
    output.DVI-I-2-1.disable        \
    output.DVI-I-2-1.priority.0     \




# Touchscreen on correct monitor only

xinput map-to-output "Wacom ISDv4 4001 Finger touch" eDP-1

Bench:

#!/bin/bash



SCRIPT_DIR=`dirname $0`

$SCRIPT_DIR/audio-desk.sh



$SCRIPT_DIR/backlight_2_off.sh

kscreen-doctor                          \
    output.VGA-1.disable                \
    output.VGA-1.priority.0             \
                                        \
    output.eDP-1.disable                \
    output.eDP-1.priority.0             \
                                        \
    output.DP-1-2.disable               \
    output.DP-1-2.priority.0            \
                                        \
    output.DP-1-0.disable               \
    output.DP-1-0.priority.0            \
                                        \
    output.DVI-I-2-1.enable             \
    output.DVI-I-2-1.priority.1         \
    output.DVI-I-2-1.mode.1920x1080@60  \
    output.DVI-I-2-1.position.0,0       \



# Touchscreen on correct monitor only

xinput map-to-output "Wacom ISDv4 4001 Finger touch" eDP-1

Desk 1:

#!/bin/bash



SCRIPT_DIR=`dirname $0`

$SCRIPT_DIR/audio-desk.sh



$SCRIPT_DIR/backlight_2_off.sh

kscreen-doctor                          \
    output.VGA-1.disable                \
    output.VGA-1.priority.0             \
                                        \
    output.eDP-1.enable                 \
    output.eDP-1.priority.1             \
    output.eDP-1.mode.1920x1080@60      \
    output.eDP-1.position.0,0           \
                                        \
    output.DP-1-2.disable               \
    output.DP-1-2.priority.0            \
                                        \
    output.DP-1-0.disable               \
    output.DP-1-0.priority.0            \
                                        \
    output.DVI-I-2-1.disable            \
    output.DVI-I-2-1.priority.0         \



# Touchscreen on correct monitor only

xinput map-to-output "Wacom ISDv4 4001 Finger touch" eDP-1

Desk 2:

#!/bin/bash



SCRIPT_DIR=`dirname $0`

$SCRIPT_DIR/audio-desk.sh



$SCRIPT_DIR/backlight_2_off.sh

kscreen-doctor                          \
    output.VGA-1.disable                \
    output.VGA-1.priority.0             \
                                        \
    output.eDP-1.enable                 \
    output.eDP-1.priority.1             \
    output.eDP-1.mode.1920x1080@60      \
    output.eDP-1.position.1280,0        \
                                        \
    output.DP-1-2.enable                \
    output.DP-1-2.priority.2            \
    output.DP-1-2.mode.1280x1024@60     \
    output.DP-1-2.position.0,56         \
                                        \
    output.DP-1-0.disable               \
    output.DP-1-0.priority.0            \
                                        \
    output.DVI-I-2-1.disable            \
    output.DVI-I-2-1.priority.0         \



# Touchscreen on correct monitor only

xinput map-to-output "Wacom ISDv4 4001 Finger touch" eDP-1

I think you get the idea.

  • eDP-1 is the built-in screen.
  • DP-1-0 and DP-1-2 are both DVI and sometimes used to extend the built-in screen, but not always.
  • DVI-I-2-1 is a USB3 to HDMI adapter that has a short HDMI to DVI cord on it, at the end of a long USB3 extension and then a powered hub.
  • VGA-1 is an old LCD monitor with VGA input only and a dead CCFL backlight, so I put some LED strips in it with a custom controller, that is commanded by a set of scripts that are called from here.

A sample of the other scripts:

audio-desk.sh:

#!/bin/bash



# Audio Defaults (from pactl get-default-[sink|source])

pactl set-default-sink    "alsa_output.pci-0000_00_1b.0.analog-stereo"
pactl set-default-source   "alsa_input.pci-0000_00_1b.0.analog-stereo"

backlight_2_off.sh:

#!/bin/bash



SCRIPT_DIR=`dirname $0`



#basic setup

if [ -e /dev/ttyUSB0 ]
then
    stty -F /dev/ttyUSB0 1200
fi




#backlight off (blank command, equal to #000000FF!)

if [ -e /dev/ttyUSB0 ]
then
    echo "#!" > /dev/ttyUSB0
fi

(Setup and command are actually their own scripts that I consolidated into here for easier reading. That's all they do.)

The Problem:

It periodically switches to the built-in screen by itself (what I call "Desk 1"), and then back to what I've told it. No user input during that entire time.

  • If I'm using another station, that monitor goes blank (no signal), and if I look over at the built-in screen, I see the image over there that is supposed to be on my selected station. Then a few seconds later with no prompting, it switches back.
  • If it's supposed to be blank (no screens active), it turns the built-in screen on for a few seconds and back off again.
  • If I'm using one of the extended modes (Desk 2 or 3) that includes the built-in screen, it disables the extensions and reconfigures the geometry to just the single built-in display, and then re-extends and reconfigures the geometry again. Again, this is all with no prompting.
  • If I'm already using just the one built-in screen (Desk 1), I wouldn't be surprised if it still does this, but it makes no difference and so I can't see it.

Troubleshooting:

Mirroring the built-in screen to an external one (2 screens with the exact same image, one of which is built-in), is rock-solid on both screens. A 3-hour movie and a 1-hour presentation were both flawless like that.

Also, it appears that "turning the screen off" by the Power Management system instead of disabling all of them as above, does not glitch either, regardless of which monitors are enabled:
Screenshot: Power Shortcuts
That's only a partial solution though, because it doesn't do anything about a configuration that does not include the built-in screen.

Adding some trap code shows that the scripts are (probably) not running for the glitch:
date >> debug.log
It appears that they only run when I tell them to, with the keyboard shortcuts. So the system still knows internally what it's supposed to be, but it "hiccups" occasionally, always to the built-in screen by itself, and then fixes itself.

Now the question:

Why does it do that? And how can I prevent the hiccup?

Install yfinance using apt-get https://askubuntu.com/questions/1547457/install-yfinance-using-apt-get

I'm trying to install "yfinance" on Ubuntu 24.04. Everyone on the web says to use "pip" to install, but Ubuntu gives a long message saying that's not a good idea, to use the equivalent of "apt install python3-xyz" instead.

That much is ok, but running

sudo apt-get -y install python3-yfinance

can't find anything

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package python3-yfinance

How do I point to the right repo for this?

How can I choose the monitor to take a screenshot on using flameshot? https://askubuntu.com/questions/1543353/how-can-i-choose-the-monitor-to-take-a-screenshot-on-using-flameshot

I recently added an old monitor to my setup that I connected to my PC using a VGA cable, while the other with an HDMI cable, using the multimonitor option, because one monitor is connected to the motherboard, while the other is connected to the video card. When I use flameshot it only takes a screenshot of one monitor, the one connected to the motherboard, but I want to take a screenshot on the other monitor. I tried checking the options but it doesn't let me change the monitor I can take a screenshot on. Is there any other solution, other than moving the window I need to take a screenshot on the other monitor? I use Kubuntu.

How do I disable the insert key on Wayland? https://askubuntu.com/questions/1498907/how-do-i-disable-the-insert-key-on-wayland

How can I disable the insert key on Ubuntu 22.04 in Wayland?

In X11, it was simple:

# Figure out what keycode is mapped to insert key.
xmodmap -pke | grep -i insert

# Disable it.
echo "keycode 90 =" >> ~/.Xmodmap

Is there no similar remapping functionality in Wayland?

How to Change Permissions on an External Drive https://askubuntu.com/questions/1424007/how-to-change-permissions-on-an-external-drive

Newbie here.

I've got an external hard drive (EXT.4 format) that I'm trying to use as a destination for LuckyBackup.

It seems that I don't have permissions to use the hard drive.

I've tried to change permissions through 'Properties/Permissions' where it defines the user as 'root' and the group as 'root.' It also says that I am not the owner so I can't change the permissions.

I've also tried this solution: https://forum.manjaro.org/t/mount-a-external-hard-drive-with-execute-permissions/39767/4 but my 'directory' could not be recognized (even though the drive was mounted).

Does anyone have any advice?

Thanks!

Ubuntu 22.04: Add menu items to the Gnome Desktop context menu https://askubuntu.com/questions/1420843/ubuntu-22-04-add-menu-items-to-the-gnome-desktop-context-menu

Recently installed Ubuntu 22.04 (my first foray into Linux).

One thing I got involved with from the get-go was adding custom entries to the context menus. Basically, using python3-nautilus, I managed to add menu items to context menus of folders (via get_background_items) and files (via get_file_items). For files, I could even add the custom entries for all files or specific file types by filtering mime-types. So far so good.

What I haven't been able to figure out was how to add items to the Gnome Desktop context menu. I presume the Gnome Desktop is closely tied to the Nautilus file manager but I have no idea how to go about customizing the Desktop context menu using python-nautilus.

Any help please?

EDIT: For example, the right click context menu for folder backgrounds (empty space in a folder window) now has two additional custom items, Calculator and Text Editor, that allow me to launch those apps from within the context menu. I would like to achieve the same thing (or at least something in the same vein) for the desktop right click menu.

enter image description here

To further explain how the above customization was achieved, first, I installed python3-nautilus, and then I created a Python script (well, I actually created several scripts for different functionality) in the Home/.local/share/nautilus-python/extensions folder with the following code:

import os

from gi.repository import Nautilus, GObject

class BackgroundItemMenuProvider(GObject.GObject, Nautilus.MenuProvider):
    def __init__(self):
        pass

    def menu_activate_cb_gcalc(self, menu, file):
         os.system("gnome-calculator & pid=$!")
         
    def menu_activate_cb_gedit(self, menu, file):
         os.system("gnome-text-editor --new-window & pid=$!")

    def get_background_items(self, window, file):
        item_gcalc = Nautilus.MenuItem(name='BackgroundItemMenuProvider::Calculator', 
                                       label='Calculator', 
                                       tip='',
                                       icon='')
        item_gcalc.connect('activate', self.menu_activate_cb_gcalc, file)
        item_gedit = Nautilus.MenuItem(name='BackgroundItemMenuProvider::TextEditor', 
                                       label='Text Editor', 
                                       tip='',
                                       icon='')
        item_gedit.connect('activate', self.menu_activate_cb_gedit, file)
        return item_gcalc,item_gedit,
Touch pad and touch screen are not working after upgrading to ubuntu 22.04 https://askubuntu.com/questions/1402796/touch-pad-and-touch-screen-are-not-working-after-upgrading-to-ubuntu-22-04

I have laptop Acer spin 5 "Spin SP513-54N" and had ubutnu 21.10 installed on it. At first, the touch pad and touch screen were not working so I followed the instructions in this page and it fixed it: https://sciactive.com/2020/12/04/how-to-install-ubuntu-on-acer-spin-5-sp513-54n-for-the-perfect-linux-2-in-1/

sudo gedit /etc/default/grub
Add pci=nocrs to the end of the options for GRUB_CMDLINE_LINUX_DEFAULT. It should look something like this:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pci=nocrs"
sudo update-grub

Later when I upgraded to ubuntu 22.04, touch pad and touch screen stopped working again When ubuntu 22.04 starts up before applying GRUB fix, I get this error: enter image description here

Ubuntu starts fine but the touch is not working. But when I apply the fix, ubuntu 22.04 fails to start with this error: enter image description here

I tried every fix I could possible find online but nothing works. plz help me with this issue as the computer is not usable without touch pad

How play music with Ubuntu 18.04 using Airplay? https://askubuntu.com/questions/1161092/how-play-music-with-ubuntu-18-04-using-airplay

Like on Macintosh (or even Windows, I suppose), iTunes will immediately recognize and use wireless streaming to play music via an Airplay device. I want my Ubuntu to do that. Simultaneous output, separate volume controls, play/pause, etc.

(BTW iTunes works fine, even the compact version from my iPad.)

I installed paprefs which gave Gnome a GUI, when installed with pulseaudio-module-raop, it adds a sound device, as advertised. But when I load my audio-player (tried many...) and play music, no sound is emitted when I select that device, although it will play fine on using the desktop-speakers - when selected. It never asked for the password. (I suspect this is why it doesn't work).

(I have tried many suggestions on ~oogle and all have failed.) Also I've tried many solutions (like airplay.jar, open-airplay, etc.) and they don't work with 18.04 and most are no longer maintained.

Hopefully there just an audio-player (like iTunes) for Ubuntu 18.04 that just plays to desktop-speakers as well as my home theatre.

Otherwise I can attempt to build from the code in say, open-airplay...

Ideas / suggestions... Has any Ubuntu users got a similar situation working - if so, how?

No such file or directory - bash https://askubuntu.com/questions/1144290/no-such-file-or-directory-bash

I am running out of ideas (and sources of ideas) on this one. I am getting a file-path from Audacious, and trying to get album art from the directory referenced. The info provided is correct, and works in terminal.

Things I have tried:

  1. Redirected variable to a file, and looked with hexedit for odd characters.

  2. Checked script for odd characters the same way.

  3. Executed the script with /bin/bash directly.

  4. Made a new script with only the non-functional code.

  5. Because the path returned is relative [~/Music/Eagles/Desperado] have tried it as [/home/freebird/Music/Eagles/Desperado].

  6. Because [Music] is a soft link to another drive have tried it as [/mnt/data/Music/Eagles/Desperado]

  7. Have been using the Eagles because I didn't want to deal with [~/Music/Alice Cooper/School's Out] until I had the simpler case working!

  8. IT does not have any CR's or other extraneous characters from editing on Windows or elsewhere - haven't used Windows for anything but Freecell and Spider Solitaire since 2007.

  9. Nothing so far can resolve the resulting path into usability from inside the script, ALL work from the terminal (including cd).

Here is the actual error message from a recent try:

freebird@nest:~$ ~/check.sh
/home/freebird/check.sh: line 8: cd: ~/Music/Eagles/Desperado: No such file or directory

Any further suspects for me?

Here is the check script for testing:

#!/bin/bash
file_path=`audtool --current-song-tuple-data file-path`
echo > test2 ${file_path}
#${file-path}="/mnt/data/""${file_path:2}"
echo > testpath ${file_path}
cd "${file_path}"
#cd -P "${file-path}"
pwd
exit 1
if [[ ! -e "folder.jpg" ]];   # if no art work found
    then
    cp ~/Work/headphone.png /tmp/cover.png # put in placeholder
    echo "Placeholder"
 else
    convert "${file_path}""/folder.jpg" -resize 120x120 /tmp/cover.png # ready for showing
    echo "found cover"
 fi

It contains various 'test' additions still, the equivalent of scattered printf() to see what's going on :)

new version of testing script:

#!/bin/bash
file_path=`audtool --current-song-tuple-data file-path`
file_path=$(eval echo $file_path)
echo > test2 ${file_path}
${file-path}="$HOME"${file_path:1}
echo > testpath ${file_path}
cd ${file-path}
#cd -P "${file-path}"
pwd
exit 1
if [[ ! -e "folder.jpg" ]];   # if no art work found
    then
    cp ~/Work/headphone.png /tmp/cover.png # put in placeholder
    echo "Placeholder"
 else
    convert "${file_path}""/folder.jpg" -resize 120x120 /tmp/cover.png # ready for showing
    echo "found cover"
 fi

New error messages:

freebird@nest:~$ ~/check.sh
/home/freebird/check.sh: line 5: path=/home/freebirdhome/freebird/Music/Eagles/Desperado: No such file or directory
/home/freebird/check.sh: line 7: cd: path: No such file or directory
/home/freebird
freebird@nest:~$ 
UBUNTU 18.04 Server: multiple netplan route-policy rules, but only one works https://askubuntu.com/questions/1117580/ubuntu-18-04-server-multiple-netplan-route-policy-rules-but-only-one-works

UBUNTU SERVER 18.04 LTS with 2 GE NICs

eno1: 172.22.1.1/20
eno2: 10.11.1.34/30

netplan yaml:

network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      addresses: [ 172.22.1.1/20 ]
      gateway4: 172.22.0.1
      nameservers:
          addresses:
          - "172.22.0.53"
      routing-policy:
        - to: 172.22.224.0/19
          table: 211
          priority: 10
        - to: 192.168.201.0/24
          table: 200
          priority: 20
      routes:
        - to: 0.0.0.0/0
          via: 172.22.0.254
          table: 211
        - to: 0.0.0.0/0
          via: 172.22.0.1
          table: 200

    eno2:
      addresses: [ 10.11.1.34/30 ]
      routing-policy:
        - from: 10.11.1.34
          table: 222
          priority: 8
        - to: 10.128.0.0/16
          table: 222
          priority: 5
      routes:
        - to: 0.0.0.0/0
          via: 10.11.1.33
          table: 222

When I apply the configuration, restart the networking or use netplan apply, only one of these routing-policies works:

When I use netplan apply:

  1. eno1:

    • First time, only the first routing-policy works.
    • Second time, only the second routing-policy works.
    • Third time, only the first routing-policy works.
  2. eno2

    • Every time, only the second routing-policy works.

I wrote the yaml file as the netplan.io examples told.

It is normal Ubuntu installation remain in "Detecting File Systems" long? https://askubuntu.com/questions/473487/it-is-normal-ubuntu-installation-remain-in-detecting-file-systems-long

It is normal for Ubuntu installation to remain at the "Detecting File Systems" stage for long? I followed all the steps as recommended, I have created the partition "/" and "Home", I am now waiting on the installation window while I get the message "detecting file systems". It's been about two hours.

Installing Ubuntu 14 from a DVD.

Ubuntu Server Port 80 not reachable/closed https://askubuntu.com/questions/424013/ubuntu-server-port-80-not-reachable-closed

I am running Ubuntu server 12.04 with Apache2.

My port 80 is not reachable and closed. Any idea how can I open it so I can access to my web admin?

I noticed that port 80 is reachable under LAN, but its not able to reach outside of LAN even I had done port forwarding.

What should I do?

Thanks.

How can I create one logical volume over two disks using LVM? https://askubuntu.com/questions/219881/how-can-i-create-one-logical-volume-over-two-disks-using-lvm

Hi. I've got a working Ubuntu 12.04 server, which is going to serve as media server. I've added two disks of size 3TB to put my data on, and I wish to combine these as one 6TB logical volume which I could mount under /media.

So far, I have created one partition on each disks with fdisk and formatted them to ext3. But now I am stuck on how to continue. Do I use Mdadm to create a Jbod array? Or do I use LVM to make a logical volume of these two disks? I can't seem to find the documentation I need, it's mostly about extending existing volumes or installing a fresh system which I don't need.

My OS is on /dev/sdc1 (it's a USB thumb-drive), and the two newly created partitions are on /dev/sda1 and /dev/sdb1.

Hope you can give me some directions.

Making diff output more readable https://askubuntu.com/questions/12215/making-diff-output-more-readable

I'm looking for a tool that will take diff / debdiff output (and more specifically, the output of this script) and display the result of the comparison in a highly readable, graphical way. Any pointers would be appreciated.

Ideally, it would be the GTK+, FOSS equivalent of MDR.

Meld, Diffuse and similar software are not fit for this purpose, since they're intended to work standalone, and don't take input from stdin.