diff --git a/tromjaro/gnome/Packages-Desktop b/tromjaro/gnome/Packages-Desktop
index 6d516e7b..7aa0b1be 100644
--- a/tromjaro/gnome/Packages-Desktop
+++ b/tromjaro/gnome/Packages-Desktop
@@ -52,7 +52,6 @@ ffmpegthumbnailer
linux510-headers
gnome-firmware
manjaro-printer
-linux-latest
rebuild-detector
@@ -102,7 +101,6 @@ gnome-font-viewer
gnome-keyring
fprintd #need for finger id reader
gnome-session
-gnome-initial-setup
gnome-settings-daemon
gnome-shell
gnome-system-log
diff --git a/tromjaro/gnome/desktop-overlay/etc/default/grub b/tromjaro/gnome/desktop-overlay/etc/default/grub
new file mode 100644
index 00000000..26481303
--- /dev/null
+++ b/tromjaro/gnome/desktop-overlay/etc/default/grub
@@ -0,0 +1,60 @@
+GRUB_DEFAULT=saved
+GRUB_TIMEOUT=5
+GRUB_TIMEOUT_STYLE=hidden
+GRUB_DISTRIBUTOR="TROMjaro"
+GRUB_CMDLINE_LINUX_DEFAULT="quiet udev.log_priority=3"
+GRUB_CMDLINE_LINUX=""
+
+# If you want to enable the save default function, uncomment the following
+# line, and set GRUB_DEFAULT to saved.
+GRUB_SAVEDEFAULT=true
+
+# Preload both GPT and MBR modules so that they are not missed
+GRUB_PRELOAD_MODULES="part_gpt part_msdos"
+
+# Uncomment to enable booting from LUKS encrypted devices
+#GRUB_ENABLE_CRYPTODISK=y
+
+# Uncomment to use basic console
+GRUB_TERMINAL_INPUT=console
+
+# Uncomment to disable graphical terminal
+#GRUB_TERMINAL_OUTPUT=console
+
+# The resolution used on graphical terminal
+# note that you can use only modes which your graphic card supports via VBE
+# you can see them in real GRUB with the command 'videoinfo'
+GRUB_GFXMODE=auto
+
+# Uncomment to allow the kernel use the same resolution used by grub
+GRUB_GFXPAYLOAD_LINUX=keep
+
+# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
+# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
+#GRUB_DISABLE_LINUX_UUID=true
+
+# Uncomment to disable generation of recovery mode menu entries
+GRUB_DISABLE_RECOVERY=true
+
+# Uncomment this option to enable os-prober execution in the grub-mkconfig command
+GRUB_DISABLE_OS_PROBER=false
+
+# Uncomment and set to the desired menu colors. Used by normal and wallpaper
+# modes only. Entries specified as foreground/background.
+GRUB_COLOR_NORMAL="light-gray/black"
+GRUB_COLOR_HIGHLIGHT="green/black"
+
+# Uncomment one of them for the gfx desired, a image background or a gfxtheme
+#GRUB_BACKGROUND="/usr/share/grub/background.png"
+#GRUB_THEME="/path/to/gfxtheme"
+
+# Uncomment to get a beep at GRUB start
+#GRUB_INIT_TUNE="480 440 1"
+
+# Uncomment to ensure that the root filesystem is mounted read-only so that
+# systemd-fsck can run the check automatically. We use 'fsck' by default, which
+# needs 'rw' as boot parameter, to avoid delay in boot-time. 'fsck' needs to be
+# removed from 'mkinitcpio.conf' to make 'systemd-fsck' work.
+# See also Arch-Wiki: https://wiki.archlinux.org/index.php/Fsck#Boot_time_checking
+#GRUB_ROOT_FS_RO=true
+
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js
index 1d820f67..814376fa 100644
--- a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js
+++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js
@@ -23,13 +23,162 @@ const { Atk, St, GObject, GLib } = imports.gi;
const Gvc = imports.gi.Gvc;
const ExtensionUtils = imports.misc.extensionUtils;
+const Config = imports.misc.config;
const Me = ExtensionUtils.getCurrentExtension();
const Lib = Me.imports.convenience;
const _d = Lib._log;
const Prefs = Me.imports.prefs;
const SignalManager = Lib.SignalManager;
-let maxId = -1;
+function _isDeviceInValid(uidevice) {
+ return (!uidevice || (uidevice.description != null && uidevice.description.match(/Dummy\s+(Output|Input)/gi)));
+}
+
+function getMixerControl() {
+ return VolumeMenu.getMixerControl();
+}
+
+var ProfileMenuItem = class ProfileMenuItem
+ extends PopupMenu.PopupMenuItem {
+ constructor(id, title, profileName, callback) {
+ super(title);
+ this._init(id, title, profileName, callback);
+ }
+
+ _init(id, title, profileName, callback) {
+ if (super._init) {
+ super._init(title);
+ }
+ _d("ProfileMenuItem: _init:" + title);
+ this.id = id;
+ this.profileName = profileName;
+ this._ornamentLabel.set_style("min-width: 3em;margin-left: 3em;");
+ this.setProfileActive(false);
+ this.connect('activate', () => {
+ _d("Activating Profile:" + id + profileName);
+ callback(this.id, this.profileName);
+ });
+ }
+
+ setProfileActive(active) {
+ if (active) {
+ this.setOrnament(PopupMenu.Ornament.DOT);
+ // this._ornamentLabel.text = "\u2727";
+ this._ornamentLabel.text = "\u266A";
+ if (this.add_style_pseudo_class) {
+ this.remove_style_pseudo_class('insensitive');
+ }
+ else {
+ this.actor.remove_style_pseudo_class('insensitive');
+ }
+ }
+ else {
+ this.setOrnament(PopupMenu.Ornament.NONE);
+ if (this.add_style_pseudo_class) {
+ this.add_style_pseudo_class('insensitive');
+ }
+ else {
+ this.actor.add_style_pseudo_class('insensitive');
+ }
+ }
+ }
+
+ setVisibility(visibility) {
+ this.actor.visible = visibility;
+ }
+}
+
+var SoundDeviceMenuItem = class SoundDeviceMenuItem extends PopupMenu.PopupImageMenuItem {
+ constructor(id, title, icon_name, profiles, callback, profileCallback) {
+ super(title, icon_name);
+ this._init(id, title, icon_name, profiles, callback, profileCallback);
+ }
+
+ _init(id, title, icon_name, profiles, callback, profileCallback) {
+ if (super._init) {
+ super._init(title, icon_name);
+ }
+ _d("SoundDeviceMenuItem: _init:" + title);
+ this.id = id;
+ this.title = title;
+ this.icon_name = icon_name;
+ this.profiles = (profiles) ? profiles : [];
+
+ this.profilesitems = new Map();
+ for (let profile of this.profiles) {
+ if (!this.profilesitems.has(profile.name)) {
+ this.profilesitems.set(profile.name, new ProfileMenuItem(id, "Profile: " + profile.human_name, profile.name, profileCallback));
+ }
+ }
+
+ this.connect('activate', () => {
+ _d("Device Change request for " + id);
+ callback(this.id);
+ });
+ this.available = true;
+ this.activeProfile = "";
+ this.activeDevice = false;
+ this.visible = false;
+ }
+
+ isAvailable() {
+ return this.available;
+ }
+
+ setAvailable(_ac) {
+ this.available = _ac;
+ }
+
+ setActiveProfile(_p) {
+ if (_p && this.activeProfile != _p) {
+ if (this.profilesitems.has(this.activeProfile)) {
+ this.profilesitems.get(this.activeProfile).setProfileActive(false);
+ }
+ this.activeProfile = _p;
+ if (this.profilesitems.has(_p)) {
+ this.profilesitems.get(_p).setProfileActive(true);
+ }
+ }
+ }
+
+ setVisibility(_v) {
+ this.actor.visible = _v;
+ if (!_v) {
+ this.profilesitems.forEach((p) => p.setVisibility(false));
+ }
+ this.visible = _v;
+ };
+
+ isVisible() {
+ return this.visible;
+ }
+
+ setActiveDevice(_a) {
+ this.activeDevice = _a;
+ if (!_a) {
+ this.setOrnament(PopupMenu.Ornament.NONE);
+ }
+ else {
+ this.setOrnament(PopupMenu.Ornament.CHECK);
+ this._ornamentLabel.text = '\u266B';
+ }
+ }
+
+ setProfileVisibility(_v) {
+ this.profilesitems.forEach(p =>
+ p.setVisibility(_v && this.canShowProfile()));
+ }
+
+ canShowProfile() {
+ return (this.isVisible() && this.profilesitems.size > 1);
+ }
+}
+
+if (parseFloat(Config.PACKAGE_VERSION) >= 3.34) {
+ ProfileMenuItem = GObject.registerClass({ GTypeName: 'ProfileMenuItem' }, ProfileMenuItem);
+
+ SoundDeviceMenuItem = GObject.registerClass({ GTypeName: 'SoundDeviceMenuItem' }, SoundDeviceMenuItem);
+}
var SoundDeviceChooserBase = class SoundDeviceChooserBase {
@@ -37,37 +186,35 @@ var SoundDeviceChooserBase = class SoundDeviceChooserBase {
_d("SDC: init");
this.menuItem = new PopupMenu.PopupSubMenuMenuItem('Extension initialising...', true);
this.deviceType = deviceType;
- this._devices = {};
- this._cards = [];
- this._availableDevicesIds = {};
- this._control = VolumeMenu.getMixerControl();
+ this._devices = new Map();
+ let _control = this._getMixerControl();
this._settings = Lib.getSettings(Prefs.SETTINGS_SCHEMA);
- _d("Constructor" + deviceType);
+ _d("Constructor:" + deviceType);
this._setLog();
this._signalManager = new SignalManager();
this._signalManager.addSignal(this._settings, "changed::" + Prefs.ENABLE_LOG, this._setLog.bind(this));
- if (this._control.get_state() == Gvc.MixerControlState.READY) {
- this._onControlStateChanged();
+ if (_control.get_state() == Gvc.MixerControlState.READY) {
+ this._onControlStateChanged(_control);
}
else {
- this._controlStateChangeSignal = this._signalManager.addSignal(this._control, "state-changed", this._onControlStateChanged.bind(this));
+ this._controlStateChangeSignal = this._signalManager.addSignal(_control, "state-changed", this._onControlStateChanged.bind(this));
}
}
+ _getMixerControl() { return getMixerControl(); }
+
_setLog() { Lib.setLog(this._settings.get_boolean(Prefs.ENABLE_LOG)); }
- _onControlStateChanged() {
- if (this._control.get_state() == Gvc.MixerControlState.READY) {
+ _onControlStateChanged(control) {
+ if (control.get_state() == Gvc.MixerControlState.READY) {
if (!this._initialised) {
this._initialised = true;
- this._signalManager.addSignal(this._control, this.deviceType + "-added", this._deviceAdded.bind(this));
- this._signalManager.addSignal(this._control, this.deviceType + "-removed", this._deviceRemoved.bind(this));
- this._signalManager.addSignal(this._control, "active-" + this.deviceType + "-update", this._deviceActivated.bind(this));
- this._signalManager.addSignal(this._control, "card-removed", this._updateCards.bind(this));
- this._signalManager.addSignal(this._control, "card-added", this._updateCards.bind(this));
+ this._signalManager.addSignal(control, this.deviceType + "-added", this._deviceAdded.bind(this));
+ this._signalManager.addSignal(control, this.deviceType + "-removed", this._deviceRemoved.bind(this));
+ this._signalManager.addSignal(control, "active-" + this.deviceType + "-update", this._deviceActivated.bind(this));
this._signalManager.addSignal(this._settings, "changed::" + Prefs.HIDE_ON_SINGLE_DEVICE, this._setChooserVisibility.bind(this));
this._signalManager.addSignal(this._settings, "changed::" + Prefs.SHOW_PROFILES, this._setProfileVisibility.bind(this));
@@ -79,7 +226,6 @@ var SoundDeviceChooserBase = class SoundDeviceChooserBase {
this._signalManager.addSignal(this._settings, "changed::" + this._show_device_signal, this._setVisibility.bind(this));
- //this._portsSettings = JSON.parse(this._settings.get_string(Prefs.PORT_SETTINGS));
this._portsSettings = Prefs.getPortsFromSettings(this._settings);
/**
@@ -91,33 +237,25 @@ var SoundDeviceChooserBase = class SoundDeviceChooserBase {
*/
let id = 0;
- if (maxId < 0) {
- let dummyDevice = new Gvc.MixerUIDevice();
- maxId = dummyDevice.get_id();
- }
- _d("Max Id:" + maxId);
-
- let defaultDevice = this.getDefaultDevice();
- while (++id < maxId) {
- let uidevice = this._deviceAdded(this._control, id);
- if (uidevice) {
- let stream = this._control.get_stream_from_device(uidevice);
- if (stream) {
- let stream_port = stream.get_port();
- let uidevice_port = uidevice.get_port();
- if (((!stream_port && !uidevice_port) ||
- (stream_port && stream_port.port === uidevice_port)) &&
- stream == defaultDevice) {
- this._deviceActivated(this._control, id);
- }
- }
+ let dummyDevice = new Gvc.MixerUIDevice();
+ let maxId = dummyDevice.get_id();
+
+ _d("Max Id:" + maxId);
+
+ while (++id < maxId) {
+ this._deviceAdded(control, id);
+ }
+ let defaultStream = this.getDefaultStream(control);
+ if (defaultStream) {
+ let defaultDevice = control.lookup_device_from_stream(defaultStream);
+ if (defaultDevice) {
+ this._deviceActivated(control, defaultDevice.get_id());
}
}
- //We dont have any way to understand that the profile has changed in the settings
- //Just an useless workaround and potentially crashes shell
- this.activeProfileTimeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 2000,
- this._setActiveProfile.bind(this));
+
+ let profileVisibility = this._settings.get_boolean(Prefs.SHOW_PROFILES);
+ this._setProfileTimer(profileVisibility);
if (this._controlStateChangeSignal) {
this._controlStateChangeSignal.disconnect();
@@ -128,197 +266,131 @@ var SoundDeviceChooserBase = class SoundDeviceChooserBase {
}
}
- _updateCards(control, cardId) {
- this._cards = [];
- let cards = this._control.get_cards();
- for (let card of cards) {
- this._cards.push(card.index);
+ _setProfileTimer(v) {
+ //We dont have any way to understand that the profile has changed in the settings
+ //Just an useless workaround
+ if (v) {
+ if (!this.activeProfileTimeout) {
+ this.activeProfileTimeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 2000,
+ this._setActiveProfile.bind(this));
+ }
+ }
+ else {
+ if (this.activeProfileTimeout) {
+ GLib.source_remove(this.activeProfileTimeout);
+ this.activeProfileTimeout = null;
+ }
}
}
+
_deviceAdded(control, id, dontcheck) {
- let obj = this._devices[id];
- let uidevice = null;
-
- _d("Added - "+ id);
+ let obj = this._devices.get(id);
+ let uidevice = this.lookupDeviceById(control, id);
+
+ _d("Added - " + id);
if (!obj) {
- uidevice = this.lookupDeviceById(id);
- if (!uidevice || uidevice.description.match(/Dummy\s+(Output|Input)/gi)) {
+ if (_isDeviceInValid(uidevice)) {
return null;
}
- obj = new Object();
- obj.id = id;
- obj.uidevice = uidevice;
- obj.text = uidevice.description;
+ let title = uidevice.description;
if (uidevice.origin != "")
- obj.text += " - " + uidevice.origin;
-
- /*
- * obj.item = this.menu.addAction( obj.text, function() {
- * this.changeDevice(uidevice); }.bind(this)); let icon =
- * uidevice.get_icon_name(); if(icon == null || icon.trim() == "")
- * icon = this.getDefaultIcon(); obj.item._icon = new St.Icon({
- * style_class: 'popup-menu-icon', icon_name: this._getIcon(icon)});
- * obj.item.actor.insert_child_at_index(obj.item._icon,1);
- */
+ title += " - " + uidevice.origin;
let icon = uidevice.get_icon_name();
if (icon == null || icon.trim() == "")
icon = this.getDefaultIcon();
- let icon_name = this._getIcon(icon);
+ icon = this._getIcon(icon);
- obj.item = this.menuItem.menu.addAction(obj.text, function() {
- _d("Device Change request");
- this.changeDevice(uidevice);
- }.bind(this), icon_name);
+ obj = new SoundDeviceMenuItem(id, title, icon, Lib.getProfiles(control, uidevice), this._changeDeviceBase.bind(this), this._profileChangeCallback.bind(this));
- if (!obj.profiles) {
- obj.profiles = Lib.getProfiles(control, uidevice);
- }
+ this.menuItem.menu.addMenuItem(obj);
+ obj.profilesitems.forEach(i => this.menuItem.menu.addMenuItem(i));
- if (!obj.profilesitems) {
- obj.profilesitems = [];
- }
- this._devices[id] = obj;
+ this._devices.set(id, obj);
+ }
+ else if (obj.isAvailable()) {
+ return //uidevice;
}
else {
- uidevice = obj.uidevice;
+ obj.setAvailable(true);
}
- _d("Device Name:" + obj.text);
-
- if (obj.profiles) {
- for (let profile of obj.profiles) {
- _d("Profile:" + profile.name);
- }
- }
-
- if (obj.active) {
- return uidevice;
- }
+ _d("Device Name:" + obj.title);
_d("Added: " + id + ":" + uidevice.description + ":" + uidevice.port_name + ":" + uidevice.origin);
- if (!this._availableDevicesIds[id]) {
- this._availableDevicesIds[id] = 0;
- }
- this._availableDevicesIds[id]++;
- obj.active = true;
- let stream = this._control.get_stream_from_device(uidevice);
+ let stream = control.get_stream_from_device(uidevice);
if (stream) {
- obj.activeProfile = uidevice.get_active_profile();
+ obj.setActiveProfile(uidevice.get_active_profile());
}
- else {
- obj.activeProfile = "";
- }
- //let showProfiles = this._settings.get_boolean(Prefs.SHOW_PROFILES);
- if (obj.profiles) {
- for (let profile of obj.profiles) {
- let profileItem = obj.profilesitems[profile.name];
- if (!profileItem) {
- let profileName = profile.name;
- profileItem = this.menuItem.menu.addAction("Profile: " + profile.human_name, function() {
- _d("i am setting profile, " + profile.human_name + ":" + uidevice.description + ":" + uidevice.port_name);
- let stream = this._control.get_stream_from_device(uidevice);
- //No Active stream probably inactive port
- if (!stream) {
- return;
- }
- if (this._activeDevice && this._activeDevice.uidevice !== uidevice) {
- _d("Changing active device to " + uidevice.description + ":" + uidevice.port_name);
- this.changeDevice(uidevice);
- }
- this._control.change_profile_on_selected_device(uidevice, profileName);
- this._setDeviceActiveProfile(obj);
- }.bind(this));
- obj.profilesitems[profileName] = profileItem;
- profileItem.setProfileActive = function(active) {
- if (active) {
- // this._ornamentLabel.text = "\u2727";
- this._ornamentLabel.text = "\u266A";
- if (this.add_style_pseudo_class) {
- this.add_style_pseudo_class('checked');
- this.remove_style_pseudo_class('insensitive');
- }
- else {
- this.actor.add_style_pseudo_class('checked');
- this.actor.remove_style_pseudo_class('insensitive');
- }
- }
- else {
- this._ornamentLabel.text = "";
- if (this.add_style_pseudo_class) {
- this.remove_style_pseudo_class('checked');
- this.add_style_pseudo_class('insensitive');
- }
- else {
- this.actor.remove_style_pseudo_class('checked');
- this.actor.add_style_pseudo_class('insensitive');
- }
- }
- };
- // profileItem._ornamentLabel.width = "500em";
- profileItem._ornamentLabel.set_style("min-width: 3em;margin-left: 3em;");
- }
- profileItem.setProfileActive(obj.activeProfile == profile.name);
- }
- }
- if (!dontcheck && !this._canShowDevice(uidevice, uidevice.port_available)) {
+ if (!dontcheck && !this._canShowDevice(control, uidevice, uidevice.port_available)) {
this._deviceRemoved(control, id, true);
}
+
this._setChooserVisibility();
this._setVisibility();
- return uidevice;
+ return //uidevice;
+ }
+
+ _profileChangeCallback(id, profileName) {
+ let control = this._getMixerControl();
+ let uidevice = this.lookupDeviceById(control, id);
+ if (!uidevice) {
+ this._deviceRemoved(control, id);
+ }
+ else {
+ _d("i am setting profile, " + profileName + ":" + uidevice.description + ":" + uidevice.port_name);
+ if (id != this._activeDeviceId) {
+ _d("Changing active device to " + uidevice.description + ":" + uidevice.port_name);
+ this._changeDeviceBase(id, control);
+ }
+ control.change_profile_on_selected_device(uidevice, profileName);
+ this._setDeviceActiveProfile(control, this._devices.get(id));
+ }
}
_deviceRemoved(control, id, dontcheck) {
- let obj = this._devices[id];
- //delete this._devices[id];
- if (obj && obj.active) {
- _d("Removed: " + id + ":" + obj.uidevice.description + ":" + obj.uidevice.port_name + ":" + obj.uidevice.origin);
- if (!dontcheck && this._canShowDevice(obj.uidevice, false)) {
+ let obj = this._devices.get(id);
+ //let uidevice = this.lookupDeviceById(control,id);
+ if (obj && obj.isAvailable()) {
+ _d("Removed: " + id + ":" + obj.title);
+ /*
+ if (!dontcheck && this._canShowDevice(control, uidevice, false)) {
_d('Device removed, but not hiding as its set to be shown always');
return;
- }
- delete this._availableDevicesIds[id];
- obj.item.actor.visible = false;
- obj.active = false;
- if (obj.profiles) {
- for (let profile of obj.profiles) {
- let profileItem = obj.profilesitems[profile.name];
- if (profileItem) {
- profileItem.actor.visible = false;
- }
- }
- }
+ }*/
+ obj.setVisibility(false);
+ obj.setAvailable(false);
+ /*
if (this.deviceRemovedTimout) {
GLib.source_remove(this.deviceRemovedTimout);
this.deviceRemovedTimout = null;
}
+ */
/**
* If the active uidevice is removed, then need to activate the
* first available uidevice. However for some cases like Headphones,
* when the uidevice is removed, Speakers are automatically
* activated. So, lets wait for sometime before activating.
*/
- this.deviceRemovedTimout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1500, function() {
- _d("Device Removed timeout");
- if (obj === this._activeDevice) {
- for (let id in this._devices) {
- let device = this._devices[id];
- if (device.active == true) {
- this.changeDevice(device.uidevice);
- break;
- }
- }
- }
- this.deviceRemovedTimout = null;
- return false;
- }.bind(this));
+ /* THIS MAY NOT BE NEEDED AS SHELL SEEMS TO ACTIVATE NEXT DEVICE
+ this.deviceRemovedTimout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1500, function() {
+ _d("Device Removed timeout");
+ if (obj === this._activeDevice) {
+ let device = Object.keys(this._devices).map((id) => this._devices[id]).find(({active}) => active === true);
+ if(device){
+ this._changeDeviceBase(this._getMixerControl(), device.id);
+ }
+ }
+ this.deviceRemovedTimout = null;
+ return false;
+ }.bind(this));
+ */
this._setChooserVisibility();
this._setVisibility();
}
@@ -326,76 +398,77 @@ var SoundDeviceChooserBase = class SoundDeviceChooserBase {
_deviceActivated(control, id) {
_d("Activated:- " + id);
- let obj = this._devices[id];
- if (obj && obj !== this._activeDevice) {
- _d("Activated: " + id + ":" + obj.uidevice.description + ":" + obj.uidevice.port_name + ":" + obj.uidevice.origin);
- if (this._activeDevice) {
- this._activeDevice.item.setOrnament(PopupMenu.Ornament.NONE);
- if (this._activeDevice.item.remove_style_pseudo_class) {
- this._activeDevice.item.remove_style_pseudo_class('checked');
- }
- else {
- this._activeDevice.item.actor.remove_style_pseudo_class('checked');
- }
- }
- this._activeDevice = obj;
- obj.item.setOrnament(PopupMenu.Ornament.CHECK);
- if (obj.item.add_style_pseudo_class) {
- obj.item.add_style_pseudo_class('checked');
- }
- else {
- obj.item.actor.add_style_pseudo_class('checked');
+ let obj = this._devices.get(id);
+ if (!obj) {
+ _d("Activated device not found in the list of devices, try to add");
+ this._deviceAdded(control, id);
+ obj = this._devices.get(id);
+ }
+ if (obj && id != this._activeDeviceId) {
+ _d("Activated: " + id + ":" + obj.title);
+ if (this._activeDeviceId) {
+ this._devices.get(this._activeDeviceId).setActiveDevice(false);
}
+ this._activeDeviceId = id;
+ obj.setActiveDevice(true);
- obj.item._ornamentLabel.text = '\u266B';
- this.menuItem.label.text = obj.text;
+ this.menuItem.label.text = obj.title;
if (!this._settings.get_boolean(Prefs.HIDE_MENU_ICONS)) {
- let icon = obj.uidevice.get_icon_name();
- if (icon == null || icon.trim() == "")
- icon = this.getDefaultIcon();
- this.menuItem.icon.icon_name = this._getIcon(icon);
+ this.menuItem.icon.icon_name = obj.icon_name;
} else {
this.menuItem.icon.gicon = null;
}
}
}
- _setActiveProfile() {
- //_d("Setting Active Profile");
- /*for (let id in this._devices) {
- let device = this._devices[id];
- if (device.active) {
- this._setDeviceActiveProfile(device);
- }
- }*/
- if(this._activeDevice){
- this._setDeviceActiveProfile(this._activeDevice);
+ _changeDeviceBase(id, control) {
+ if (!control) {
+ control = this._getMixerControl();
}
+ let uidevice = this.lookupDeviceById(control, id);
+ if (uidevice) {
+ this.changeDevice(control, uidevice);
+ }
+ else {
+ this._deviceRemoved(control, id);
+ }
+ }
+
+ _setActiveProfile() {
+ if (!this.menuItem._getOpenState()) {
+ return;
+ }
+ let control = this._getMixerControl();
+ //_d("Setting Active Profile");
+ this._devices.forEach(device => {
+ if (device.isAvailable()) {
+ this._setDeviceActiveProfile(control, device);
+ }
+ });
return true;
}
- _setDeviceActiveProfile(device) {
- if (!device.uidevice.port_name || !this._availableDevicesIds[device.id]) {
+ _setDeviceActiveProfile(control, device) {
+ if (!device || !device.isAvailable()) {
return;
}
- let stream = this._control.get_stream_from_device(device.uidevice);
- if (stream) {
- return;
+
+ let uidevice = this.lookupDeviceById(control, device.id);
+ if (!uidevice) {
+ this._deviceRemoved(control, device.id);
}
- let activeProfile = device.uidevice.get_active_profile();
- if (activeProfile && device.activeProfile != activeProfile) {
- device.activeProfile = activeProfile;
- for (let profile of device.profiles) {
- device.profilesitems[profile.name].setProfileActive(profile.name == device.activeProfile);
- }
+ else {
+ let activeProfile = uidevice.get_active_profile();
+ _d("Active Profile:" + activeProfile);
+ device.setActiveProfile(activeProfile);
}
}
_getDeviceVisibility() {
let hideChooser = this._settings.get_boolean(Prefs.HIDE_ON_SINGLE_DEVICE);
if (hideChooser) {
- return (Object.keys(this._availableDevicesIds).length > 1);
+ return (Array.from(this._devices.values()).filter(x => x.isAvailable()).length > 1);
}
else {
return true;
@@ -404,24 +477,16 @@ var SoundDeviceChooserBase = class SoundDeviceChooserBase {
_setChooserVisibility() {
let visibility = this._getDeviceVisibility();
- for (let id in this._availableDevicesIds) {
- this._devices[id].item.actor.visible = visibility;
- }
+ Array.from(this._devices.values()).filter(x => x.isAvailable()).forEach(x => x.setVisibility(visibility))
+
this.menuItem._triangleBin.visible = visibility;
this._setProfileVisibility();
}
_setProfileVisibility() {
let visibility = this._settings.get_boolean(Prefs.SHOW_PROFILES);
- for (let id in this._availableDevicesIds) {
- let device = this._devices[id];
- if (device.profiles) {
- for (let profile of device.profiles) {
- device.profilesitems[profile.name].actor.visible =
- (visibility && device.item.actor.visible && Object.keys(device.profilesitems).length > 1);
- }
- }
- }
+ Array.from(this._devices.values()).filter(x => x.isAvailable()).forEach(device => device.setProfileVisibility(visibility));
+ this._setProfileTimer(visibility);
}
_getIcon(name) {
@@ -432,40 +497,39 @@ var SoundDeviceChooserBase = class SoundDeviceChooserBase {
case Prefs.ICON_THEME_MONOCHROME:
return name + "-symbolic";
default:
- return "none";
+ //return "none";
+ return null;
}
}
_setIcons() {
// Set the icons in the selection list
- for (let id in this._devices) {
- let device = this._devices[id];
- let icon = device.uidevice.get_icon_name();
- if (icon == null || icon.trim() == "")
- icon = this.getDefaultIcon();
- // device.item._icon.icon_name = this._getIcon(icon);
- device.item.setIcon(this._getIcon(icon));
- }
+ let control = this._getMixerControl();
+ this._devices.forEach((device, id) => {
+ let uidevice = this.lookupDeviceById(control, id);
+ if (uidevice) {
+ let icon = uidevice.get_icon_name();
+ if (icon == null || icon.trim() == "")
+ icon = this.getDefaultIcon();
+ _d(icon + " _setIcons")
+ device.setIcon(this._getIcon(icon));
+ }
+ });
// These indicate the active device, which is displayed directly in the
// Gnome menu, not in the list.
if (!this._settings.get_boolean(Prefs.HIDE_MENU_ICONS)) {
- let icon = this._activeDevice.uidevice.get_icon_name();
- if (icon == null || icon.trim() == "")
- icon = this.getDefaultIcon();
-
- this.menuItem.icon.icon_name = this._getIcon(icon);
+ this.menuItem.icon.icon_name = this._getIcon(this._devices.get(this._activeDeviceId).icon_name);
} else {
- this.menuItem.icon.gicon = null;
+ this.menuItem.icon.icon_name = null;
}
}
-
- _canShowDevice(uidevice, defaultValue) {
+ _canShowDevice(control, uidevice, defaultValue) {
if (!uidevice || !this._portsSettings || uidevice.port_name == null || uidevice.description == null) {
return defaultValue;
}
- let stream = this._control.get_stream_from_device(uidevice);
+ let stream = control.get_stream_from_device(uidevice);
let cardName = null;
if (stream) {
let cardId = stream.get_card_index();
@@ -489,10 +553,8 @@ var SoundDeviceChooserBase = class SoundDeviceChooserBase {
switch (port.display_option) {
case 1:
return true;
-
case 2:
return false;
-
default:
return defaultValue;
}
@@ -504,20 +566,21 @@ var SoundDeviceChooserBase = class SoundDeviceChooserBase {
_resetDevices() {
//this._portsSettings = JSON.parse(this._settings.get_string(Prefs.PORT_SETTINGS));
this._portsSettings = Prefs.getPortsFromSettings(this._settings);
- for (let id in this._devices) {
- let device = this._devices[id];
- let uidevice = device.uidevice;
- if (uidevice.port_name == null || uidevice.description == null) {
- _d("Device port_name null or description null");
- continue;
+ let control = this._getMixerControl();
+ for (let id of this._devices.keys()) {
+ let uidevice = this.lookupDeviceById(control, id);
+ if (_isDeviceInValid(uidevice)) {
+ _d("Device is invalid");
}
- switch (this._canShowDevice(uidevice, uidevice.port_available)) {
- case true:
- this._deviceAdded(this._control, uidevice.get_id(), true);
- break;
- case false:
- this._deviceRemoved(this._control, uidevice.get_id(), true);
- break;
+ else {
+ switch (this._canShowDevice(control, uidevice, uidevice.port_available)) {
+ case true:
+ this._deviceAdded(control, id, true);
+ break;
+ case false:
+ this._deviceRemoved(control, id, true);
+ break;
+ }
}
}
}
@@ -528,7 +591,7 @@ var SoundDeviceChooserBase = class SoundDeviceChooserBase {
else
// if setting says to show device, check for any device, otherwise
// hide the "actor"
- this.menuItem.actor.visible = (Object.keys(this._availableDevicesIds).length > 0);
+ this.menuItem.actor.visible = (Array.from(this._devices.values()).some(x => x.isAvailable()));
}
destroy() {
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/convenience.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/convenience.js
index 898a3e8e..c1f32019 100644
--- a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/convenience.js
+++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/convenience.js
@@ -40,12 +40,12 @@ else {
* @schema: (optional): the GSettings schema id Builds and return a GSettings
* schema for
* @schema, using schema files in extensions dir/schemas. If
- * @schema is not provided, it is taken from metadata['settings-schema'].
+ * @schema is not provided, it is taken from metadata["settings-schema"].
*/
function getSettings(schema) {
// let extension = ExtensionUtils.getCurrentExtension();
- schema = schema || Me.metadata['settings-schema'];
+ schema = schema || Me.metadata["settings-schema"];
const GioSSS = Gio.SettingsSchemaSource;
@@ -54,7 +54,7 @@ function getSettings(schema) {
// otherwise assume that extension has been installed in the
// same prefix as gnome-shell (and therefore schemas are available
// in the standard folders)
- let schemaDir = Me.dir.get_child('schemas');
+ let schemaDir = Me.dir.get_child("schemas");
let schemaSource;
if (schemaDir.query_exists(null))
schemaSource = GioSSS.new_from_directory(schemaDir.get_path(), GioSSS.get_default(), false);
@@ -63,8 +63,8 @@ function getSettings(schema) {
let schemaObj = schemaSource.lookup(schema, true);
if (!schemaObj)
- throw new Error('Schema ' + schema + ' could not be found for extension '
- + Me.metadata.uuid + '. Please check your installation.');
+ throw new Error("Schema " + schema + " could not be found for extension "
+ + Me.metadata.uuid + ". Please check your installation.");
let _settings = new Gio.Settings({ settings_schema: schemaObj });
return _settings;
@@ -83,7 +83,7 @@ function getCardByName(card_name) {
if (!cards || Object.keys(cards).length == 0) {
refreshCards();
}
- return Object.keys(cards).map((index) => cards[index]).find(({name}) => name === card_name)
+ return Object.keys(cards).map((index) => cards[index]).find(({ name }) => name === card_name);
}
function getProfiles(control, uidevice) {
@@ -95,22 +95,25 @@ function getProfiles(control, uidevice) {
if (cards && cards[stream.card_index]) {
_log("Getting profile form stream id " + uidevice.port_name);
- return getProfilesForPort(uidevice.port_name, cards[stream.card_index]);
+ let profiles;
+ if ((profiles = getProfilesForPort(uidevice.port_name, cards[stream.card_index]))) {
+ return profiles;
+ }
}
}
else {
/* Device is not active device, lets try match with port name */
refreshCards();
- for (let id in cards) {
+ for(let card of Object.values(cards)) {
let profiles;
- _log("Getting profile from cards " + uidevice.port_name + " for card id " + id);
- if ((profiles = getProfilesForPort(uidevice.port_name, cards[id]))) {
+ _log("Getting profile from cards " + uidevice.port_name + " for card id " + card.id);
+ if ((profiles = getProfilesForPort(uidevice.port_name, card))) {
return profiles;
}
}
}
- return null;
+ return [];
}
let ports;
@@ -127,7 +130,7 @@ function isCmdFound(cmd) {
return true;
}
catch (e) {
- _log('ERROR: ' + cmd + ' execution failed. ' + e);
+ _log("ERROR: " + cmd + " execution failed. " + e);
return false;
}
}
@@ -141,18 +144,18 @@ function refreshCards() {
let newProfLogic = _settings.get_boolean(Prefs.NEW_PROFILE_ID);
if (newProfLogic) {
_log("New logic");
- let pyLocation = Me.dir.get_child('utils/pa_helper.py').get_path();
- let pythonExec = ['python', 'python3', 'python2'].find(cmd => isCmdFound(cmd));
+ let pyLocation = Me.dir.get_child("utils/pa_helper.py").get_path();
+ let pythonExec = ["python", "python3", "python2"].find(cmd => isCmdFound(cmd));
if (!pythonExec) {
- _log('ERROR: Python not found. fallback to default mode');
+ _log("ERROR: Python not found. fallback to default mode");
_settings.set_boolean(Prefs.NEW_PROFILE_ID, false);
Gio.Settings.sync();
newProfLogic = false;
}
else {
try {
- _log('Python found.' + pythonExec);
- let [result, out, err, exit_code] = GLib.spawn_command_line_sync(pythonExec + ' ' + pyLocation);
+ _log("Python found." + pythonExec);
+ let [result, out, err, exit_code] = GLib.spawn_command_line_sync(pythonExec + " " + pyLocation);
// _log("result" + result +" out"+out + " exit_code" +
// exit_code + "err" +err);
if (result && !exit_code) {
@@ -160,13 +163,13 @@ function refreshCards() {
out = ByteArray.toString(out);
}
let obj = JSON.parse(out);
- cards = obj['cards'];
- ports = obj['ports'];
+ cards = obj["cards"];
+ ports = obj["ports"];
}
}
catch (e) {
error = true;
- _log('ERROR: Python execution failed. fallback to default mode' + e);
+ _log("ERROR: Python execution failed. fallback to default mode" + e);
_settings.set_boolean(Prefs.NEW_PROFILE_ID, false);
Gio.Settings.sync();
}
@@ -176,13 +179,16 @@ function refreshCards() {
if (!newProfLogic || error) {
_log("Old logic");
try {
- let [result, out, err, exit_code] = GLib.spawn_command_line_sync('pactl list cards');
+ let env = GLib.get_environ();
+ env = GLib.environ_setenv(env, "LANG", "C", true);
+ let [result, out, err, exit_code] = GLib.spawn_sync(null, ["pactl", "list", "cards"], env, GLib.SpawnFlags.SEARCH_PATH, null);
+ //_log(result+"--"+out+"--"+ err+"--"+ exit_code)
if (result && !exit_code) {
parseOutput(out);
}
}
catch (e) {
- _log('ERROR: pactl execution failed. No ports/profiles will be displayed');
+ _log("ERROR: pactl execution failed. No ports/profiles will be displayed." + e);
}
}
//_log(Array.isArray(cards));
@@ -194,9 +200,9 @@ function refreshCards() {
function parseOutput(out) {
let lines;
if (out instanceof Uint8Array) {
- lines = ByteArray.toString(out).split('\n');
+ lines = ByteArray.toString(out).split("\n");
} else {
- lines = out.toString().split('\n');
+ lines = out.toString().split("\n");
}
let cardIndex;
@@ -210,7 +216,7 @@ function parseOutput(out) {
if ((matches = /^Card\s#(\d+)$/.exec(line))) {
cardIndex = matches[1];
if (!cards[cardIndex]) {
- cards[cardIndex] = { 'index': cardIndex, 'profiles': [], 'ports': [] };
+ cards[cardIndex] = { "index": cardIndex, "profiles": [], "ports": [] };
}
}
else if ((matches = /^\t*Name:\s+(.*?)$/.exec(line)) && cards[cardIndex]) {
@@ -232,30 +238,35 @@ function parseOutput(out) {
if ((matches = /alsa\.card_name\s+=\s+"(.*?)"/.exec(line))) {
cards[cardIndex].alsa_name = matches[1];
}
- else if((matches = /device\.description\s+=\s+"(.*?)"/.exec(line))) {
+ else if ((matches = /device\.description\s+=\s+"(.*?)"/.exec(line))) {
cards[cardIndex].card_description = matches[1];
}
break;
case "PROFILES":
if ((matches = /.*?((?:output|input)[^+]*?):\s(.*?)\s\(sinks:/.exec(line))) {
- cards[cardIndex].profiles.push({ 'name': matches[1], 'human_name': matches[2] });
+ cards[cardIndex].profiles.push({ "name": matches[1], "human_name": matches[2] });
}
break;
case "PORTS":
if ((matches = /\t*(.*?):\s(.*)\s\(.*?priority:/.exec(line))) {
- port = { 'name': matches[1], 'human_name': matches[2], 'card_name': cards[cardIndex].name, 'card_description' : cards[cardIndex].card_description };
+ port = { "name": matches[1], "human_name": matches[2], "card_name": cards[cardIndex].name, "card_description": cards[cardIndex].card_description };
cards[cardIndex].ports.push(port);
ports.push(port);
}
else if (port && (matches = /\t*Part of profile\(s\):\s(.*)/.exec(line))) {
let profileStr = matches[1];
- port.profiles = profileStr.split(', ');
+ port.profiles = profileStr.split(", ");
port = null;
}
break;
}
}
}
+ if (ports) {
+ ports.forEach(p => {
+ p.direction = p.profiles.filter(pr => pr.indexOf("+input:") == -1).some(pr => (pr.indexOf("output:") >= 0)) ? "Output" : "Input";
+ });
+ }
}
var Signal = class Signal {
@@ -280,8 +291,7 @@ var Signal = class Signal {
var SignalManager = class SignalManager {
constructor() {
- this._signals = [];
- this._signalsBySource = {};
+ this._signalsBySource = new Map();
}
addSignal(signalSource, signalName, callback) {
@@ -289,29 +299,31 @@ var SignalManager = class SignalManager {
if (signalSource && signalName && callback) {
obj = new Signal(signalSource, signalName, callback);
obj.connect();
- this._signals.push(obj);
- let sourceSignals = this._signalsBySource[signalSource]
- if (!sourceSignals) {
- sourceSignals = [];
- this._signalsBySource[signalSource] = sourceSignals;
+
+ if (!this._signalsBySource.has(signalSource)) {
+ this._signalsBySource.set(signalSource, []);
}
- // this._signalsBySource[signalSource].push(obj)
- sourceSignals.push(obj);
+ this._signalsBySource.get(signalSource).push(obj)
+ //_log(this._signalsBySource.get(signalSource).length + "Signal length");
}
return obj;
}
disconnectAll() {
- for (let signal of this._signals) {
- signal.disconnect();
- }
+ this._signalsBySource.forEach(signals => this._disconnectSignals(signals));
}
disconnectBySource(signalSource) {
- if (this._signalsBySource[signalSource]) {
- for (let signal of this._signalsBySource[signalSource]) {
- signal.disconnect();
- }
+ if (this._signalsBySource.has(signalSource)) {
+ this._disconnectSignals(this._signalsBySource.get(signalSource));
+ }
+ }
+
+ _disconnectSignals(signals) {
+ while (signals.length) {
+ var signal = signals.shift();
+ signal.disconnect();
+ signal = null;
}
}
}
@@ -319,21 +331,10 @@ var SignalManager = class SignalManager {
function getProfilesForPort(portName, card) {
if (card.ports) {
- for (let port of card.ports) {
- if (portName === port.name) {
- let profiles = [];
- if (port.profiles) {
- for (let profile of port.profiles) {
- if (profile.indexOf('+input:') == -1) {
- for (let cardProfile of card.profiles) {
- if (profile === cardProfile.name) {
- profiles.push(cardProfile);
- }
- }
- }
- }
- }
- return profiles;
+ let port = card.ports.find(port => (portName === port.name));
+ if (port) {
+ if (port.profiles) {
+ return card.profiles.filter(profile => (profile.name.indexOf("+input:") == -1 && port.profiles.includes(profile.name)))
}
}
}
@@ -356,7 +357,7 @@ function dump(obj) {
for (var propName in obj) {
try {
propValue = obj[propName];
- _log(propName + "=" + propValue);
+ _log(propName + "=" + propValue);
}
catch (e) { _log(propName + "!!!Error!!!"); }
}
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/extension.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/extension.js
index c8d61652..0f75c108 100644
--- a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/extension.js
+++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/extension.js
@@ -16,7 +16,7 @@
******************************************************************************/
/* jshint moz:true */
-const {GObject} = imports.gi;
+const { GObject } = imports.gi;
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
const Base = Me.imports.base;
@@ -26,64 +26,59 @@ const SignalManager = Lib.SignalManager;
const Prefs = Me.imports.prefs;
const Main = imports.ui.main;
-var SoundOutputDeviceChooser = class SoundOutputDeviceChooser
-extends Base.SoundDeviceChooserBase {
+var SoundOutputDeviceChooser = class SoundOutputDeviceChooser
+ extends Base.SoundDeviceChooserBase {
constructor() {
super("output");
}
- lookupDeviceById(id) {
- return this._control.lookup_output_id(id);
+ lookupDeviceById(control, id) {
+ return control.lookup_output_id(id);
}
- changeDevice(uidevice) {
- this._control.change_output(uidevice);
+ changeDevice(control, uidevice) {
+ control.change_output(uidevice);
}
- getDefaultDevice() {
- return this._control.get_default_sink();
+ getDefaultStream(control) {
+ return control.get_default_sink();
}
getDefaultIcon() {
return "audio-card";
}
- getStreams() {
- return this._control.get_sinks();
- }
};
-var SoundInputDeviceChooser = class SoundInputDeviceChooser
-extends Base.SoundDeviceChooserBase {
+var SoundInputDeviceChooser = class SoundInputDeviceChooser
+ extends Base.SoundDeviceChooserBase {
constructor() {
super("input");
}
- lookupDeviceById(id) {
- return this._control.lookup_input_id(id);
+ lookupDeviceById(control, id) {
+ return control.lookup_input_id(id);
}
- changeDevice(uidevice) {
- this._control.change_input(uidevice);
+ changeDevice(control, uidevice) {
+ control.change_input(uidevice);
}
- getDefaultDevice() {
- return this._control.get_default_source();
+ getDefaultStream(control) {
+ return control.get_default_source();
}
getDefaultIcon() {
return "audio-input-microphone";
}
- getStreams() {
- return this._control.get_sources();
- }
};
+
var InputSliderInstance = class InputSliderInstance {
- constructor(volumeMenu, settings ) {
+ constructor(volumeMenu, settings) {
this._input = volumeMenu._input;
this._settings = settings;
this._signalManager = new SignalManager();
this._signalManager.addSignal(this._settings, "changed::"
- + Prefs.SHOW_INPUT_SLIDER, this._setSliderVisiblity.bind(this));
+ + Prefs.SHOW_INPUT_SLIDER, this._setSliderVisiblity.bind(this));
this._overrideFunction();
this._setSliderVisiblity();
}
_overrideFunction() {
this._input._shouldBeVisibleOriginal = this._input._shouldBeVisible;
this._input._shouldBeVisibleCustom = function() {
- return this._stream != null;
+ return this._stream != null;
};
}
_setSliderVisiblity() {
@@ -104,22 +99,22 @@ var InputSliderInstance = class InputSliderInstance {
};
var SDCInstance = class SDCInstance {
- constructor(){
+ constructor() {
this._settings = Lib.getSettings(Prefs.SETTINGS_SCHEMA);
this._aggregateMenu = Main.panel.statusArea.aggregateMenu;
this._volumeMenu = this._aggregateMenu._volume._volumeMenu;
this._aggregateLayout = this._aggregateMenu.menu.box.get_layout_manager();
}
- enable(){
+ enable() {
let theme = imports.gi.Gtk.IconTheme.get_default();
- if(theme != null) {
+ if (theme != null) {
let iconPath = Me.dir.get_child('icons');
- if (iconPath != null && iconPath.query_exists(null)){
+ if (iconPath != null && iconPath.query_exists(null)) {
theme.append_search_path(iconPath.get_path());
}
}
-
+
if (this._outputInstance == null) {
this._outputInstance = new SoundOutputDeviceChooser();
}
@@ -135,17 +130,15 @@ var SDCInstance = class SDCInstance {
this._addMenuItem(this._volumeMenu, this._volumeMenu._input.item, this._inputInstance.menuItem);
this._expSignalId = this._settings.connect("changed::" + Prefs.EXPAND_VOL_MENU, this._expandVolMenu.bind(this));
-
+
this._expandVolMenu();
}
- _addMenuItem(_volumeMenu, checkItem, menuItem){
+ _addMenuItem(_volumeMenu, checkItem, menuItem) {
let menuItems = _volumeMenu._getMenuItems();
- let i = 0;
- for (; i < menuItems.length; i++) {
- if (menuItems[i] === checkItem) {
- break;
- }
+ let i = menuItems.findIndex(elem => elem === checkItem);
+ if (i < 0) {
+ i = menuItems.length;
}
_volumeMenu.addMenuItem(menuItem, ++i);
}
@@ -163,15 +156,21 @@ var SDCInstance = class SDCInstance {
this._aggregateLayout.layout_changed();
}
- disable(){
+ disable() {
this._revertVolMenuChanges();
- this._outputInstance.destroy();
- this._outputInstance = null;
- this._inputInstance.destroy();
- this._inputInstance = null;
- this._inputSliderInstance.destroy();
- this._inputSliderInstance = null;
- if(this._expSignalId) {
+ if (this._outputInstance) {
+ this._outputInstance.destroy();
+ this._outputInstance = null;
+ }
+ if (this._inputInstance) {
+ this._inputInstance.destroy();
+ this._inputInstance = null;
+ }
+ if (this._inputSliderInstance) {
+ this._inputSliderInstance.destroy();
+ this._inputSliderInstance = null;
+ }
+ if (this._expSignalId) {
this._settings.disconnect(this._expSignalId);
this._expSignalId = null;
}
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/metadata.json b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/metadata.json
index c8e008cb..00624b6d 100644
--- a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/metadata.json
+++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/metadata.json
@@ -7,9 +7,10 @@
"3.34",
"3.32",
"3.36",
- "3.38"
+ "3.38",
+ "40"
],
"url": "https://github.com/kgshank/gse-sound-output-device-chooser",
"uuid": "sound-output-device-chooser@kgshank.net",
- "version": 34
+ "version": 38
}
\ No newline at end of file
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/prefs.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/prefs.js
index b798ea88..06106d69 100644
--- a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/prefs.js
+++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/prefs.js
@@ -28,7 +28,7 @@ const _d = Lib._log;
const SignalManager = Lib.SignalManager;
const Gettext = imports.gettext;
-Gettext.bindtextdomain("sound-output-device-chooser", Me.path + '/locale');
+Gettext.bindtextdomain("sound-output-device-chooser", Me.path + "/locale");
const _ = Gettext.gettext;
var SETTINGS_SCHEMA = "org.gnome.shell.extensions.sound-output-device-chooser";
@@ -64,8 +64,8 @@ function getPortsFromSettings(_settings) {
return obj.ports;
}
-function setPortsSettings(ports,_settings) {
- let settingsObj = { 'version': PORT_SETTINGS_VERSION };
+function setPortsSettings(ports, _settings) {
+ let settingsObj = { "version": PORT_SETTINGS_VERSION };
settingsObj.ports = ports;
//_d(JSON.stringify(settingsObj));
_settings.set_string(PORT_SETTINGS, JSON.stringify(settingsObj));
@@ -97,46 +97,53 @@ function migratePortSettings(currVersion, currSettings, _settings) {
}
break;
}
- return setPortsSettings(ports,_settings);
+ return setPortsSettings(ports, _settings);
}
-
const SDCSettingsWidget = new GObject.Class({
- Name: 'SDC.Prefs.Widget',
- GTypeName: 'SDCSettingsWidget',
+ Name: "SDC.Prefs.Widget",
+ GTypeName: "SDCSettingsWidget",
Extends: Gtk.Box,
_init: function(params) {
this.parent(params);
this.orientation = Gtk.Orientation.VERTICAL;
this.spacing = 0;
+ let uiFileSuffix = "";
+ if (Gtk.get_major_version() >= "4") {
+ uiFileSuffix = "40";
+ this.__addFn = this.append;
+ this.__showFn = this.show;
+ }
+ else {
+ this.__addFn = x => this.pack_start(x, true, true, 0);
+ this.__showFn = this.show_all;
+ }
// creates the settings
this._settings = Lib.getSettings(SETTINGS_SCHEMA);
Lib.setLog(this._settings.get_boolean(ENABLE_LOG));
// creates the ui builder and add the main resource file
- let uiFilePath = Me.path + "/ui/prefs-dialog.gtkbuilder";
+ let uiFilePath = Me.path + "/ui/prefs-dialog" +uiFileSuffix +".glade";
let builder = new Gtk.Builder();
- builder.set_translation_domain('sound-output-device-chooser');
+ builder.set_translation_domain("sound-output-device-chooser");
if (builder.add_from_file(uiFilePath) == 0) {
_d("JS LOG: could not load the ui file: %s".format(uiFilePath));
-
let label = new Gtk.Label({
label: _("Could not load the preferences UI file"),
vexpand: true
});
-
- this.pack_start(label, true, true, 0);
+ this.__addFn(label);
} else {
- _d('JS LOG:_UI file receive and load: ' + uiFilePath);
+ _d("JS LOG:_UI file receive and load: " + uiFilePath);
let mainContainer = builder.get_object("main-container");
- this.pack_start(mainContainer, true, true, 0);
-
+ this.__addFn(mainContainer);
+
this._signalManager = new SignalManager();
let showProfileSwitch = builder.get_object("show-profile");
@@ -179,9 +186,9 @@ const SDCSettingsWidget = new GObject.Class({
_populatePorts: function() {
let ports = Lib.getPorts(true);
- for (let port of ports) {
- this._portsStore.set(this._portsStore.append(), [0, 1, 2, 3, 4, 5, 6, 7], [port.human_name, false, false, true, port.name, 3, port.card_name, getPortDisplayName(port)]);
- }
+ ports.sort((a, b) => (b.direction.localeCompare(a.direction)) || getPortDisplayName(a).localeCompare(getPortDisplayName(b))).forEach(port => {
+ this._portsStore.set(this._portsStore.append(), [0, 1, 2, 3, 4, 5, 6, 7, 8], [port.human_name, false, false, true, port.name, 3, port.card_name, getPortDisplayName(port), port.direction]);
+ });
},
_showAlwaysToggleRenderCallback: function(widget, path) {
@@ -207,7 +214,7 @@ const SDCSettingsWidget = new GObject.Class({
}
/*Dont support non-pci cards for show always*/
let card_name = this._portsStore.get_value(iter, 6);
- if(!/\.pci-/.exec(card_name) && activeCol == 1){
+ if (!/\.pci-/.exec(card_name) && activeCol == 1) {
this._toggleCallback(widget, path, 3, [1, 2]);
return;
}
@@ -222,20 +229,21 @@ const SDCSettingsWidget = new GObject.Class({
_commitSettings: function() {
let ports = [];
let [success, iter] = this._portsStore.get_iter_first();
-
while (iter && success) {
if (!this._portsStore.get_value(iter, 3)) {
- ports.push({
- human_name: this._portsStore.get_value(iter, 0),
- name: this._portsStore.get_value(iter, 4),
- display_option: this._portsStore.get_value(iter, 5),
- card_name: this._portsStore.get_value(iter, 6),
- display_name: this._portsStore.get_value(iter, 7)
- });
+ let display_option = this._portsStore.get_value(iter, 5);
+ if (display_option != 3) {//Dont store default value
+ ports.push({
+ human_name: this._portsStore.get_value(iter, 0),
+ name: this._portsStore.get_value(iter, 4),
+ display_option: display_option,
+ card_name: this._portsStore.get_value(iter, 6),
+ display_name: this._portsStore.get_value(iter, 7)
+ });
+ }
}
success = this._portsStore.iter_next(iter);
}
-
setPortsSettings(ports, this._settings);
},
@@ -268,8 +276,8 @@ const SDCSettingsWidget = new GObject.Class({
if (!found) {
iter = this._portsStore.append();
- this._portsStore.set(iter, [0, 1, 2, 3, 4, 5, 6, 7],
- [port.human_name, false, false, false, port.name, port.display_option, port.card_name, port.display_name]);
+ this._portsStore.set(iter, [0, 1, 2, 3, 4, 5, 6, 7, 8],
+ [port.human_name, false, false, false, port.name, port.display_option, port.card_name, port.display_name, ""]);
this._portsStore.set_value(iter, port.display_option, true);
}
}
@@ -279,7 +287,7 @@ const SDCSettingsWidget = new GObject.Class({
function buildPrefsWidget() {
let _settingsWidget = new SDCSettingsWidget();
- _settingsWidget.show_all();
+ _settingsWidget.__showFn();
return _settingsWidget;
}
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/ui/prefs-dialog.glade b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/ui/prefs-dialog.glade
new file mode 100644
index 00000000..d1957be4
--- /dev/null
+++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/ui/prefs-dialog.glade
@@ -0,0 +1,808 @@
+
+
+
+
+
+
+
+
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/ui/prefs-dialog.gtkbuilder b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/ui/prefs-dialog.gtkbuilder
deleted file mode 100644
index 0e5552f8..00000000
--- a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/ui/prefs-dialog.gtkbuilder
+++ /dev/null
@@ -1,835 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- monochrome
- Monochrome
-
-
- colored
- Colored
-
-
- none
- None
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- False
- 6
- 6
- 6
- 6
- vertical
- 2
-
-
- True
- False
- True
- True
- True
-
-
- True
- False
- 12
- 6
- 12
- 12
- vertical
- 12
-
-
- True
- False
- 0
- out
-
-
- True
- False
-
-
- True
- False
- none
-
-
- 100
- True
- True
-
-
- True
- False
- 6
- 6
-
-
- True
- False
- start
- 5
- Hide selector if there's only one device
-
-
- True
- True
- 0
-
-
-
-
- True
- True
- end
- 5
-
-
- False
- True
- 1
-
-
-
-
-
-
-
-
- 100
- True
- True
-
-
- True
- False
- 6
- 6
-
-
- True
- False
- start
- 5
- Display audio profiles for selection
-
-
- True
- True
- 0
-
-
-
-
- True
- True
- end
- 5
-
-
- False
- True
- 1
-
-
-
-
-
-
-
-
- 100
- True
- True
-
-
- True
- False
- 6
- 6
-
-
- True
- False
- start
- 5
- 20
- Extend Volume Menu to fit device names
-
-
- True
- True
- 0
-
-
-
-
- True
- True
- end
- 5
-
-
- False
- True
- 1
-
-
-
-
-
-
-
-
-
-
-
-
- True
- False
- General Settings
-
-
-
-
-
-
-
- False
- True
- 0
-
-
-
-
- True
- False
- 0
- out
-
-
- True
- False
-
-
- True
- False
-
-
- 100
- True
- True
-
-
- True
- False
- center
- 6
- 6
-
-
- True
- False
- start
- 5
- Show output devices
-
-
- True
- True
- 0
-
-
-
-
- True
- True
- end
- 5
-
-
- False
- True
- 1
-
-
-
-
-
-
-
-
-
-
-
-
- True
- False
- Output Devices
-
-
-
-
-
-
-
- False
- True
- 1
-
-
-
-
- True
- False
- 0
- out
-
-
- True
- False
-
-
- True
- False
- none
-
-
- 100
- True
- True
- True
-
-
- True
- False
- center
- 6
- 6
-
-
- True
- False
- start
- 5
- Show input devices
-
-
- True
- True
- 0
-
-
-
-
- True
- True
- end
- 5
-
-
- False
- True
- 1
-
-
-
-
-
-
-
-
- 100
- True
- True
- center
-
-
- True
- False
- 6
- 6
-
-
- True
- False
- start
- 5
- Show volume control for default device
-
-
- True
- True
- 0
-
-
-
-
- True
- True
- end
- 5
-
-
- False
- True
- 1
-
-
-
-
-
-
-
-
-
-
-
-
- True
- False
- Input Devices
-
-
-
-
-
-
-
- False
- True
- 2
-
-
-
-
- True
- False
- 0
- in
-
-
- True
- False
-
-
- True
- False
- none
-
-
- 100
- True
- True
-
-
- 6
- True
- False
- 6
- 6
-
-
- True
- False
- start
- 5
- Icon Theme
-
-
- True
- True
- 0
-
-
-
-
- 100
- True
- False
- 5
- icon-theme-store
- 0
-
-
-
- 1
-
-
-
-
- False
- True
- 1
-
-
-
-
-
-
-
-
- 100
- True
- True
-
-
- True
- False
- 6
- 6
-
-
- True
- False
- start
- 5
- Display icons only in selection list
-
-
- True
- True
- 0
-
-
-
-
-
- False
- True
- 1
-
-
-
-
-
-
-
-
-
-
-
-
- True
- False
- Icons
-
-
-
-
-
-
-
- False
- True
- 3
-
-
-
-
- True
- False
- 0
- in
-
-
- True
- False
-
-
- True
- False
- none
-
-
- 100
- True
- True
-
-
- 6
- True
- False
- 6
- 6
-
-
- True
- False
- start
- 5
- Enable Log messages
-
-
- True
- True
- 0
-
-
-
-
- True
- True
-
-
- False
- True
- 1
-
-
-
-
-
-
-
-
- 100
- True
- True
-
-
- True
- False
- 6
- 6
-
-
- True
- False
- start
- 5
- Enable new profile identification
-
-
- True
- True
- 0
-
-
-
-
- True
- True
- True
-
-
- False
- True
- 1
-
-
-
-
-
-
-
-
-
-
-
-
- True
- False
- Miscellaneous
-
-
-
-
-
-
-
- False
- True
- 4
-
-
-
-
- False
- True
- 0
-
-
-
-
- True
- False
- 6
- 12
- 12
- 12
- vertical
-
-
- True
- False
- True
- 0
- out
-
-
- True
- False
- 4
- 4
- 4
- True
- vertical
-
-
- True
- True
- 0.9999999986588954
- True
- True
- queue
- in
- 500
-
-
- True
- True
- True
- ports-store
-
-
-
-
-
- True
- autosize
- 100
- Name
- True
- descending
-
-
-
- 7
-
-
-
-
-
-
- False
- autosize
- Show
-
-
- True
-
-
- 1
-
-
-
-
-
-
- autosize
- Hide
-
-
- True
-
-
- 2
-
-
-
-
-
-
- autosize
- Default
-
-
- True
-
-
- 3
-
-
-
-
-
-
-
-
- False
- True
- 1
-
-
-
-
-
-
- True
- False
- Port Settings
-
-
-
-
-
-
-
- False
- True
- 0
-
-
-
-
- False
- True
- 1
-
-
-
-
- False
- True
- 1
-
-
-
-
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/ui/prefs-dialog40.glade b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/ui/prefs-dialog40.glade
new file mode 100644
index 00000000..250a9b76
--- /dev/null
+++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/ui/prefs-dialog40.glade
@@ -0,0 +1,538 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ monochrome
+ Monochrome
+
+
+ colored
+ Colored
+
+
+ none
+ None
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1
+ 6
+ 6
+ 6
+ 6
+ vertical
+ 2
+
+
+ 0
+ 1
+ 1
+ 1
+
+
+ 12
+ 6
+ 12
+ 12
+ vertical
+ 12
+
+
+ 0
+
+
+ 0
+ none
+
+
+ 100
+
+
+ 0
+ 6
+ 6
+
+
+ 1
+ start
+ 5
+ Hide selector if there's only one device
+
+
+
+
+ end
+ 5
+
+
+
+
+
+
+
+
+ 100
+
+
+ 6
+ 6
+
+
+ 1
+ start
+ 5
+ Display audio profiles for selection
+
+
+
+
+ end
+ 5
+
+
+
+
+
+
+
+
+ 100
+
+
+ 6
+ 6
+
+
+ 1
+ start
+ 5
+ 20
+ Extend Volume Menu to fit device names
+
+
+
+
+ end
+ 5
+
+
+
+
+
+
+
+
+
+
+ General Settings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 100
+
+
+ center
+ 6
+ 6
+
+
+ 1
+ start
+ 5
+ Show output devices
+
+
+
+
+ end
+ 5
+
+
+
+
+
+
+
+
+
+
+
+ Output Devices
+
+
+
+
+
+
+
+
+
+
+
+
+ none
+
+
+ 100
+ 1
+
+
+ center
+ 6
+ 6
+
+
+ 1
+ start
+ 5
+ Show input devices
+
+
+
+
+ end
+ 5
+
+
+
+
+
+
+
+
+ 100
+ center
+
+
+ 6
+ 6
+
+
+ 1
+ start
+ 5
+ Show volume control for default device
+
+
+
+
+ end
+ 5
+
+
+
+
+
+
+
+
+
+
+
+ Input Devices
+
+
+
+
+
+
+
+
+
+
+
+
+ none
+
+
+ 100
+
+
+ 6
+ 6
+ 6
+
+
+ 1
+ start
+ 5
+ Icon Theme
+
+
+
+
+ 100
+ 5
+ icon-theme-store
+ 0
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+ 100
+
+
+ 6
+ 6
+
+
+ 1
+ start
+ 5
+ Display icons only in selection list
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Icons
+
+
+
+
+
+
+
+
+
+
+
+
+ none
+
+
+ 100
+
+
+ 6
+ 6
+ 6
+
+
+ 1
+ start
+ 5
+ Enable Log messages
+
+
+
+
+
+
+
+
+
+
+
+ 100
+
+
+ 6
+ 6
+
+
+ 1
+ start
+ 5
+ Enable new profile identification
+
+
+
+
+ 1
+
+
+
+
+
+
+
+ >
+
+
+
+ Miscellaneous
+
+
+
+
+
+
+
+
+
+
+
+ 6
+ 12
+ 12
+ 12
+ vertical
+
+
+ 1
+
+
+
+ 4
+ 4
+ 4
+ 1
+ vertical
+
+
+ 0.9999999986588954
+ 1
+ 1
+ 500
+
+
+ 1
+ ports-store
+
+
+
+
+
+ 1
+ autosize
+ 100
+ Name
+ 1
+ descending
+
+
+
+ 7
+
+
+
+
+
+
+ 1
+ autosize
+ Show
+
+
+ 1
+
+
+ 1
+
+
+
+
+
+
+ autosize
+ Hide
+
+
+ 1
+
+
+ 2
+
+
+
+
+
+
+ autosize
+ Default
+
+
+ 1
+
+
+ 3
+
+
+
+
+
+
+
+
+
+
+
+
+ Port Settings
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/__pycache__/libpulse_introspect.cpython-39.pyc b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/__pycache__/libpulse_introspect.cpython-39.pyc
index 4d50c1ca..33ec9c18 100644
Binary files a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/__pycache__/libpulse_introspect.cpython-39.pyc and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/__pycache__/libpulse_introspect.cpython-39.pyc differ
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/libpulse_introspect.py b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/libpulse_introspect.py
index c24391d5..af4209a7 100644
--- a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/libpulse_introspect.py
+++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/libpulse_introspect.py
@@ -33,11 +33,6 @@
import ctypes
from ctypes.util import find_library
-
-
-
-
-
c_int128 = ctypes.c_ubyte*16
c_uint128 = c_int128
void = None
@@ -498,7 +493,8 @@ pa_proplist_to_string.argtypes = [POINTER_T(struct_pa_proplist)]
pa_proplist_gets = _libraries['libpulse.so'].pa_proplist_gets
pa_proplist_gets.restype = POINTER_T(ctypes.c_char)
pa_proplist_gets.argtypes = [POINTER_T(struct_pa_proplist), POINTER_T(ctypes.c_char)]
-
+PA_DIRECTION_OUTPUT = 0x0001
+PA_DIRECTION_INPUT = 0x0002
__all__ = \
@@ -545,4 +541,4 @@ __all__ = \
'struct_pa_mainloop_api', 'struct_pa_operation',
'struct_pa_proplist', 'struct_pa_sample_spec',
'struct_pa_spawn_api', 'struct_pa_time_event', 'struct_pollfd',
- 'struct_timeval', 'uint32_t','pa_proplist_to_string','pa_proplist_gets']
+ 'struct_timeval', 'uint32_t','pa_proplist_to_string','pa_proplist_gets','PA_DIRECTION_OUTPUT', 'PA_DIRECTION_INPUT']
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/pa_helper.py b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/pa_helper.py
index 3049ecf3..4dce9e2d 100644
--- a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/pa_helper.py
+++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/pa_helper.py
@@ -57,9 +57,7 @@ class PAHelper():
self._pa_card_info_cb_t , None)
pa.pa_mainloop_iterate(self.mainloop, 0, byref(retVal))
-
-
- print(dumps({'cards': self._cards, 'ports':self._ports}, indent = 5))
+ print(dumps({'cards': self._cards, 'ports':self._ports}, indent = 5))
try:
if operation:
@@ -105,7 +103,7 @@ class PAHelper():
obj = {}
obj['name'] = port.name.decode('utf8') if port.name else ''
obj['human_name'] = port.description.decode('utf8') if port.description else ''
- obj['direction'] = port.direction
+ obj['direction'] = 'Output' if (port.direction & pa.PA_DIRECTION_OUTPUT) else 'Input'
obj['available'] = port.available
obj['n_profiles'] = port.n_profiles
obj['profiles'] = []
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/extension.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/extension.js
index 51251a7c..d71413ba 100644
--- a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/extension.js
+++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/extension.js
@@ -1,5 +1,5 @@
// tweaks-system-menu - Put Gnome Tweaks in the system menu.
-// Copyright (C) 2019, 2020 Philippe Troin (F-i-f on Github)
+// Copyright (C) 2019-2021 Philippe Troin (F-i-f on Github)
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -14,6 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
+const Lang = imports.lang;
const BoxPointer = imports.ui.boxpointer;
const Main = imports.ui.main;
const PopupMenu = imports.ui.popupMenu;
@@ -34,6 +35,45 @@ const TweaksSystemMenuExtension = class TweaksSystemMenuExtension {
this._positionSettingChangedConnection = null;
this._systemMenu = null;
+ this._applications = {
+ 'tweaks': {
+ appName: 'org.gnome.tweaks.desktop',
+ check: Lang.bind(this, function() {
+ return true;
+ }),
+ getDefaultPosition: Lang.bind(this, function() {
+ return this._findMenuItemPosition(this._systemMenu._settingsItem)+1;
+ }),
+ preUpdatePosition: Lang.bind(this, function () {
+ if (this._applications['extensions'].menuItem !== undefined) {
+ this._moveMenuItemToEnd(this._applications['extensions'].menuItem);
+ }
+ }),
+ postUpdatePosition: Lang.bind(this, function () {
+ if (this._applications['extensions'].menuItem !== undefined) {
+ this._on_position_change('extensions');
+ }
+ })
+ },
+ 'extensions': {
+ appName: 'org.gnome.Extensions.desktop',
+ check: Lang.bind(this, function() {
+ let gnome_shell_version = imports.misc.config.PACKAGE_VERSION;
+ let gnome_shell_major = /^([0-9]+)\.([0-9]+)(\.([0-9]+)(\..*)?)?$/.exec(gnome_shell_version)[1];
+ return gnome_shell_major >= 40;
+ }),
+ getDefaultPosition: Lang.bind(this, function() {
+ if (this._applications['tweaks'].menuItem !== undefined) {
+ return this._findMenuItemPosition(this._applications['tweaks'].menuItem)+1;
+ } else {
+ return this._applications['tweaks'].getDefaultPosition();
+ }
+ }),
+ preUpdatePosition: Lang.bind(this, function () { return; }),
+ postUpdatePosition: Lang.bind(this, function () { return; })
+ }
+ };
+
this._tweaksApp = null;
this._tweaksItem = null;
this._tweaksActivateConnection = null;
@@ -52,6 +92,18 @@ const TweaksSystemMenuExtension = class TweaksSystemMenuExtension {
return null;
}
+ _moveMenuItemToEnd(item) {
+ this._systemMenu.menu.moveMenuItem(item, this._systemMenu.menu._getMenuItems().length-1);
+ }
+
+ _getEnableSettingsName(appKey) {
+ return appKey+'-enable';
+ }
+
+ _getPositionSettingsName(appKey) {
+ return appKey+'-position';
+ }
+
// Enable/disable
enable() {
this._logger = new Logger.Logger('Tweaks-System-Menu');
@@ -63,26 +115,43 @@ const TweaksSystemMenuExtension = class TweaksSystemMenuExtension {
this._debugSettingChangedConnection = this._settings.connect('changed::debug',
this._on_debug_change.bind(this));
- this._positionSettingChangedConnection = this._settings.connect('changed::position',
- this._on_position_change.bind(this));
-
this._systemMenu = Main.panel.statusArea.aggregateMenu._system;
- this._showItem();
+
+ for (let appKey in this._applications) {
+ this._enableApp(appKey);
+ }
this._logger.log_debug('extension enabled');
}
+ _enableApp(appKey) {
+ let appData = this._applications[appKey];
+ if (! appData.check()) return;
+ this._logger.log_debug('_enableApp('+appKey+')');
+ appData.enableSettingChangedConnection = this._settings.connect('changed::'+this._getEnableSettingsName(appKey),
+ Lang.bind(this, function() {
+ this._on_enable_change(appKey);
+ }));
+ appData.positionSettingChangedConnection = this._settings.connect('changed::'+this._getPositionSettingsName(appKey),
+ Lang.bind(this, function() {
+ this._on_position_change(appKey);
+ }));
+ if (this._settings.get_boolean(this._getEnableSettingsName(appKey))) {
+ this._showItem(appKey);
+ }
+ }
+
disable() {
this._logger.log_debug('disable()');
- this._hideItem();
+ for (let appKey in this._applications) {
+ this._disableApp(appKey);
+ }
this._systemMenu = null;
this._settings.disconnect(this._debugSettingChangedConnection);
this._debugSettingChangedConnection = null;
- this._settings.disconnect(this._positionSettingChangedConnection);
- this._positionSettingChangedConnection = null;
this._settings = null;
@@ -90,34 +159,50 @@ const TweaksSystemMenuExtension = class TweaksSystemMenuExtension {
this._logger = null;
}
- // Show/hide item
- _showItem() {
- this._logger.log_debug('_showItem()');
-
- this._tweaksApp = Shell.AppSystem.get_default().lookup_app('org.gnome.tweaks.desktop');
- if (this._tweaksApp) {
- let [icon, name] = [this._tweaksApp.app_info.get_icon().names[0],
- this._tweaksApp.get_name()];
- this._tweaksItem = new PopupMenu.PopupImageMenuItem(name, icon);
- this._tweaksActivateConnection = this._tweaksItem.connect('activate', this._on_activate.bind(this));
- this._systemMenu.menu.addMenuItem(this._tweaksItem);
- this._on_position_change();
- } else {
- this._logger.log('Missing Gnome Tweaks, expect trouble…');
+ _disableApp(appKey) {
+ let appData = this._applications[appKey];
+ if (! appData.check()) return;
+ this._logger.log_debug('_disableApp('+appKey+')');
+ this._hideItem(appKey);
+ if (appData.enableSettingChangedConnection !== undefined) {
+ this._settings.disconnect(appData.enableSettingChangedConnection);
+ delete appData.enableSettingChangedConnection;
+ }
+ if (appData.positionSettingChangedConnection !== undefined) {
+ this._settings.disconnect(appData.positionSettingChangedConnection);
+ delete appData.positionSettingChangedConnection;
}
}
- _hideItem() {
- this._logger.log_debug('_hideItem()');
- if (this._tweaksItem !== null) {
- this._tweaksItem.disconnect(this._tweaksActivateConnection);
- this._tweaksActivateConnection = null;
-
- this._systemMenu.menu._getMenuItems().splice(this._findMenuItemPosition(this._tweaksItem), 1);
- this._tweaksItem.destroy();
- this._tweaksItem = null;
+ // Show/hide item
+ _showItem(appKey) {
+ this._logger.log_debug('_showItem('+appKey+')');
+ let appData = this._applications[appKey];
+ appData.appInfo = Shell.AppSystem.get_default().lookup_app(appData.appName);
+ if (appData.appInfo) {
+ let name = appData.appInfo.get_name();
+ let icon = appData.appInfo.app_info.get_icon().names[0];
+ appData.menuItem = new PopupMenu.PopupImageMenuItem(name, icon);
+ appData.activateConnection = appData.menuItem.connect('activate', Lang.bind(this, function() {
+ this._on_activate(appKey);
+ }));
+ this._systemMenu.menu.addMenuItem(appData.menuItem);
+ this._on_position_change(appKey);
+ } else {
+ this._logger.log(appData.appName+' is missing');
+ }
+ }
+
+ _hideItem(appKey) {
+ this._logger.log_debug('_hideItem('+appKey+')');
+ let appData = this._applications[appKey];
+ if (appData.menuItem !== undefined) {
+ appData.menuItem.disconnect(appData.activateConnection);
+ delete appData.activateConnection;
+ this._systemMenu.menu._getMenuItems().splice(this._findMenuItemPosition(appData.menuItem), 1);
+ appData.menuItem.destroy();
+ delete appData.menuItem;
}
- this._tweaksApp = null;
}
// Event handlers
@@ -126,25 +211,42 @@ const TweaksSystemMenuExtension = class TweaksSystemMenuExtension {
this._logger.log_debug('debug = '+this._logger.get_debug());
}
- _on_position_change() {
- let position = this._settings.get_int('position');
- this._logger.log_debug('_on_position_change(): settings position=' + position);
- if (position == -1) {
- position = this._findMenuItemPosition(this._systemMenu._settingsItem);
- let tweaksPosition = this._findMenuItemPosition(this._tweaksItem);
- if (tweaksPosition > position) {
- position += 1;
- }
- this._logger.log_debug('_on_position_change(): automatic position=' + position);
+ _on_enable_change(appKey) {
+ let appData = this._applications[appKey];
+ let enable = this._settings.get_boolean(this._getEnableSettingsName(appKey));
+ this._logger.log_debug('_on_enable_change('+appKey+'): enable=' + enable);
+ if (enable) {
+ this._showItem(appKey);
+ } else {
+ this._hideItem(appKey);
}
- this._systemMenu.menu.moveMenuItem(this._tweaksItem, position);
}
- _on_activate() {
- this._logger.log_debug('_on_activate()');
+ _on_position_change(appKey) {
+ let appData = this._applications[appKey];
+ let position = this._settings.get_int(this._getPositionSettingsName(appKey));
+ this._logger.log_debug('_on_position_change('+appKey+'): settings position=' + position);
+ this._moveMenuItemToEnd(appData.menuItem);
+ appData.preUpdatePosition();
+ if (position == -1) {
+ position = appData.getDefaultPosition();
+ this._logger.log_debug('_on_position_change('+appKey+'): automatic position=' + position);
+ }
+ // let curPosition = this._findMenuItemPosition(appData.menuItem);
+ // if (curPosition < position) {
+ // position -= 1;
+ // }
+ // this._logger.log_debug('_on_position_change('+appKey+'): ajusted position=' + position);
+ this._systemMenu.menu.moveMenuItem(appData.menuItem, position);
+ appData.postUpdatePosition();
+ }
+
+ _on_activate(appKey) {
+ let appData = this._applications[appKey];
+ this._logger.log_debug('_on_activate('+appKey+')');
this._systemMenu.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
Main.overview.hide();
- this._tweaksApp.activate();
+ appData.appInfo.activate();
}
};
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/locale/de/LC_MESSAGES/tweaks-system-menu.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/locale/de/LC_MESSAGES/tweaks-system-menu.mo
new file mode 100644
index 00000000..c49fd3f6
Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/locale/de/LC_MESSAGES/tweaks-system-menu.mo differ
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/locale/de_DE/LC_MESSAGES/tweaks-system-menu.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/locale/de_DE/LC_MESSAGES/tweaks-system-menu.mo
deleted file mode 100644
index 166a94ed..00000000
Binary files a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/locale/de_DE/LC_MESSAGES/tweaks-system-menu.mo and /dev/null differ
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/locale/fr/LC_MESSAGES/tweaks-system-menu.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/locale/fr/LC_MESSAGES/tweaks-system-menu.mo
index 3930c439..fc97f471 100644
Binary files a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/locale/fr/LC_MESSAGES/tweaks-system-menu.mo and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/locale/fr/LC_MESSAGES/tweaks-system-menu.mo differ
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/logger.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/logger.js
index c8d7dc4f..6fcb1ff6 100644
--- a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/logger.js
+++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/logger.js
@@ -1,5 +1,5 @@
// meson-gse - Library for gnome-shell extensions
-// Copyright (C) 2019 Philippe Troin (F-i-f on Github)
+// Copyright (C) 2019-2021 Philippe Troin (F-i-f on Github)
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -37,14 +37,24 @@ var Logger = class MesonGseLogger {
let gnomeShellVersion = imports.misc.config.PACKAGE_VERSION;
if (gnomeShellVersion != undefined) {
msg += ' on Gnome-Shell ' + gnomeShellVersion;
- }
+ }
+ let gjsVersion = imports.system.version;
+ if (gjsVersion != undefined) {
+ let gjsVersionMajor = Math.floor(gjsVersion / 10000);
+ let gjsVersionMinor = Math.floor((gjsVersion % 10000) / 100);
+ let gjsVersionPatch = gjsVersion % 100;
+ msg +=( ' / gjs ' + gjsVersionMajor
+ + '.' +gjsVersionMinor
+ + '.' +gjsVersionPatch
+ + ' ('+gjsVersion+')');
+ }
let sessionType = GLib.getenv('XDG_SESSION_TYPE');
- if (sessionType != undefined) {
- msg += ' / ' + sessionType;
- }
+ if (sessionType != undefined) {
+ msg += ' / ' + sessionType;
+ }
this.log(msg);
}
- global.log(''+this._title+': '+text);
+ log(''+this._title+': '+text);
}
log_debug(text) {
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/metadata.json b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/metadata.json
index 56a9ccac..c73d9ff7 100644
--- a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/metadata.json
+++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/metadata.json
@@ -1,16 +1,17 @@
{
"_generated": "Generated by SweetTooth, do not edit",
- "description": "Put Gnome Tweaks in the System menu. Optionally, collapse Settings and Tweaks into a single button.",
+ "description": "Put Gnome Tweaks and Extensions (on Shell 40 and later) in the System menu.",
"gettext-domain": "tweaks-system-menu",
- "name": "Tweaks in System Menu",
+ "name": "Tweaks & Extensions in System Menu",
"settings-schema": "org.gnome.shell.extensions.tweaks-system-menu",
"shell-version": [
"3.36",
"3.35.92",
- "3.38"
+ "3.38",
+ "40.0"
],
"url": "https://github.com/F-i-f/tweaks-system-menu",
"uuid": "tweaks-system-menu@extensions.gnome-shell.fifi.org",
- "vcs_revision": "v11-0-ga9fac83",
- "version": 11
+ "vcs_revision": "v15-0-ge3b04c7",
+ "version": 15
}
\ No newline at end of file
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/prefs.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/prefs.js
index 67025a52..bc473c8e 100644
--- a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/prefs.js
+++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/prefs.js
@@ -1,5 +1,5 @@
// Tweaks-system-menu - Put Gnome Tweaks in the system menu.
-// Copyright (C) 2019, 2020 Philippe Troin (F-i-f on Github)
+// Copyright (C) 2019-2021 Philippe Troin (F-i-f on Github)
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -14,6 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
+const Lang = imports.lang;
const Gio = imports.gi.Gio;
const GObject = imports.gi.GObject;
const Gtk = imports.gi.Gtk;
@@ -29,7 +30,61 @@ const Logger = Me.imports.logger;
const TweaksSystemMenuSettings = GObject.registerClass(class TweaksSystemMenuSettings extends Gtk.Grid {
+ _addEntry(ypos, setting_prefix, enable_label_val, position_label_val) {
+ let enable_setting = setting_prefix + '-enable';
+ let enable_sschema = this._settings.settings_schema.get_key(enable_setting);
+ let descr = _(enable_sschema.get_description());
+ let enable_label = new Gtk.Label({
+ label: enable_label_val,
+ halign: Gtk.Align.START
+ });
+ enable_label.set_tooltip_text(descr);
+ let enable_control = new Gtk.Switch({halign: Gtk.Align.END});
+ enable_control.set_tooltip_text(descr);
+ this.attach(enable_label, 1, ypos, 1, 1);
+ this.attach(enable_control, 2, ypos, 1, 1);
+ this._settings.bind(enable_setting, enable_control,
+ 'active', Gio.SettingsBindFlags.DEFAULT);
+ ypos += 1
+
+ let position_setting = setting_prefix + '-position';
+ let position_sschema = this._settings.settings_schema.get_key(position_setting);
+ descr = _(position_sschema.get_description());
+ let position_label = new Gtk.Label({
+ label: position_label_val,
+ halign: Gtk.Align.START,
+ margin_start: 25
+ });
+ position_label.set_tooltip_text(descr);
+ let position_range = position_sschema.get_range().deep_unpack()[1].deep_unpack()
+ let position_control = new Gtk.SpinButton({
+ adjustment: new Gtk.Adjustment({
+ lower: position_range[0],
+ upper: position_range[1],
+ step_increment: 1
+ }),
+ halign: Gtk.Align.END
+ });
+ position_control.set_tooltip_text(descr);
+ this.attach(position_label, 1, ypos, 1, 1);
+ this.attach(position_control, 2, ypos, 1, 1);
+ this._settings.bind(position_setting, position_control,
+ 'value', Gio.SettingsBindFlags.DEFAULT);
+ ypos += 1
+
+ this._settings.connect('changed::'+enable_setting, Lang.bind(this, function(settings, name) {
+ let val = settings.get_boolean(name);
+ position_label.set_sensitive(val);
+ position_control.set_sensitive(val);
+ }));
+
+ return ypos;
+ }
+
setup() {
+ let gnome_shell_version = imports.misc.config.PACKAGE_VERSION;
+ let gnome_shell_major = /^([0-9]+)\.([0-9]+)(\.([0-9]+)(\..*)?)?$/.exec(gnome_shell_version)[1];
+
this.margin_top = 12;
this.margin_bottom = this.margin_top;
this.margin_start = 48;
@@ -48,7 +103,7 @@ const TweaksSystemMenuSettings = GObject.registerClass(class TweaksSystemMenuSet
this.title_label = new Gtk.Label({
use_markup: true,
label: ''
- +_('Tweaks in System Menu')+'',
+ +_('Tweaks & Extensions in System Menu')+'',
hexpand: true,
halign: Gtk.Align.CENTER
});
@@ -79,29 +134,10 @@ const TweaksSystemMenuSettings = GObject.registerClass(class TweaksSystemMenuSet
ypos += 1;
- let sschema = this._settings.settings_schema.get_key('position');
- descr = _(sschema.get_description());
- this.position_label = new Gtk.Label({
- label: _("Menu position:"),
- halign: Gtk.Align.START
- });
- this.position_label.set_tooltip_text(descr);
- let position_range = sschema.get_range().deep_unpack()[1].deep_unpack()
- this.position_control = new Gtk.SpinButton({
- adjustment: new Gtk.Adjustment({
- lower: position_range[0],
- upper: position_range[1],
- step_increment: 1
- }),
- halign: Gtk.Align.END
- });
- this.position_control.set_tooltip_text(descr);
- this.attach(this.position_label, 1, ypos, 1, 1);
- this.attach(this.position_control, 2, ypos, 1, 1);
- this._settings.bind('position', this.position_control,
- 'value', Gio.SettingsBindFlags.DEFAULT);
-
- ypos += 1;
+ ypos = this._addEntry(ypos, 'tweaks', _("Show Tweaks:"), _("Tweaks position:"));
+ if (gnome_shell_major >= 40) {
+ ypos = this._addEntry(ypos, 'extensions', _("Show Extensions:"), _("Extensions position:"));
+ }
descr = _(this._settings.settings_schema.get_key('debug').get_description());
this.debug_label = new Gtk.Label({label: _("Debug:"), halign: Gtk.Align.START});
@@ -117,7 +153,7 @@ const TweaksSystemMenuSettings = GObject.registerClass(class TweaksSystemMenuSet
this.copyright_label = new Gtk.Label({
use_markup: true,
label: ''
- + _('Copyright © 2019, 2020 Philippe Troin (F-i-f on GitHub)')
+ + _('Copyright © 2019-2021 Philippe Troin (F-i-f on GitHub)')
+ '',
hexpand: true,
halign: Gtk.Align.CENTER,
@@ -136,7 +172,10 @@ function init() {
function buildPrefsWidget() {
let widget = new TweaksSystemMenuSettings();
widget.setup();
- widget.show_all();
+ // show_all() is only available/necessary on GTK < 4.0.
+ if (widget.show_all !== undefined) {
+ widget.show_all();
+ }
return widget;
}
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/schemas/gschemas.compiled b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/schemas/gschemas.compiled
index 2fb7772c..5de754b9 100644
Binary files a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/schemas/gschemas.compiled and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/schemas/gschemas.compiled differ
diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/schemas/org.gnome.shell.extensions.tweaks-system-menu.gschema.xml b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/schemas/org.gnome.shell.extensions.tweaks-system-menu.gschema.xml
index c4f857d6..d707fdbc 100644
--- a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/schemas/org.gnome.shell.extensions.tweaks-system-menu.gschema.xml
+++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/tweaks-system-menu@extensions.gnome-shell.fifi.org/schemas/org.gnome.shell.extensions.tweaks-system-menu.gschema.xml
@@ -1,13 +1,34 @@