HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/share/session-migration/scripts/ubuntu-volume-amplification-to-gnome
#!/usr/bin/python3

from gi.repository import Gio
import sys

UBUNTU_VOLUME_SETTINGS = "com.ubuntu.sound"
UBUNTU_VOLUME_AMPLIFIED_KEY = "allow-amplified-volume"

GNOME_VOLUME_SETTINGS = "org.gnome.desktop.sound"
GNOME_VOLUME_AMPLIFIED_KEY = "allow-volume-above-100-percent"


if __name__ == "__main__":
    source = Gio.SettingsSchemaSource.get_default()
    # Old and new keys installed
    if (source.lookup(UBUNTU_VOLUME_SETTINGS, True) is None or
        source.lookup(GNOME_VOLUME_SETTINGS, True) is None):
        print("Missing ubuntu or gnome volume key: no migration needed")
        sys.exit(0)

    src_settings = Gio.Settings.new(UBUNTU_VOLUME_SETTINGS)
    dst_settings = Gio.Settings.new(GNOME_VOLUME_SETTINGS)
    if not dst_settings.is_writable(GNOME_VOLUME_AMPLIFIED_KEY):
        print("Can't migrate amplification key to GNOME one as they are not writable")
        sys.exit(0)

    volume_is_amplified = src_settings.get_boolean(UBUNTU_VOLUME_AMPLIFIED_KEY)
    dst_settings.set_boolean(GNOME_VOLUME_AMPLIFIED_KEY, volume_is_amplified)
    dst_settings.sync()