[gnome] Update extensions for version 48

This commit is contained in:
2025-03-29 17:52:56 -04:00
parent e01589e836
commit a84b79ca08
153 changed files with 3479 additions and 2189 deletions

View File

@ -1,5 +1,5 @@
// Bing Wallpaper GNOME extension
// Copyright (C) 2017-2023 Michael Carroll
// Copyright (C) 2017-2025 Michael Carroll
// This extension is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
@ -20,11 +20,11 @@ export default class BWClipboard {
try {
let file = Gio.File.new_for_path(filename);
let [success, image_data] = file.load_contents(null);
//log('error: '+success);
//console.log('error: '+success);
if (success)
this.clipboard.set_content(CLIPBOARD_TYPE, 'image/jpeg', image_data);
} catch (err) {
log('unable to set clipboard to data in '+filename);
console.log('unable to set clipboard to data in '+filename);
}
}

View File

@ -49,7 +49,7 @@ Also, check out my related [Google Earth View wallpaper extension](https://githu
![Gallery item](/screenshot/gallery.png)
The 4 buttons in the gallery (3rd page in the preferences) do have tool-tips but these do the following:
The 5 buttons in the gallery (3rd page in the preferences) do have tool-tips but these do the following:
- Favorite - favorite this image (equivalent to doing this via the control bar)
- Apply - set this image as wallpaper
- View - open image in image viewer

View File

@ -1,5 +1,5 @@
// Bing Wallpaper GNOME extension
// Copyright (C) 2017-2023 Michael Carroll
// Copyright (C) 2017-2025 Michael Carroll
// This extension is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
@ -32,7 +32,7 @@ var debug = false;
var promptActive = false; // default GNOME method of testing this relies on state of a transisiton
// so we are being explicit here (do not want any races, thanks)
function log(msg) {
function BingLog(msg) {
if (debug) // set 'debug' above to false to keep the noise down in journal
console.log("BingWallpaper extension/Blur: " + msg);
}
@ -40,14 +40,14 @@ function log(msg) {
// we patch UnlockDialog._updateBackgroundEffects()
export function _updateBackgroundEffects_BWP(monitorIndex) {
// GNOME shell 3.36.4 and above
log("_updateBackgroundEffects_BWP() called for shell >= 3.36.4");
BingLog("_updateBackgroundEffects_BWP() called for shell >= 3.36.4");
const themeContext = St.ThemeContext.get_for_stage(global.stage);
for (const widget of this._backgroundGroup.get_children()) {
// set blur effects, we have two modes in lockscreen: login prompt or clock
// blur on when clock is visible is adjustable
const effect = widget.get_effect('blur');
if (promptActive) {
log('default blur active');
BingLog('default blur active');
if (effect) {
effect.set({ // GNOME defaults when login prompt is visible
brightness: BLUR_BRIGHTNESS,
@ -56,7 +56,7 @@ export function _updateBackgroundEffects_BWP(monitorIndex) {
}
}
else {
log('adjustable blur active');
BingLog('adjustable blur active');
if (effect) {
effect.set({ // adjustable blur when clock is visible
brightness: BWP_BLUR_BRIGHTNESS * 0.01, // we use 0-100 rather than 0-1, so divide by 100
@ -92,17 +92,17 @@ export function _clampValue(value) {
export default class Blur {
constructor() {
this.enabled = false;
log('Bing Wallpaper adjustable blur is '+(supportedVersion()?'available':'not available'));
BingLog('Bing Wallpaper adjustable blur is '+(supportedVersion()?'available':'not available'));
}
set_blur_strength(value) {
BWP_BLUR_SIGMA = _clampValue(value);
log("lockscreen blur strength set to "+BWP_BLUR_SIGMA);
BingLog("lockscreen blur strength set to "+BWP_BLUR_SIGMA);
}
set_blur_brightness(value) {
BWP_BLUR_BRIGHTNESS = _clampValue(value);
log("lockscreen brightness set to " + BWP_BLUR_BRIGHTNESS);
BingLog("lockscreen brightness set to " + BWP_BLUR_BRIGHTNESS);
}
_switch(enabled) {
@ -116,7 +116,7 @@ export default class Blur {
_enable() {
if (supportedVersion()) {
log("Blur._enable() called on GNOME "+Config.PACKAGE_VERSION);
BingLog("Blur._enable() called on GNOME "+Config.PACKAGE_VERSION);
UnlockDialog.UnlockDialog.prototype._updateBackgroundEffects = _updateBackgroundEffects_BWP;
// we override _showClock and _showPrompt to patch in updates to blur effect before calling the GNOME functions
UnlockDialog.UnlockDialog.prototype._showClock = _showClock_BWP;
@ -133,7 +133,7 @@ export default class Blur {
_disable() {
if (!this.enabled)
return;
log("_lockscreen_blur_disable() called");
BingLog("_lockscreen_blur_disable() called");
if (supportedVersion()) {
// restore default functions
UnlockDialog.UnlockDialog.prototype._updateBackgroundEffects = _updateBackgroundEffects;

View File

@ -1,5 +1,5 @@
// Bing Wallpaper GNOME extension
// Copyright (C) 2017-2023 Michael Carroll
// Copyright (C) 2017-2025 Michael Carroll
// This extension is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
@ -30,7 +30,7 @@ export default class Carousel {
this.searchEntry = null;
this.extensionPath = extensionPath
this.log('create carousel...');
this._log('create carousel...');
this.flowBox = prefs_flowbox;
this.flowBox.insert(this._create_placeholder_item(), -1);
@ -43,11 +43,6 @@ export default class Carousel {
}
_create_gallery() {
Utils.randomIntervals.forEach((x) => {
let item = this._create_random_item(x.value, _(x.title));
this.flowBox.insert(item, -1);
});
this.imageList.forEach((image) => {
let item = this._create_gallery_item(image);
this.flowBox.insert(item, -1);
@ -72,7 +67,7 @@ export default class Carousel {
if (Utils.isFavourite(image)) {
favButton.set_visible(false);
this.log('image is favourited');
this._log('image is favourited');
}
else {
unfavButton.set_visible(false);
@ -84,7 +79,7 @@ export default class Carousel {
catch (e) {
galleryImage.set_from_icon_name('image-missing');
galleryImage.set_icon_size = 2; // Gtk.GTK_ICON_SIZE_LARGE;
this.log('create_gallery_image: '+e);
this._log('create_gallery_image: '+e);
}
galleryImage.set_tooltip_text(image.copyright);
@ -96,16 +91,16 @@ export default class Carousel {
applyButton.connect('clicked', () => {
this.settings.set_string('selected-image', Utils.getImageUrlBase(image));
this.log('gallery selected '+Utils.getImageUrlBase(image));
this._log('gallery selected '+Utils.getImageUrlBase(image));
});
infoButton.connect('clicked', () => {
Utils.openInSystemViewer(image.copyrightlink, false);
this.log('info page link opened '+image.copyrightlink);
this._log('info page link opened '+image.copyrightlink);
});
deleteButton.connect('clicked', (widget) => {
this.log('Delete requested for '+filename);
this._log('Delete requested for '+filename);
Utils.deleteImage(filename);
Utils.setImageHiddenStatus(this.settings, image.urlbase, true);
Utils.purgeImages(this.settings); // hide image instead
@ -116,7 +111,7 @@ export default class Carousel {
// button is unchecked, so we want to make the checked one visible
favButton.connect('clicked', (widget) => {
this.log('favourited '+Utils.getImageUrlBase(image));
this._log('favourited '+Utils.getImageUrlBase(image));
widget.set_visible(false);
unfavButton.set_visible(true);
Utils.setImageFavouriteStatus(this.settings, image.urlbase, true);
@ -124,7 +119,7 @@ export default class Carousel {
// button is checked, so we want to make the unchecked one visible
unfavButton.connect('clicked', (widget) => {
this.log('unfavourited '+Utils.getImageUrlBase(image));
this._log('unfavourited '+Utils.getImageUrlBase(image));
widget.set_visible(false);
favButton.set_visible(true);
Utils.setImageFavouriteStatus(this.settings, image.urlbase, false);
@ -134,27 +129,6 @@ export default class Carousel {
return item;
}
_create_random_item(interval, title) {
let buildable = new Gtk.Builder();
// grab appropriate object from UI file
buildable.add_objects_from_file(this.extensionPath + '/ui/carousel4.ui', ["flowBoxRandom"]);
let randomLabel = buildable.get_object('randomLabel');
randomLabel.set_text(title);
let filename = 'random';
let applyButton = buildable.get_object('randomButton');
applyButton.connect('clicked', (widget) => {
this.settings.set_string('random-interval-mode', interval);
this.settings.set_boolean('random-mode-enabled', true);
this.log('gallery selected random with interval '+interval+' ('+title+')');
});
let item = buildable.get_object('flowBoxRandom');
return item;
}
_create_placeholder_item() {
let buildable = new Gtk.Builder();
this.flowBox.set_max_children_per_line(1);
@ -212,7 +186,7 @@ export default class Carousel {
}
catch (e) {
this._set_blank_image(galleryImage);
this.log('create_gallery_image: '+e);
this._log('create_gallery_image: '+e);
}
}
}
@ -222,8 +196,8 @@ export default class Carousel {
//galleryImage.set_icon_size = 2; // Gtk.GTK_ICON_SIZE_LARGE;
}
log(msg) {
_log(msg) {
if (this.settings.get_boolean('debug-logging'))
console.log("BingWallpaper extension: " + msg); // disable to keep the noise down in journal
}
};
};

View File

@ -1,5 +1,5 @@
// Bing Wallpaper GNOME extension
// Copyright (C) 2017-2023 Michael Carroll
// Copyright (C) 2017-2025 Michael Carroll
// This extension is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
@ -54,7 +54,7 @@ const newMenuSwitchItem = (label, state) => {
return switchItem;
}
function log(msg) {
function BingLog(msg) {
if (BingDebug())
console.log('BingWallpaper extension: ' + msg); // disable to keep the noise down in journal
}
@ -78,7 +78,7 @@ function doSetBackground(uri, schema) {
gsettings.set_string('picture-uri-dark', uri);
}
catch (e) {
log("unable to set dark background for : " + e);
BingLog("unable to set dark background for : " + e);
}
Gio.Settings.sync();
gsettings.apply();
@ -296,12 +296,12 @@ class BingWallpaperIndicator extends Button {
toggles.forEach( (e) => {
this.settings_connections.push(
this._settings.connect('changed::'+e.key, () => {
log(e.key+' setting changed to '+ (this._settings.get_boolean(e.key)?'true':'false'));
BingLog(e.key+' setting changed to '+ (this._settings.get_boolean(e.key)?'true':'false'));
e.toggle.setToggleState(this._settings.get_boolean(e.key));
})
);
e.toggle.connect('toggled', (item, state) => {
log(e.key+' switch toggled to '+ (state?'true':'false'));
BingLog(e.key+' switch toggled to '+ (state?'true':'false'));
this._setBooleanSetting(e.key, state);
});
});
@ -319,17 +319,17 @@ class BingWallpaperIndicator extends Button {
_setBooleanSetting(key, state) {
let success = this._settings.set_boolean(key, state);
log('key '+key+' set to ' + (state?'true':'false') + ' (returned ' + (success?'true':'false')+')');
BingLog('key '+key+' set to ' + (state?'true':'false') + ' (returned ' + (success?'true':'false')+')');
}
_setStringSetting(key, value) {
let success = this._settings.set_string(key, value);
log('key '+key+' set to ' + value + ' (returned ' + (success?'true':'false')+')');
BingLog('key '+key+' set to ' + value + ' (returned ' + (success?'true':'false')+')');
}
_setIntSetting(key, value) {
let success = this._settings.set_int(key, value);
log('key '+key+' set to ' + value + ' (returned ' + (success?'true':'false')+')');
BingLog('key '+key+' set to ' + value + ' (returned ' + (success?'true':'false')+')');
}
_onDestroy() {
@ -358,14 +358,15 @@ class BingWallpaperIndicator extends Button {
let maxlongdate = Utils.getMaxLongDate(this._settings);
this.refreshduetext =
_("Next refresh") + ": " + (this.refreshdue ? this.refreshdue.format("%Y-%m-%d %X") : '-') +
" (" + Utils.friendly_time_diff(this.refreshdue) + ")\n" +
" (" + (this.refreshdue?Utils.friendly_time_diff(this.refreshdue):"-") + ")\n" +
_("Last refresh") + ": " + (maxlongdate? this._localeDate(maxlongdate, true) : '-');
// also show when shuffle is next due
if (this._settings.get_boolean('random-mode-enabled')) {
this.refreshduetext += "\n" + _("Next shuffle")+": " +
(this.shuffledue ? this.shuffledue.format("%Y-%m-%d %X") : '-') +
" (" + Utils.friendly_time_diff(this.shuffledue) + ")";
" (" + (this.refreshdue?Utils.friendly_time_diff(this.shuffledue):"-") + ")";
}
BingLog('refreshduetext :'+this.refreshduetext);
this.refreshDueItem.label.set_text(this.refreshduetext);
}
@ -378,7 +379,7 @@ class BingWallpaperIndicator extends Button {
_setImage() {
Utils.validate_imagename(this._settings);
this.selected_image = this._settings.get_string('selected-image');
log('selected image changed to: ' + this.selected_image);
BingLog('selected image changed to: ' + this.selected_image);
this._selectImage();
//this._setShuffleToggleState();
}
@ -398,7 +399,7 @@ class BingWallpaperIndicator extends Button {
let icon_name = this._settings.get_string('icon-name');
let gicon = Gio.icon_new_for_string(this._extension.dir.get_child('icons').get_path() + '/' + icon_name + '.svg');
this.icon = new St.Icon({gicon: gicon, style_class: 'system-status-icon'});
log('Replace icon set to: ' + icon_name);
BingLog('Replace icon set to: ' + icon_name);
this.remove_all_children();
this.add_child(this.icon);
}
@ -411,7 +412,7 @@ class BingWallpaperIndicator extends Button {
this._setThumbnailImage();
if (!this.dimensions.width || !this.dimensions.height) // if dimensions aren't in image database yet
[this.dimensions.width, this.dimensions.height] = Utils.getFileDimensions(this.filename);
log('image set to : '+this.filename);
BingLog('image set to : '+this.filename);
if (this._settings.get_boolean('set-background'))
this._setBackgroundDesktop();
}
@ -439,7 +440,7 @@ class BingWallpaperIndicator extends Button {
difference = 60;
difference = difference + 300; // 5 minute fudge offset in case of inaccurate local clock
log('Next refresh due ' + difference + ' seconds from now');
BingLog('Next refresh due ' + difference + ' seconds from now');
this._restartTimeout(difference);
}
@ -450,7 +451,7 @@ class BingWallpaperIndicator extends Button {
if (difference < 60 || difference > 86400) // clamp to a reasonable range
difference = 60;
log('Next shuffle due ' + difference + ' seconds from now');
BingLog('Next shuffle due ' + difference + ' seconds from now');
this._restartShuffleTimeout(difference);
}
@ -563,24 +564,26 @@ class BingWallpaperIndicator extends Button {
return;
}
const image = new Clutter.Image();
const success = image.set_data(
const [version] = Config.PACKAGE_VERSION.split('.').map(s => Number(s));
const image = new St.ImageContent();
const success = image.set_data.apply(image, [
...version >= 48 ? [Clutter.get_default_backend().get_cogl_context()] : [],
pixbuf.get_pixels(),
pixbuf.get_has_alpha() ? Cogl.PixelFormat.RGBA_8888 : Cogl.PixelFormat.RGB_888,
width,
height,
pixbuf.get_rowstride()
);
pixbuf.get_rowstride(),
]);
if (!success) {
throw Error("error creating Clutter.Image()");
throw Error("error creating St.ImageContent()");
}
this.thumbnailItem.hexpand = false;
this.thumbnailItem.vexpand = false;
this.thumbnailItem.content = image;
log('scale factor: ' + scale_factor);
BingLog('scale factor: ' + scale_factor);
this.thumbnailItem.set_size(480*scale_factor, 270*scale_factor);
this.thumbnailItem.setSensitive(true);
}
@ -606,7 +609,7 @@ class BingWallpaperIndicator extends Button {
x.setSensitive(randomEnabled);
});
if (randomEnabled) {
log('enabled shuffle mode, by setting a shuffe timer (5 seconds)');
BingLog('enabled shuffle mode, by setting a shuffe timer (5 seconds)');
this._restartShuffleTimeout(5);
this._setBooleanSetting('revert-to-current-image', false);
}
@ -619,19 +622,19 @@ class BingWallpaperIndicator extends Button {
}
_favouriteImage() {
log('favourite image '+this.imageURL+' status was '+this.favourite_status);
BingLog('favourite image '+this.imageURL+' status was '+this.favourite_status);
this.favourite_status = !this.favourite_status;
Utils.setImageFavouriteStatus(this._settings, this.imageURL, this.favourite_status);
this._setFavouriteIcon(this.favourite_status?this.ICON_FAVE_BUTTON:this.ICON_UNFAVE_BUTTON);
}
_trashImage() {
log('trash image '+this.imageURL+' status was '+this.hidden_status);
BingLog('trash image '+this.imageURL+' status was '+this.hidden_status);
this.hidden_status = !this.hidden_status;
Utils.setImageHiddenStatus(this._settings, this.imageURL, this.hidden_status);
this._setTrashIcon(this.hidden_status?this.ICON_UNTRASH_BUTTON:this.ICON_TRASH_BUTTON);
if (this._settings.get_boolean('trash-deletes-images')) {
log('image to be deleted: '+this.filename);
BingLog('image to be deleted: '+this.filename);
Utils.deleteImage(this.filename);
Utils.validate_imagename(this._settings);
}
@ -705,7 +708,7 @@ class BingWallpaperIndicator extends Button {
});
}
catch(error) {
log('unable to send libsoup json message '+error);
BingLog('unable to send libsoup json message '+error);
notifyError('Unable to fetch Bing metadata\n'+error);
}
}
@ -721,7 +724,7 @@ class BingWallpaperIndicator extends Button {
});
}
catch (error) {
log('unable to send libsoup json message '+error);
BingLog('unable to send libsoup json message '+error);
notifyError('Unable to fetch Bing metadata\n'+error);
}
}
@ -734,14 +737,14 @@ class BingWallpaperIndicator extends Button {
decoder.decode(this.httpSession.send_and_read_finish(message).get_data()): // Soup3
message.response_body.data; // Soup 2
log('Recieved ' + data.length + ' bytes');
BingLog('Recieved ' + data.length + ' bytes');
this._parseData(data);
if (!this._settings.get_boolean('random-mode-enabled'))
this._selectImage();
}
catch (error) {
log('Network error occured: ' + error);
BingLog('Network error occured: ' + error);
notifyError('network error occured\n'+error);
this._updatePending = false;
this._restartTimeout(TIMEOUT_SECONDS_ON_HTTP_ERROR);
@ -758,11 +761,11 @@ class BingWallpaperIndicator extends Button {
this._timeout = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, seconds, this._refresh.bind(this));
this.refreshdue = GLib.DateTime.new_now_local().add_seconds(seconds);
log('next check in ' + seconds + ' seconds');
BingLog('next check in ' + seconds + ' seconds');
}
_restartShuffleTimeout(seconds = null) {
log('_restartShuffleTimeout('+seconds+')');
BingLog('_restartShuffleTimeout('+seconds+')');
//console.trace();
if (this._shuffleTimeout)
@ -770,14 +773,14 @@ class BingWallpaperIndicator extends Button {
if (seconds == null) {
let diff = -Math.floor(GLib.DateTime.new_now_local().difference(this.shuffledue)/1000000);
log('shuffle ('+this.shuffledue.format_iso8601()+') diff = '+diff);
BingLog('shuffle ('+this.shuffledue.format_iso8601()+') diff = '+diff);
if (diff > 30) { // on occasions the above will be 1 second
seconds = diff; // if not specified, we should maintain the existing shuffle timeout (i.e. we just restored from saved state)
}
else if (this._settings.get_string('random-interval-mode') != 'custom') {
let random_mode = this._settings.get_string('random-interval-mode');
seconds = Utils.seconds_until(random_mode); // else we shuffle at specified interval (midnight default)
log('shuffle mode = '+random_mode+' = '+seconds+' from now');
BingLog('shuffle mode = '+random_mode+' = '+seconds+' from now');
}
else {
seconds = this._settings.get_int('random-interval'); // or whatever the user has specified (as a timer)
@ -786,7 +789,7 @@ class BingWallpaperIndicator extends Button {
this._shuffleTimeout = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, seconds, this._selectImage.bind(this, true));
this.shuffledue = GLib.DateTime.new_now_local().add_seconds(seconds);
log('next shuffle in ' + seconds + ' seconds');
BingLog('next shuffle in ' + seconds + ' seconds');
}
// auto export Bing data to JSON file if requested
@ -805,7 +808,7 @@ class BingWallpaperIndicator extends Button {
let newImages = Utils.mergeImageLists(this._settings, parsed.images);
if (datamarket != prefmarket && prefmarket != 'auto')
log('WARNING: Bing returning market data for ' + datamarket + ' rather than selected ' + prefmarket);
BingLog('WARNING: Bing returning market data for ' + datamarket + ' rather than selected ' + prefmarket);
Utils.purgeImages(this._settings); // delete older images if enabled
//Utils.cleanupImageList(this._settings); // merged into purgeImages
@ -821,7 +824,7 @@ class BingWallpaperIndicator extends Button {
if (!this._settings.get_boolean('notify-only-latest')) {
// notify all new images
newImages.forEach((image) => {
log('New image to notify: ' + Utils.getImageTitle(image));
BingLog('New image to notify: ' + Utils.getImageTitle(image));
this._createImageNotification(image);
});
}
@ -829,7 +832,7 @@ class BingWallpaperIndicator extends Button {
// notify only the most recent image
let last = newImages.pop();
if (last) {
log('New image to notify: ' + Utils.getImageTitle(last));
BingLog('New image to notify: ' + Utils.getImageTitle(last));
this._createImageNotification(last);
}
}
@ -839,9 +842,9 @@ class BingWallpaperIndicator extends Button {
this._updatePending = false;
}
catch (error) {
log('_parseData() failed with error ' + error + ' @ '+error.lineNumber);
BingLog('_parseData() failed with error ' + error + ' @ '+error.lineNumber);
notifyError('Bing metadata parsing error check ' + error + ' @ '+error.lineNumber);
log(error.stack);
BingLog(error.stack);
}
}
@ -855,7 +858,7 @@ class BingWallpaperIndicator extends Button {
let msg = _('Bing Wallpaper of the Day for') + ' ' + this._localeDate(image.fullstartdate);
let details = Utils.getImageTitle(image);
this._createNotification(msg, details);
log('_createImageNotification: '+msg+' details: '+details);
BingLog('_createImageNotification: '+msg+' details: '+details);
}
_createNotification(msg, details) {
@ -869,7 +872,7 @@ class BingWallpaperIndicator extends Button {
});
systemSource.addNotification(bingNotify);
//Main.notify(msg, details);
log('_createNotification: '+msg+' details: '+details);
BingLog('_createNotification: '+msg+' details: '+details);
}
_shuffleImage() {
@ -885,7 +888,7 @@ class BingWallpaperIndicator extends Button {
imageList = favImageList;
}
else {
log('not enough filtered images available to shuffle');
BingLog('not enough filtered images available to shuffle');
}
// shuffle could fail for a number of reasons
@ -893,12 +896,12 @@ class BingWallpaperIndicator extends Button {
this.imageIndex = Utils.getRandomInt(imageList.length);
image = imageList[this.imageIndex];
log('shuffled to image '+image.urlbase);
BingLog('shuffled to image '+image.urlbase);
return image;
}
catch (e) {
log('shuffle failed '+e);
BingLog('shuffle failed '+e);
return null;
}
}
@ -909,7 +912,7 @@ class BingWallpaperIndicator extends Button {
// special values, 'current' is most recent (default mode), 'random' picks one at random, anything else should be filename
if (force_shuffle) {
log('forcing shuffle of image')
BingLog('forcing shuffle of image')
image = this._shuffleImage();
if (this._settings.get_boolean('random-mode-enabled'))
this._restartShuffleTimeout();
@ -927,7 +930,7 @@ class BingWallpaperIndicator extends Button {
if (image)
this.imageIndex = Utils.imageIndex(imageList, image.urlbase);
log('_selectImage: ' + this.selected_image + ' = ' + (image && image.urlbase) ? image.urlbase : 'not found');
BingLog('_selectImage: ' + this.selected_image + ' = ' + (image && image.urlbase ? image.urlbase : 'not found'));
}
}
@ -1003,7 +1006,7 @@ class BingWallpaperIndicator extends Button {
};
let stateJSON = JSON.stringify(state);
log('Storing state as JSON: ' + stateJSON);
BingLog('Storing state as JSON: ' + stateJSON);
this._setStringSetting('state', stateJSON);
}
}
@ -1016,7 +1019,7 @@ class BingWallpaperIndicator extends Button {
let state = JSON.parse(stateJSON);
let maxLongDate = null;
log('restoring state...');
BingLog('restoring state...');
maxLongDate = state.maxlongdate ? state.maxlongdate : null;
this.title = state.title;
this.explanation = state.explanation;
@ -1040,7 +1043,7 @@ class BingWallpaperIndicator extends Button {
}
if (this._settings.get_boolean('random-mode-enabled')) {
log('random mode enabled, restarting random state');
BingLog('random mode enabled, restarting random state');
this._restartShuffleTimeoutFromDueDate(this.shuffledue); // FIXME: use state value
this._restartTimeoutFromLongDate(maxLongDate);
}
@ -1051,7 +1054,7 @@ class BingWallpaperIndicator extends Button {
return;
}
catch (error) {
log('bad state - refreshing... error was ' + error);
BingLog('bad state - refreshing... error was ' + error);
}
this._restartTimeout(60);
}
@ -1079,7 +1082,7 @@ class BingWallpaperIndicator extends Button {
notifyError('Download folder '+BingWallpaperDir+' does not exist or is not writable');
return;
}
log("Downloading " + url + " to " + file.get_uri());
BingLog("Downloading " + url + " to " + file.get_uri());
let request = Soup.Message.new('GET', url);
// queue the http request
@ -1096,7 +1099,7 @@ class BingWallpaperIndicator extends Button {
}
}
catch (error) {
log('error sending libsoup message '+error);
BingLog('error sending libsoup message '+error);
notifyError('Network error '+error);
}
}
@ -1118,17 +1121,17 @@ class BingWallpaperIndicator extends Button {
file.replace_contents_finish(res);
if (set_background)
this._setBackground();
log('Download successful');
BingLog('Download successful');
}
catch(e) {
log('Error writing file: ' + e);
BingLog('Error writing file: ' + e);
notifyError('Image '+file.get_path()+' is not writable, check folder permissions or select a different folder\n'+e);
}
}
);
}
catch (error) {
log('Unable download image '+error);
BingLog('Unable download image '+error);
notifyError('Image '+file.get_path()+' file error, check folder permissions, disk space or select a different folder\n'+e);
}
}

View File

@ -7,9 +7,10 @@
"shell-version": [
"45",
"46",
"47"
"47",
"48"
],
"url": "https://github.com/neffo/bing-wallpaper-gnome-extension",
"uuid": "BingWallpaper@ineffable-gmail.com",
"version": 50
"version": 51
}

View File

@ -1,5 +1,5 @@
// Bing Wallpaper GNOME extension
// Copyright (C) 2017-2023 Michael Carroll
// Copyright (C) 2017-2025 Michael Carroll
// This extension is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
@ -44,7 +44,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen
let carousel = null;
let httpSession = null;
let log = (msg) => { // avoids need for globals
let BingLog = (msg) => { // avoids need for globals
if (settings.get_boolean('debug-logging'))
console.log("BingWallpaper extension: " + msg); // disable to keep the noise down in journal
}
@ -82,7 +82,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen
const debug_page = buildable.get_object('debug_page');
const json_actionrow = buildable.get_object('json_actionrow');
const about_page = buildable.get_object('about_page');
const version_button = buildable.get_object('version_button');
const version_row = buildable.get_object('version_row');
const change_log = buildable.get_object('change_log');
window.add(settings_page);
@ -104,18 +104,12 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen
// add wallpaper folder open and change buttons
const openBtn = new Gtk.Button( {
child: new Adw.ButtonContent({
icon_name: 'folder-pictures-symbolic',
label: _('Open folder'),
},),
label: _('Open folder'),
valign: Gtk.Align.CENTER,
halign: Gtk.Align.CENTER,
});
const changeBtn = new Gtk.Button( {
child: new Adw.ButtonContent({
icon_name: 'folder-download-symbolic',
label: _('Change folder'),
},),
label: _('Change folder'),
valign: Gtk.Align.CENTER,
halign: Gtk.Align.CENTER,
});
@ -127,26 +121,17 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen
brightnessAdjustment.set_value(settings.get_int('lockscreen-blur-brightness'));
const defaultBtn = new Gtk.Button( {
child: new Adw.ButtonContent({
icon_name: 'emblem-default-symbolic',
label: _('Default'),
},),
label: _('Default'),
valign: Gtk.Align.CENTER,
halign: Gtk.Align.CENTER,
});
const noBlurBtn = new Gtk.Button( {
child: new Adw.ButtonContent({
icon_name: 'emblem-default-symbolic',
label: _('No blur, slight dim'),
},),
label: _('No blur, slight dim'),
valign: Gtk.Align.CENTER,
halign: Gtk.Align.CENTER,
});
const slightBlurBtn = new Gtk.Button( {
child: new Adw.ButtonContent({
icon_name: 'emblem-default-symbolic',
label: _('Slight blur & dim'),
},),
label: _('Slight blur & dim'),
valign: Gtk.Align.CENTER,
halign: Gtk.Align.CENTER,
});
@ -160,18 +145,12 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen
// these buttons either export or import saved JSON data
const buttonImportData = new Gtk.Button( {
child: new Adw.ButtonContent({
icon_name: 'document-send-symbolic',
label: _('Import'),
},),
label: _('Import'),
valign: Gtk.Align.CENTER,
halign: Gtk.Align.CENTER,
});
const buttonExportData = new Gtk.Button( {
child: new Adw.ButtonContent({
icon_name: 'document-save-symbolic',
label: _('Export'),
},),
label: _('Export'),
valign: Gtk.Align.CENTER,
halign: Gtk.Align.CENTER,
});
@ -179,27 +158,28 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen
json_actionrow.add_suffix(buttonImportData);
json_actionrow.add_suffix(buttonExportData);
version_button.set_label(this.metadata.version.toString());
version_row.set_subtitle(this.metadata.version.toString());
try {
httpSession = new Soup.Session();
httpSession.user_agent = 'User-Agent: Mozilla/5.0 (X11; GNOME Shell/' + Config.PACKAGE_VERSION + '; Linux x86_64; +https://github.com/neffo/bing-wallpaper-gnome-extension ) BingWallpaper Gnome Extension/' + this.metadata.version;
}
catch (e) {
log("Error creating httpSession: " + e);
BingLog("Error creating httpSession: " + e);
}
const icon_image = buildable.get_object('icon_image');
const app_icon_image = buildable.get_object('app_icon_image');
// check that these are valid (can be edited through dconf-editor)
Utils.validate_resolution(settings);
Utils.validate_icon(settings, this.path, icon_image);
Utils.validate_icon(settings, this.path, icon_image, app_icon_image);
Utils.validate_interval(settings);
// Indicator & notifications
settings.bind('hide', hideSwitch, 'active', Gio.SettingsBindFlags.DEFAULT);
settings.bind('notify', notifySwitch, 'active', Gio.SettingsBindFlags.DEFAULT);
settings.connect('changed::icon-name', () => {
Utils.validate_icon(settings, this.path, icon_image);
Utils.validate_icon(settings, this.path, icon_image, app_icon_image);
iconEntry.set_value(1 + Utils.icon_list.indexOf(settings.get_string('icon-name')));
});
@ -245,7 +225,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen
dirChooser.set_initial_folder(Gio.File.new_for_path(Utils.getWallpaperDir(settings)));
dirChooser.select_folder(window, null, (self, res) => {
let new_path = self.select_folder_finish(res).get_uri().replace('file://', '');
log(new_path);
BingLog(new_path);
Utils.moveImagesToNewFolder(settings, Utils.getWallpaperDir(settings), new_path);
Utils.setWallpaperDir(settings, new_path);
});

View File

@ -1,5 +1,5 @@
// Bing Wallpaper GNOME extension
// Copyright (C) 2017-2023 Michael Carroll
// Copyright (C) 2017-2025 Michael Carroll
// This extension is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
@ -23,7 +23,7 @@ export default class Thumbnail {
this.pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(filePath, w, h);
this.srcFile = Gio.File.new_for_path(filePath);
} catch (err) {
log('Unable to create thumbnail for corrupt or incomplete file: ' + filePath + ' err: ' + err);
console.log('Unable to create thumbnail for corrupt or incomplete file: ' + filePath + ' err: ' + err);
}
}
};

View File

@ -68,6 +68,9 @@ Author: Michael Carroll
<property name="orientation">vertical</property>
<property name="vexpand">1</property>
<property name="valign">center</property>
<style>
<class name="linked"/>
</style>
<child>
<object class="GtkButton" id="favButton">
<property name="tooltip-text" translatable="yes">Favorite</property>

View File

@ -23,7 +23,7 @@ Bing Wallpaper GNOME extension by: Michael Carroll
<requires lib="gtk" version="4.0"/>
<requires lib="libadwaita" version="1.0"/>
<object class="AdwPreferencesPage" id="settings_page">
<property name="icon-name">emblem-photos-symbolic</property>
<property name="icon-name">applications-system-symbolic</property>
<property name="title" translatable="yes">Settings</property>
<child>
<object class="AdwPreferencesGroup" id="ui_group">
@ -110,7 +110,7 @@ Bing Wallpaper GNOME extension by: Michael Carroll
</child>
</object>
<object class="AdwPreferencesPage" id="lockscreen_page">
<property name="icon-name">applications-system-symbolic</property>
<property name="icon-name">system-lock-screen-symbolic</property>
<property name="title" translatable="yes">Lock screen</property>
<child>
<object class="AdwPreferencesGroup" id="ls_group">
@ -163,7 +163,7 @@ Bing Wallpaper GNOME extension by: Michael Carroll
</child>
</object>
<object class="AdwPreferencesPage" id="gallery_page">
<property name="icon-name">document-open-recent-symbolic</property>
<property name="icon-name">emblem-photos-symbolic</property>
<property name="title" translatable="yes">Gallery</property>
<child>
<object class="GtkScrolledWindow" id="carouselViewPort">
@ -286,7 +286,8 @@ Bing Wallpaper GNOME extension by: Michael Carroll
<!-- <property name="orientation">vertical</property>-->
<child>
<object class="GtkImage" id="app_icon_image">
<property name="pixel-size">128</property>
<property name="pixel-size">64</property>
<property name="margin-bottom">8</property>
<property name="accessible-role">presentation</property>
<style>
<class name="icon-dropshadow"/>
@ -324,17 +325,11 @@ Bing Wallpaper GNOME extension by: Michael Carroll
<child>
<object class="AdwPreferencesGroup" id="change_log_group">
<child>
<object class="AdwActionRow" id="details_row">
<object class="AdwActionRow" id="version_row">
<property name="title" translatable="yes">Version</property>
<child>
<object class="GtkButton" id="version_button">
<property name="halign">center</property>
<property name="can-shrink">True</property>
<style>
<class name="app-version"/>
</style>
</object>
</child>
<style>
<class name="property"/>
</style>
</object>
</child>
<child>
@ -367,6 +362,8 @@ Bing Wallpaper GNOME extension by: Michael Carroll
<child>
<object class="GtkLinkButton" id="extension_page_linkbutton">
<property name="uri">https://extensions.gnome.org/extension/1262/bing-wallpaper-changer/</property>
<property name="label">GNOME Extensions</property>
<property name="valign">GTK_ALIGN_CENTER</property>
</object>
</child>
<child>
@ -386,6 +383,8 @@ Bing Wallpaper GNOME extension by: Michael Carroll
<child>
<object class="GtkLinkButton" id="source_code_linkbutton">
<property name="uri">https://github.com/neffo/bing-wallpaper-gnome-extension</property>
<property name="label">GitHub</property>
<property name="valign">GTK_ALIGN_CENTER</property>
</object>
</child>
<child>
@ -405,6 +404,8 @@ Bing Wallpaper GNOME extension by: Michael Carroll
<child>
<object class="GtkLinkButton" id="bug_report_linkbutton">
<property name="uri">https://github.com/neffo/bing-wallpaper-gnome-extension/issues</property>
<property name="label">GitHub</property>
<property name="valign">GTK_ALIGN_CENTER</property>
</object>
</child>
<child>
@ -424,6 +425,8 @@ Bing Wallpaper GNOME extension by: Michael Carroll
<child>
<object class="GtkLinkButton" id="contributors_linkbutton">
<property name="uri">https://github.com/neffo/bing-wallpaper-gnome-extension/graphs/contributors</property>
<property name="label">GitHub</property>
<property name="valign">GTK_ALIGN_CENTER</property>
</object>
</child>
<child>

View File

@ -1,5 +1,5 @@
// Bing Wallpaper GNOME extension
// Copyright (C) 2017-2023 Michael Carroll
// Copyright (C) 2017-2025 Michael Carroll
// This extension is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
@ -58,7 +58,12 @@ export var randomIntervals = [ {value: 'hourly', title: ('on the hour')},
export var BingImageURL = 'https://www.bing.com/HPImageArchive.aspx';
export var BingParams = { format: 'js', idx: '0' , n: '8' , mbl: '1' , mkt: '' } ;
export function validate_icon(settings, extension_path, icon_image = null) {
export function validate_icon(
settings,
extension_path,
icon_image = null,
app_icon_image = null
) {
BingLog('validate_icon()');
let icon_name = settings.get_string('icon-name');
if (icon_name == '' || icon_list.indexOf(icon_name) == -1) {
@ -66,10 +71,11 @@ export function validate_icon(settings, extension_path, icon_image = null) {
icon_name = settings.get_string('icon-name');
}
// if called from prefs
if (icon_image) {
if (icon_image && app_icon_image) {
BingLog('set icon to: ' + extension_path + '/icons/' + icon_name + '.svg');
let pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(extension_path + '/icons/' + icon_name + '.svg', 64, 64);
icon_image.set_from_pixbuf(pixbuf);
app_icon_image.set_from_pixbuf(pixbuf);
}
}

View File

@ -54,7 +54,7 @@ export function TalkativeLog(msg) {
* @returns {string} the version
*/
export function getFullVersion() {
return '1.10.0'; // FULL_VERSION
return '1.11.0'; // FULL_VERSION
}
/**

View File

@ -6,9 +6,10 @@
"settings-schema": "org.gnome.shell.extensions.EasyScreenCast",
"shell-version": [
"46",
"47"
"47",
"48"
],
"url": "https://github.com/EasyScreenCast/EasyScreenCast",
"uuid": "EasyScreenCast@iacopodeenosee.gmail.com",
"version": 51
"version": 52
}

View File

@ -25,10 +25,10 @@ var VitalsMenuButton = GObject.registerClass({
}, class VitalsMenuButton extends PanelMenu.Button {
_init(extensionObject) {
super._init(Clutter.ActorAlign.FILL);
this._extensionObject = extensionObject;
this._settings = extensionObject.getSettings();
this._sensorIcons = {
'temperature' : { 'icon': 'temperature-symbolic.svg' },
'voltage' : { 'icon': 'voltage-symbolic.svg' },
@ -67,8 +67,7 @@ var VitalsMenuButton = GObject.registerClass({
x_align: Clutter.ActorAlign.START,
y_align: Clutter.ActorAlign.CENTER,
reactive: true,
x_expand: true,
pack_start: false
x_expand: true
});
this._drawMenu();
@ -109,7 +108,7 @@ var VitalsMenuButton = GObject.registerClass({
this._initializeMenuGroup(sensor, sensor);
}
for (let i = 1; i <= this._numGpus; i++)
this._initializeMenuGroup('gpu#' + i, 'gpu', (this._numGpus > 1 ? ' ' + i : ''));
@ -128,8 +127,7 @@ var VitalsMenuButton = GObject.registerClass({
x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.CENTER,
reactive: true,
x_expand: true,
pack_start: false
x_expand: true
});
// custom round refresh button
@ -255,7 +253,7 @@ var VitalsMenuButton = GObject.registerClass({
}
);
}
_createHotItem(key, value) {
let icon = this._defaultIcon(key);
this._hotIcons[key] = icon;
@ -291,7 +289,7 @@ var VitalsMenuButton = GObject.registerClass({
if(sensorName === 'gpu') {
for(let i = 1; i <= this._numGpus; i++)
this._groups[sensorName + '#' + i].visible = this._settings.get_boolean(sensor);
} else
} else
this._groups[sensorName].visible = this._settings.get_boolean(sensor);
}
@ -417,8 +415,7 @@ var VitalsMenuButton = GObject.registerClass({
}
}
}
if(key === "_gpu#1_domain_number_")
console.error('UPDATING: ', key);
// have we added this sensor before?
let item = this._sensorMenuItems[key];
if (item) {
@ -565,9 +562,8 @@ var VitalsMenuButton = GObject.registerClass({
arrow_pos = 0;
break;
}
let centered = this._settings.get_boolean('menu-centered')
if (centered) arrow_pos = 0.5;
// set arrow position when initializing and moving vitals
@ -605,7 +601,7 @@ var VitalsMenuButton = GObject.registerClass({
this._newGpuDetected = true;
return;
}
this._numGpus = parseInt(split[1]);
this._newGpuDetectedCount = 0;
this._newGpuDetected = false;

View File

@ -1 +1,2 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><g fill="#222"><path fill-opacity=".349" d="M12 1a1 1 0 0 1 .707.293l3 3a1 1 0 0 1 0 1.414l-3 3a1 1 0 1 1-1.414-1.414L12.586 6H5c-.55 0-1-.45-1-1s.45-1 1-1h7.586l-1.293-1.293A1 1 0 0 1 12 1m0 0"/><path d="M4 15a1 1 0 0 1-.707-.293l-3-3a1 1 0 0 1 0-1.414l3-3a1 1 0 1 1 1.414 1.414L3.414 10H11c.55 0 1 .45 1 1s-.45 1-1 1H3.414l1.293 1.293A1 1 0 0 1 4 15m0 0"/></g></svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><g fill="#222222" fill-rule="evenodd"><path d="m 1 3.914062 c 0.003906 -0.257812 0.105469 -0.511718 0.304688 -0.703124 l 3 -2.917969 c 0.386718 -0.3789065 1.003906 -0.3789065 1.394531 0 l 3 2.917969 c 0.394531 0.382812 0.402343 1.015624 0.019531 1.414062 c -0.386719 0.394531 -1.019531 0.402344 -1.417969 0.015625 l -1.300781 -1.265625 v 6.550781 c 0 1.332031 -2 1.332031 -2 0 v -6.550781 l -1.300781 1.269531 c -0.398438 0.382813 -1.03125 0.375 -1.414063 -0.019531 c -0.195312 -0.199219 -0.289062 -0.457031 -0.285156 -0.710938 z m 0 0" fill-opacity="0.34902"/><path d="m 7 11.941406 c 0.003906 0.253906 0.105469 0.507813 0.304688 0.703125 l 3 2.917969 c 0.386718 0.375 1.003906 0.375 1.394531 0 l 3 -2.917969 c 0.394531 -0.386719 0.402343 -1.019531 0.019531 -1.414062 c -0.386719 -0.398438 -1.019531 -0.40625 -1.417969 -0.019531 l -1.300781 1.265624 v -6.550781 c 0 -1.332031 -2 -1.332031 -2 0 v 6.550781 l -1.300781 -1.265624 c -0.398438 -0.386719 -1.03125 -0.378907 -1.414063 0.015624 c -0.195312 0.199219 -0.289062 0.457032 -0.285156 0.710938 z m 0 0"/></g></svg>

Before

Width:  |  Height:  |  Size: 431 B

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1 +1,2 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path fill="#222" d="M12 1a1 1 0 0 0-.707 1.707L12.586 4H5c-.55 0-1 .45-1 1s.45 1 1 1h7.586l-1.293 1.293a1 1 0 1 0 1.414 1.414l3-3a1 1 0 0 0 0-1.414l-3-3A1 1 0 0 0 12 1M4 7a1 1 0 0 0-.707.293l-3 3a1 1 0 0 0 0 1.414l3 3a1 1 0 1 0 1.414-1.414L3.414 12H11c.55 0 1-.45 1-1s-.45-1-1-1H3.414l1.293-1.293A1 1 0 0 0 4 7m0 0"/></svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><g fill="#222222" fill-rule="evenodd"><path d="m 1 3.914062 c 0.003906 -0.257812 0.105469 -0.511718 0.304688 -0.703124 l 3 -2.917969 c 0.386718 -0.3789065 1.003906 -0.3789065 1.394531 0 l 3 2.917969 c 0.394531 0.382812 0.402343 1.015624 0.019531 1.414062 c -0.386719 0.394531 -1.019531 0.402344 -1.417969 0.015625 l -1.300781 -1.265625 v 6.550781 c 0 1.332031 -2 1.332031 -2 0 v -6.550781 l -1.300781 1.269531 c -0.398438 0.382813 -1.03125 0.375 -1.414063 -0.019531 c -0.195312 -0.199219 -0.289062 -0.457031 -0.285156 -0.710938 z m 0 0"/><path d="m 7 11.941406 c 0.003906 0.253906 0.105469 0.507813 0.304688 0.703125 l 3 2.917969 c 0.386718 0.375 1.003906 0.375 1.394531 0 l 3 -2.917969 c 0.394531 -0.386719 0.402343 -1.019531 0.019531 -1.414062 c -0.386719 -0.398438 -1.019531 -0.40625 -1.417969 -0.019531 l -1.300781 1.265624 v -6.550781 c 0 -1.332031 -2 -1.332031 -2 0 v 6.550781 l -1.300781 -1.265624 c -0.398438 -0.386719 -1.03125 -0.378907 -1.414063 0.015624 c -0.195312 0.199219 -0.289062 0.457032 -0.285156 0.710938 z m 0 0"/></g></svg>

Before

Width:  |  Height:  |  Size: 387 B

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1 +1,2 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><g fill="#222"><path d="M12 1a1 1 0 0 1 .707.293l3 3a1 1 0 0 1 0 1.414l-3 3a1 1 0 1 1-1.414-1.414L12.586 6H5c-.55 0-1-.45-1-1s.45-1 1-1h7.586l-1.293-1.293A1 1 0 0 1 12 1m0 0"/><path fill-opacity=".349" d="M4 15a1 1 0 0 1-.707-.293l-3-3a1 1 0 0 1 0-1.414l3-3a1 1 0 1 1 1.414 1.414L3.414 10H11c.55 0 1 .45 1 1s-.45 1-1 1H3.414l1.293 1.293A1 1 0 0 1 4 15m0 0"/></g></svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><g fill="#222222" fill-rule="evenodd"><path d="m 1 3.914062 c 0.003906 -0.257812 0.105469 -0.511718 0.304688 -0.703124 l 3 -2.917969 c 0.386718 -0.3789065 1.003906 -0.3789065 1.394531 0 l 3 2.917969 c 0.394531 0.382812 0.402343 1.015624 0.019531 1.414062 c -0.386719 0.394531 -1.019531 0.402344 -1.417969 0.015625 l -1.300781 -1.265625 v 6.550781 c 0 1.332031 -2 1.332031 -2 0 v -6.550781 l -1.300781 1.269531 c -0.398438 0.382813 -1.03125 0.375 -1.414063 -0.019531 c -0.195312 -0.199219 -0.289062 -0.457031 -0.285156 -0.710938 z m 0 0"/><path d="m 7 11.941406 c 0.003906 0.253906 0.105469 0.507813 0.304688 0.703125 l 3 2.917969 c 0.386718 0.375 1.003906 0.375 1.394531 0 l 3 -2.917969 c 0.394531 -0.386719 0.402343 -1.019531 0.019531 -1.414062 c -0.386719 -0.398438 -1.019531 -0.40625 -1.417969 -0.019531 l -1.300781 1.265624 v -6.550781 c 0 -1.332031 -2 -1.332031 -2 0 v 6.550781 l -1.300781 -1.265624 c -0.398438 -0.386719 -1.03125 -0.378907 -1.414063 0.015624 c -0.195312 0.199219 -0.289062 0.457032 -0.285156 0.710938 z m 0 0" fill-opacity="0.34902"/></g></svg>

Before

Width:  |  Height:  |  Size: 431 B

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -10,9 +10,10 @@
"shell-version": [
"45",
"46",
"47"
"47",
"48"
],
"url": "https://github.com/corecoding/Vitals",
"uuid": "Vitals@CoreCoding.com",
"version": 69
"version": 71
}

View File

@ -898,7 +898,7 @@
<property name="halign">start</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="label" translatable="yes">Monitor gpu (beta; NVIDIA only)</property>
<property name="label" translatable="yes">Monitor GPU (beta)</property>
</object>
</child>
<child>
@ -1224,6 +1224,8 @@
<item translatable="yes">BAT2</item>
<item translatable="yes">BATT</item>
<item translatable="yes">CMB0</item>
<item translatable="yes">CMB1</item>
<item translatable="yes">CMB2</item>
<item translatable="yes">macsmc-battery</item>
</items>
</object>

View File

@ -54,6 +54,8 @@ export const Sensors = GObject.registerClass({
this._addSettingChangedSignal('update-time', this._reconfigureNvidiaSmiProcess.bind(this));
//this._addSettingChangedSignal('include-static-gpu-info', this._reconfigureNvidiaSmiProcess.bind(this));
this._gpu_drm_vendors = null;
this._gpu_drm_indices = null;
this._nvidia_smi_process = null;
this._nvidia_labels = [];
this._bad_split_count = 0;
@ -74,7 +76,7 @@ export const Sensors = GObject.registerClass({
_refreshIPAddress(callback) {
// check IP address
new FileModule.File('https://corecoding.com/vitals.php').read().then(contents => {
new FileModule.File('https://ipv4.corecoding.com').read().then(contents => {
let obj = JSON.parse(contents);
this._returnValue(callback, 'Public IP', obj['IPv4'], 'network', 'string');
}).catch(err => { });
@ -375,20 +377,20 @@ export const Sensors = GObject.registerClass({
_queryBattery(callback) {
let battery_slot = this._settings.get_int('battery-slot');
// addresses issue #161
let battery_key = 'BAT'; // BAT0, BAT1 and BAT2
if (battery_slot == 3) {
battery_slot = 'T';
} else if (battery_slot == 4) {
battery_key = 'CMB'; // CMB0
battery_slot = 0;
} else if (battery_slot == 5) {
battery_key = 'macsmc-battery'; // supports Asahi linux
battery_slot = '';
}
// create a mapping of indices to battery paths (from prefs.ui)
const BATTERY_PATHS = {
0: 'BAT0',
1: 'BAT1',
2: 'BAT2',
3: 'BATT',
4: 'CMB0',
5: 'CMB1',
6: 'CMB2',
7: 'macsmc-battery'
};
// uevent has all necessary fields, no need to read individual files
let battery_path = '/sys/class/power_supply/' + battery_key + battery_slot + '/uevent';
let battery_path = '/sys/class/power_supply/' + BATTERY_PATHS[battery_slot] + '/uevent';
new FileModule.File(battery_path).read("\n").then(lines => {
let output = {};
for (let line of lines) {
@ -496,10 +498,16 @@ export const Sensors = GObject.registerClass({
_queryGpu(callback) {
if (!this._nvidia_smi_process) {
this._disableGpuLabels(callback);
return;
// no nvidia-smi, so we use sysfs DRM if any cards was discovered
if (!this._gpu_drm_indices){
this._disableGpuLabels(callback);
return;
} else {
this._readGpuDrm(callback);
return;
}
}
this._nvidia_smi_process.read('\n').then(lines => {
/// for debugging multi-gpu on systems with only one gpu
/// duplicates the first gpu's data 3 times, for 4 total gpus
@ -510,10 +518,9 @@ export const Sensors = GObject.registerClass({
for (let i = 0; i < lines.length; i++) {
this._parseNvidiaSmiLine(callback, lines[i], i + 1, lines.length > 1);
}
// if we've already updated the static info during the last parse, then stop doing so.
// this is so the _parseNvidiaSmiLine function won't return static info anymore
// if we've already updated the static info during the last parse, then stop doing so.
// this is so the _parseNvidiaSmiLine function won't return static info anymore
// and the nvidia-smi commmand won't be queried for static info either
if(!this._nvidia_static_returned) {
this._nvidia_static_returned = true;
@ -544,13 +551,13 @@ export const Sensors = GObject.registerClass({
this._bad_split_count = 0;
let [
label,
label,
fan_speed_pct,
temp_gpu, temp_mem,
temp_gpu, temp_mem,
mem_total, mem_used, mem_reserved, mem_free,
util_gpu, util_mem, util_encoder, util_decoder,
clock_gpu, clock_mem, clock_encode_decode,
power, power_avg,
power, power_avg,
link_gen_current, link_width_current
] = csv_split;
@ -572,12 +579,9 @@ export const Sensors = GObject.registerClass({
}
}
const typeName = 'gpu#' + gpuNum;
const globalLabel = 'GPU' + (multiGpu ? ' ' + gpuNum : '');
const memTempValid = !isNaN(parseInt(temp_mem));
this._returnGpuValue(callback, 'Graphics', parseInt(util_gpu) * 0.01, typeName + '-group', 'percent');
@ -628,6 +632,50 @@ export const Sensors = GObject.registerClass({
this._returnStaticGpuValue(callback, 'Sub Device ID', staticInfo['sub_device_id'], typeName, 'string');
}
_readGpuDrm(callback){
const multiGpu = this._gpu_drm_indices.length > 1;
const unit = this._settings.get_int('memory-measurement') ? 1000 : 1024;
for (let z = 0; z < this._gpu_drm_indices.length; z++ ) {
let i = this._gpu_drm_indices[z];
const typeName = 'gpu#' + i;
const vendor = this._gpu_drm_vendors[z];
// AMD
if(vendor === "0x1002") {
// read GPU usage and create group lebel for card
new FileModule.File('/sys/class/drm/card'+i+'/device/gpu_busy_percent').read().then(value => {
// create group
this._returnGpuValue(callback, 'Graphics', parseInt(value) * 0.01, typeName + '-group', 'percent');
this._returnGpuValue(callback, 'Vendor', "AMD", typeName, 'string');
this._returnGpuValue(callback, 'Usage', parseInt(value) * 0.01, typeName, 'percent');
}).catch(err => {
// nothing to do, keep old value displayed
});
new FileModule.File('/sys/class/drm/card'+i+'/device/mem_info_vram_used').read().then(value => {
this._returnGpuValue(callback, 'Memory Used', parseInt(value) / unit, typeName, 'memory');
}).catch(err => {
// nothing to do, keep old value displayed
});
new FileModule.File('/sys/class/drm/card'+i+'/device/mem_info_vram_total').read().then(value => {
this._returnGpuValue(callback, 'Memory Total', parseInt(value) / unit, typeName, 'memory');
}).catch(err => {
// nothing to do, keep old value displayed
});
} else {
// for other vendors only show basic card info
let vendorName = null;
switch (vendor){
case '0x10DE': vendorName = 'NVIDIA'; break; // should be never used as nvidia-smi should be preferred
case '0x13B5': vendorName = 'ARM'; break;
case '0x5143': vendorName = 'Qualcomm'; break;
case '0x8086': vendorName = 'Intel'; break;
default: vendorName = "Unknown " + vendor;
}
this._returnGpuValue(callback, 'Graphics', vendorName, typeName + '-group', 'string');
}
}
}
_disableGpuLabels(callback) {
for (let labelObj of this._nvidia_labels)
this._returnValue(callback, labelObj.label, 'disabled', labelObj.type, labelObj.format);
@ -635,7 +683,7 @@ export const Sensors = GObject.registerClass({
_returnStaticGpuValue(callback, label, value, type, format) {
//if we've already tried to return existing static info before or if the option isn't enabled, then do nothing.
if (this._nvidia_static_returned || !this._settings.get_boolean('include-static-gpu-info'))
if (this._nvidia_static_returned || !this._settings.get_boolean('include-static-gpu-info'))
return;
//we don't need to disable static info labels, so just use ordinary returnValue function
@ -645,7 +693,7 @@ export const Sensors = GObject.registerClass({
_returnGpuValue(callback, label, value, type, format, display = true) {
if(!display) return;
if(value === 'N/A' || value === '[N/A]' || isNaN(value)) return;
if(format !== "string" && (value === 'N/A' || value === '[N/A]' || isNaN(value))) return;
let nvidiaLabel = {'label': label, 'type': type, 'format': format};
if (!this._nvidia_labels.includes(nvidiaLabel))
@ -748,6 +796,27 @@ export const Sensors = GObject.registerClass({
// Launch nvidia-smi subprocess if nvidia querying is enabled
this._reconfigureNvidiaSmiProcess();
this._discoverGpuDrm();
}
_discoverGpuDrm() {
// use DRM only if nvidia-smi is not used
if (this._settings.get_boolean('show-gpu') && this._nvidia_smi_process == null) {
// try to discover up to 10 cards starting from index 0
for(let i = 0; i < 10 ; i++){
new FileModule.File('/sys/class/drm/card'+i+'/device/vendor').read().then(value => {
if(!this._gpu_drm_indices){
this._gpu_drm_indices = [];
this._gpu_drm_vendors = [];
}
this._gpu_drm_indices.push(i);
this._gpu_drm_vendors.push(value);
}).catch(err => { });
}
} else {
this._gpu_drm_vendors = null;
this._gpu_drm_indices = null;
}
}
// The nvidia-smi subprocess will keep running and print new sensor data to stdout every
@ -772,7 +841,7 @@ export const Sensors = GObject.registerClass({
_reconfigureNvidiaSmiProcess() {
if (this._settings.get_boolean('show-gpu')) {
this._terminateNvidiaSmiProcess();
try {
let update_time = this._settings.get_int('update-time');
let query_interval = Math.max(update_time, 1);
@ -786,13 +855,13 @@ export const Sensors = GObject.registerClass({
'clocks.gr,clocks.mem,clocks.video,' +
'power.draw.instant,power.draw.average,' +
'pcie.link.gen.gpucurrent,pcie.link.width.current,' +
(!this._nvidia_static_returned && this._settings.get_boolean('include-static-gpu-info') ?
(!this._nvidia_static_returned && this._settings.get_boolean('include-static-gpu-info') ?
'temperature.gpu.tlimit,' +
'power.limit,' +
'pcie.link.gen.max,pcie.link.width.max,' +
'addressing_mode,'+
'driver_version,vbios_version,serial,' +
'pci.domain,pci.bus,pci.device,pci.device_id,pci.sub_device_id,'
'pci.domain,pci.bus,pci.device,pci.device_id,pci.sub_device_id,'
: ''),
'--format=csv,noheader,nounits',
'-l', query_interval.toString()

View File

@ -7,9 +7,10 @@
"shell-version": [
"45",
"46",
"47"
"47",
"48"
],
"url": "https://github.com/ubuntu/gnome-shell-extension-appindicator",
"uuid": "appindicatorsupport@rgcjonas.gmail.com",
"version": 59
}
}

View File

@ -11,10 +11,10 @@
"original-author": "mi-jan-sena@proton.me",
"settings-schema": "org.gnome.shell.extensions.auto-activities",
"shell-version": [
"47"
"48"
],
"url": "https://github.com/CleoMenezesJr/auto-activities",
"uuid": "auto-activities@CleoMenezesJr.github.io",
"version": 14,
"version-name": "47.0"
"version": 15,
"version-name": "48.0"
}

View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@ -148,6 +148,14 @@ export const OverviewBlur = class OverviewBlur {
}
// add the container widget for the overview only to the overview group
Main.layoutManager.overviewGroup.insert_child_at_index(this.overview_background_group, 0);
// make sure it stays below
this.connections.connect(Main.layoutManager.overviewGroup, "child-added", (_, child) => {
if (child !== this.overview_background_group) {
if (this.overview_background_group.get_parent())
Main.layoutManager.overviewGroup.remove_child(this.overview_background_group);
Main.layoutManager.overviewGroup.insert_child_at_index(this.overview_background_group, 0);
}
});
}
/// Updates the classname to style overview components with semi-transparent
@ -166,6 +174,11 @@ export const OverviewBlur = class OverviewBlur {
remove_background_actors() {
this.overview_background_group.remove_all_children();
this.animation_background_group.remove_all_children();
this.connections.disconnect_all_for(Main.layoutManager.overviewGroup);
if (this.overview_background_group.get_parent())
Main.layoutManager.overviewGroup.remove_child(this.overview_background_group);
this.overview_background_managers.forEach(background_manager => {
background_manager._bms_pipeline.destroy();
background_manager.destroy();

View File

@ -54,9 +54,6 @@ export const PanelBlur = class PanelBlur {
// the blur when a window is near a panel
this.connect_to_windows_and_overview();
// update the classname if the panel to have or have not light text
this.update_light_text_classname();
// connect to workareas change
this.connections.connect(global.display, 'workareas-changed',
_ => this.reset()
@ -468,10 +465,14 @@ export const PanelBlur = class PanelBlur {
this.settings.panel.OVERRIDE_BACKGROUND
&&
should_override
)
) {
panel.add_style_class_name(
PANEL_STYLES[this.settings.panel.STYLE_PANEL]
);
}
// update the classname if the panel to have or have not light text
this.update_light_text_classname(!should_override);
}
update_pipeline() {

View File

@ -148,6 +148,11 @@ export function get_supported_effects(_ = () => "") {
name: _("Use base pixel"),
description: _("Whether or not the original pixel is counted for the blur. If it is, the image will be more legible."),
type: "boolean"
},
prefer_closer_pixels: {
name: _("Prefer closer pixels"),
description: _("Whether or not the pixels that are closer to the original pixel will have more weight."),
type: "boolean"
}
}
},

View File

@ -5,6 +5,7 @@ uniform float brightness;
uniform float width;
uniform float height;
uniform bool use_base_pixel;
uniform bool prefer_closer_pixels;
float srand(vec2 a) {
return sin(dot(a, vec2(1233.224, 1743.335)));
@ -19,24 +20,31 @@ void main() {
vec2 uv = cogl_tex_coord0_in.st;
vec2 p = 16 * radius / vec2(width, height);
float r = srand(uv);
vec2 rv;
vec2 dir;
vec2 new_uv;
int strength;
int count = 0;
vec4 c = vec4(0.);
for (int i = 0; i < iterations; i++) {
rv.x = rand(r);
rv.y = rand(r);
vec2 new_uv = uv + rv * p;
rv.y = rand(r) * 3.141592;
dir = vec2(cos(rv.y), sin(rv.y));
new_uv = uv + rv.x * dir * p;
if (new_uv.x > 2. / width && new_uv.y > 2. / height && new_uv.x < 1. - 3. / width && new_uv.y < 1. - 3. / height) {
c += texture2D(tex, new_uv);
count += 1;
strength = prefer_closer_pixels ? (iterations - i)^2 : 1;
c += strength * texture2D(tex, new_uv);
count += strength;
}
}
if (count == 0 || use_base_pixel) {
c += texture2D(tex, uv);
count += 1;
strength = prefer_closer_pixels ? (iterations + 1)^2 : 1;
c += strength * texture2D(tex, uv);
count += strength;
}
c.xyz *= brightness;

View File

@ -8,7 +8,8 @@ const Clutter = await utils.import_in_shell_only('gi://Clutter');
const SHADER_FILENAME = 'monte_carlo_blur.glsl';
const DEFAULT_PARAMS = {
radius: 2., iterations: 5, brightness: .6,
width: 0, height: 0, use_base_pixel: true
width: 0, height: 0, use_base_pixel: true,
prefer_closer_pixels: true,
};
@ -64,6 +65,13 @@ export const MonteCarloBlurEffect = utils.IS_IN_PREFERENCES ?
GObject.ParamFlags.READWRITE,
true,
),
'prefer_closer_pixels': GObject.ParamSpec.boolean(
`prefer_closer_pixels`,
`Prefer closer pixels`,
`Prefer closer pixels`,
GObject.ParamFlags.READWRITE,
true,
),
}
}, class MonteCarloBlurEffect extends Clutter.ShaderEffect {
constructor(params) {
@ -166,6 +174,18 @@ export const MonteCarloBlurEffect = utils.IS_IN_PREFERENCES ?
}
}
get prefer_closer_pixels() {
return this._prefer_closer_pixels;
}
set prefer_closer_pixels(value) {
if (this._prefer_closer_pixels !== value) {
this._prefer_closer_pixels = value;
this.set_uniform_value('prefer_closer_pixels', this._prefer_closer_pixels ? 1 : 0);
}
}
vfunc_set_actor(actor) {
if (this._actor_connection_size_id) {
let old_actor = this.get_actor();

View File

@ -1,6 +1,7 @@
import Meta from 'gi://Meta';
import Clutter from 'gi://Clutter';
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
import * as Config from 'resource:///org/gnome/shell/misc/config.js';
import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js';
@ -253,16 +254,28 @@ export default class BlurMyShell extends Extension {
/// Add the Clutter debug flag.
_disable_clipped_redraws() {
Meta.add_clutter_debug_flags(
null, Clutter.DrawDebugFlag.DISABLE_CLIPPED_REDRAWS, null
);
let gnome_shell_major_version = parseInt(Config.PACKAGE_VERSION.split('.')[0]);
if (gnome_shell_major_version >= 48)
Clutter.add_debug_flags(
null, Clutter.DrawDebugFlag.DISABLE_CLIPPED_REDRAWS, null
);
else
Meta.add_clutter_debug_flags(
null, Clutter.DrawDebugFlag.DISABLE_CLIPPED_REDRAWS, null
);
}
/// Remove the Clutter debug flag.
_reenable_clipped_redraws() {
Meta.remove_clutter_debug_flags(
null, Clutter.DrawDebugFlag.DISABLE_CLIPPED_REDRAWS, null
);
let gnome_shell_major_version = parseInt(Config.PACKAGE_VERSION.split('.')[0]);
if (gnome_shell_major_version >= 48)
Clutter.remove_debug_flags(
null, Clutter.DrawDebugFlag.DISABLE_CLIPPED_REDRAWS, null
);
else
Meta.remove_clutter_debug_flags(
null, Clutter.DrawDebugFlag.DISABLE_CLIPPED_REDRAWS, null
);
}
/// Enables every component from the user session needed, should be called when the shell is

View File

@ -17,9 +17,10 @@
"settings-schema": "org.gnome.shell.extensions.blur-my-shell",
"shell-version": [
"46",
"47"
"47",
"48"
],
"url": "https://github.com/aunetx/blur-my-shell",
"uuid": "blur-my-shell@aunetx",
"version": 67
"version": 68
}

View File

@ -11,9 +11,10 @@
"shell-version": [
"45",
"46",
"47"
"47",
"48"
],
"url": "https://github.com/forge-ext/forge",
"uuid": "forge@jmmaranan.com",
"version": 84
}
}

View File

@ -1,15 +1,15 @@
{
"_generated": "Generated by SweetTooth, do not edit",
"description": "A new Onscreen Keyboard built using GNOME JS",
"gettext-domain": "gjsosk@vishram1123.com",
"name": "GJS OSK",
"settings-schema": "org.gnome.shell.extensions.gjsosk",
"shell-version": [
"45",
"46",
"47"
],
"url": "https://github.com/Vishram1123/gjs-osk",
"uuid": "gjsosk@vishram1123.com",
"version": 27
"description": "A new Onscreen Keyboard built using GNOME JS",
"gettext-domain": "gjsosk@vishram1123.com",
"name": "GJS OSK",
"settings-schema": "org.gnome.shell.extensions.gjsosk",
"shell-version": [
"45",
"46",
"47",
"48"
],
"url": "https://github.com/Vishram1123/gjs-osk",
"uuid": "gjsosk@vishram1123.com",
"version": 100000
}

View File

@ -69,5 +69,23 @@
[{"key":"CAPS", "width":2}, {"key":"AC01"}, {"key":"AC02"}, {"key":"AC03"}, {"key":"AC04"}, {"key":"AC05"}, {"split":true}, {"key":"AC06"}, {"key":"AC07"}, {"key":"AC08"}, {"key":"AC09"}, {"key":"AC10"}, {"key":"AC11"}, {"key": "RTRN", "width": 1.5}],
[{"key":"LFSH", "width":2}, {"key":"LSGT"}, {"key":"AB01"}, {"key":"AB02"}, {"key":"AB03"}, {"key":"AB04"}, {"split":true}, {"key":"AB05"}, {"key":"AB06"}, {"key":"AB07"}, {"key":"AB08"}, {"key":"AB09"}, {"key":"AB10"}, {"key":"RTSH", "width": 1.5}],
[{"key":"LCTL"}, {"key":"LWIN"}, {"key":"LALT"}, {"key":"SPCE", "width":4}, {"split":true}, {"key":"SPCE", "width":2.5}, {"key":"RALT"}, {"key":"RCTL"}, {"key":"LEFT"}, [{"key":"UP", "height": 0.5}, {"key":"DOWN", "height": 0.5}], {"key":"RGHT"}]
],
"Mobile": [
[{"key":"TLDE", "width": 2}, {"key":"TAB", "width": 2}, {"key":"ESC", "width": 2}, {"key":"FK01", "width": 2}, {"key":"FK02", "width": 2}, {"key":"FK03", "width": 2}, {"key":"FK04", "width": 2}, {"key":"FK05", "width": 2}, {"key":"FK06", "width": 2}, {"key":"FK07", "width": 2}, {"key":"FK08", "width": 2}, {"key":"FK09", "width": 2}, {"key":"FK10", "width": 2}, {"key":"FK11", "width": 2}, {"key":"FK12", "width": 2}, {"key":"PRSC", "width": 2}, {"key":"DELE", "width": 2}, {"key":"BKSL", "width": 2}],
[{"key":"AE11", "width": 3}, {"key":"AE01", "width": 3}, {"key":"AE02", "width": 3}, {"key":"AE03", "width": 3}, {"key":"AE04", "width": 3}, {"key":"AE05", "width": 3}, {"key":"AE06", "width": 3}, {"key":"AE07", "width": 3}, {"key":"AE08", "width": 3}, {"key":"AE09", "width": 3}, {"key":"AE10", "width": 3}, {"key":"AE12", "width": 3}],
[{"key":"AD11", "width": 3}, {"key":"AD01", "width": 3}, {"key":"AD02", "width": 3}, {"key":"AD03", "width": 3}, {"key":"AD04", "width": 3}, {"key":"AD05", "width": 3}, {"key":"AD06", "width": 3}, {"key":"AD07", "width": 3}, {"key":"AD08", "width": 3}, {"key":"AD09", "width": 3}, {"key":"AD10", "width": 3}, {"key":"AD12", "width": 3}],
[{"width": 1.5}, {"key":"AC10", "width": 3}, {"key":"AC01", "width": 3}, {"key":"AC02", "width": 3}, {"key":"AC03", "width": 3}, {"key":"AC04", "width": 3}, {"key":"AC05", "width": 3}, {"key":"AC06", "width": 3}, {"key":"AC07", "width": 3}, {"key":"AC08", "width": 3}, {"key":"AC09", "width": 3}, {"key":"AC11", "width": 3}],
[{"key":"LFSH", "width": 2.5}, {"key":"LSGT", "width": 2}, {"key":"AB08", "width": 3}, {"key":"AB01", "width": 3}, {"key":"AB02", "width": 3}, {"key":"AB03", "width": 3}, {"key":"AB04", "width": 3}, {"key":"AB05", "width": 3}, {"key":"AB06", "width": 3}, {"key":"AB07", "width": 3}, {"key":"AB09", "width": 3}, {"key":"AB10", "width": 2}, {"key": "BKSP", "width": 2.5}],
[{"key":"CAPS", "width": 2.5}, {"key":"LCTL", "width": 2.5}, {"key":"LWIN", "width": 2.5}, {"key":"LALT", "width": 2.5}, {"key":"SPCE", "width":10}, {"key":"RALT", "width": 2.5}, {"key":"RCTL", "width": 2.5}, {"key":"LEFT", "width": 2.5}, [{"key":"UP", "width": 2.5, "height": 0.5}, {"key":"DOWN", "width": 2.5, "height": 0.5}], {"key":"RGHT", "width": 2.5}, {"key":"RTRN", "width": 3.5}]
],
"Split Mobile": [
[{"key":"TLDE", "width": 2}, {"key":"TAB", "width": 2}, {"key":"ESC", "width": 2}, {"key":"FK01", "width": 2}, {"key":"FK02", "width": 2}, {"key":"FK03", "width": 2}, {"key":"FK04", "width": 2}, {"key":"FK05", "width": 2}, {"key":"FK06", "width": 2}, {"split":true}, {"key":"FK07", "width": 2}, {"key":"FK08", "width": 2}, {"key":"FK09", "width": 2}, {"key":"FK10", "width": 2}, {"key":"FK11", "width": 2}, {"key":"FK12", "width": 2}, {"key":"PRSC", "width": 2}, {"key":"DELE", "width": 3}, {"key":"BKSL", "width": 2.5}],
[{"key":"AE11", "width": 3}, {"key":"AE01", "width": 3}, {"key":"AE02", "width": 3}, {"key":"AE03", "width": 3}, {"key":"AE04", "width": 3}, {"key":"AE05", "width": 3}, {"split":true}, {"key":"AE06", "width": 3}, {"key":"AE07", "width": 3}, {"key":"AE08", "width": 3}, {"key":"AE09", "width": 3}, {"key":"AE10", "width": 3}, {"key":"AE12", "width": 4.5}],
[{"key":"AD11", "width": 3}, {"key":"AD01", "width": 3}, {"key":"AD02", "width": 3}, {"key":"AD03", "width": 3}, {"key":"AD04", "width": 3}, {"key":"AD05", "width": 3}, {"split":true}, {"key":"AD06", "width": 3}, {"key":"AD07", "width": 3}, {"key":"AD08", "width": 3}, {"key":"AD09", "width": 3}, {"key":"AD10", "width": 3}, {"key":"AD12", "width": 4.5}],
[{"key":"AC10", "width": 3}, {"key":"AC01", "width": 3}, {"key":"AC02", "width": 3}, {"key":"AC03", "width": 3}, {"key":"AC04", "width": 3}, {"key":"AC05", "width": 3}, {"split":true}, {"key":"AC05", "width": 3}, {"key":"AC06", "width": 3}, {"key":"AC07", "width": 3}, {"key":"AC08", "width": 3}, {"key":"AC09", "width": 3}, {"key":"AC11", "width": 4.5}],
[{"key":"LFSH", "width": 2}, {"key":"LSGT", "width": 2}, {"key":"AB08", "width": 2}, {"key":"AB01", "width": 3}, {"key":"AB02", "width": 3}, {"key":"AB03", "width": 3}, {"key":"AB04", "width": 3}, {"split":true}, {"key":"AB04", "width": 3}, {"key":"AB05", "width": 3}, {"key":"AB06", "width": 3}, {"key":"AB07", "width": 3}, {"key":"AB09", "width": 3}, {"key":"AB10", "width": 2}, {"key": "BKSP", "width": 2.5}],
[{"key":"CAPS", "width": 2.5}, {"key":"LCTL", "width": 2.5}, {"key":"LWIN", "width": 2.5}, {"key":"LALT", "width": 2.5}, {"key":"SPCE", "width":8}, {"split":true}, {"key":"SPCE", "width":4}, {"key":"RALT", "width": 2.5}, {"key":"RCTL", "width": 2.5}, {"key":"LEFT", "width": 2.5}, [{"key":"UP", "width": 2.5, "height": 0.5}, {"key":"DOWN", "width": 2.5, "height": 0.5}], {"key":"RGHT", "width": 2.5}, {"key":"RTRN", "width": 3}]
]
}

View File

@ -3,9 +3,11 @@
import Adw from 'gi://Adw';
import Gtk from 'gi://Gtk';
import Gdk from 'gi://Gdk';
import GLib from 'gi://GLib';
import { ExtensionPreferences, gettext as _ } from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
import * as Config from 'resource:///org/gnome/Shell/Extensions/js/misc/config.js'
const [major, minor] = Config.PACKAGE_VERSION.split('.').map(s => Number(s));
export default class GjsOskPreferences extends ExtensionPreferences {
fillPreferencesWindow(window) {
@ -25,18 +27,41 @@ export default class GjsOskPreferences extends ExtensionPreferences {
});
page1.add(behaviorGroup);
const layoutRow = new Adw.ActionRow({
const layoutRow = new Adw.ExpanderRow({
title: _('Layout')
});
behaviorGroup.add(layoutRow);
let layoutList = ["Full Sized International", "Full Sized US", "Tenkeyless International", "Tenkeyless US", "Compact International", "Compact US", "Split International", "Split US"];
let layoutDrop = Gtk.DropDown.new_from_strings(layoutList);
layoutDrop.valign = Gtk.Align.CENTER;
layoutDrop.selected = settings.get_int("layout");
const layoutLandscapeRow = new Adw.ActionRow({
title: _('Landscape Layout')
});
layoutRow.add_row(layoutLandscapeRow);
layoutRow.add_suffix(layoutDrop);
layoutRow.activatable_widget = layoutDrop;
let layouts;
let [okL, contentsL] = GLib.file_get_contents(this.path + '/physicalLayouts.json');
if (okL) {
layouts = JSON.parse(contentsL);
}
let layoutList = Object.keys(layouts);
let layoutLandscapeDrop = Gtk.DropDown.new_from_strings(layoutList);
layoutLandscapeDrop.valign = Gtk.Align.CENTER;
layoutLandscapeDrop.selected = settings.get_int("layout-landscape");
layoutLandscapeRow.add_suffix(layoutLandscapeDrop);
layoutLandscapeRow.activatable_widget = layoutLandscapeDrop;
const layoutPortraitRow = new Adw.ActionRow({
title: _('Portrait Layout')
});
layoutRow.add_row(layoutPortraitRow);
let layoutPortraitDrop = Gtk.DropDown.new_from_strings(layoutList);
layoutPortraitDrop.valign = Gtk.Align.CENTER;
layoutPortraitDrop.selected = settings.get_int("layout-portrait");
layoutPortraitRow.add_suffix(layoutPortraitDrop);
layoutPortraitRow.activatable_widget = layoutPortraitDrop;
const enableDragRow = new Adw.ActionRow({
title: _('Enable Dragging')
@ -132,6 +157,49 @@ export default class GjsOskPreferences extends ExtensionPreferences {
landscapeSizing.add_row(lW);
landscapeSizing.add_row(lH);
const defaultMonitor = new Adw.ActionRow({
title: _('Default Monitor')
})
behaviorGroup.add(defaultMonitor);
let monitors = [];
const display = Gdk.Display.get_default();
if (display && "get_monitors" in display) {
const monitorsAvailable = display.get_monitors();
for (let idx = 0; idx < monitorsAvailable.get_n_items(); idx++) {
const monitor = monitorsAvailable.get_item(idx);
monitors.push(monitor);
}
}
let monitorDrop = Gtk.DropDown.new_from_strings(monitors.map(m => m.get_model()))
monitorDrop.valign = Gtk.Align.CENTER;
let currentMonitorMap = {};
let currentMonitors;
if (settings.get_string("default-monitor").includes(";")) {
currentMonitors = settings.get_string("default-monitor").split(";")
} else {
currentMonitors = [("1:" + monitors[0].get_connector())]
}
for (var i of currentMonitors) {
let tmp = i.split(":");
currentMonitorMap[tmp[0]] = tmp[1] + "";
}
if (!Object.keys(currentMonitorMap).includes(monitors.length + "")) {
let allConfigs = Object.keys(currentMonitorMap).map(Number.parseInt).sort();
currentMonitorMap[monitors.length + ""] = allConfigs[allConfigs.length - 1];
}
let index = monitors.map(m => { return m.get_connector() }).indexOf(currentMonitorMap[monitors.length + ""]);
if (index == -1) {
index = 0
}
monitorDrop.selected = index;
defaultMonitor.add_suffix(monitorDrop);
defaultMonitor.activatable_widget = monitorDrop;
const defaultPosition = new Adw.ActionRow({
title: _('Default Position')
});
@ -203,6 +271,23 @@ export default class GjsOskPreferences extends ExtensionPreferences {
darkCol.add_suffix(colorButton_d);
darkCol.activatable_widget = colorButton_d;
const systemAccCol = new Adw.ActionRow({
title: _("Use System Accent Color")
})
colorRow.add_row(systemAccCol)
const systemAccColEnabled = new Gtk.Switch({
active: settings.get_boolean("system-accent-col"),
valign: Gtk.Align.CENTER
})
systemAccCol.add_suffix(systemAccColEnabled)
systemAccCol.activatable_widget = systemAccColEnabled
systemAccCol.set_sensitive(major >= 47)
lightCol.set_sensitive(!settings.get_boolean("system-accent-col"));
darkCol.set_sensitive(!settings.get_boolean("system-accent-col"));
let fontSize = new Adw.ActionRow({
title: _('Font Size (px)')
});
@ -211,7 +296,7 @@ export default class GjsOskPreferences extends ExtensionPreferences {
let numChanger_font = Gtk.SpinButton.new_with_range(0, 100, 1);
numChanger_font.value = settings.get_int('font-size-px');
numChanger_font.valign = Gtk.Align.CENTER;
fontSize.add_suffix(numChanger_font);
fontSize.activatable_widget = numChanger_font;
@ -239,6 +324,17 @@ export default class GjsOskPreferences extends ExtensionPreferences {
borderSpacing.add_suffix(numChanger_bord);
borderSpacing.activatable_widget = numChanger_bord;
let outerSpacing = new Adw.ActionRow({
title: _('Outer Spacing (px)')
});
appearanceGroup.add(outerSpacing);
let numChanger_outer = Gtk.SpinButton.new_with_range(0, 30, 1);
numChanger_outer.value = settings.get_int('outer-spacing-px');
numChanger_outer.valign = Gtk.Align.CENTER;
outerSpacing.add_suffix(numChanger_outer);
outerSpacing.activatable_widget = numChanger_outer;
let snapSpacing = new Adw.ActionRow({
title: _('Drag snap spacing (px)')
});
@ -309,7 +405,7 @@ export default class GjsOskPreferences extends ExtensionPreferences {
context.add_class("title-1");
let another_label = new Gtk.Label({
label: _("Autorelease ") + `fab8e97`
label: _("Autorelease ") + `776e35f`
});
let links_pref_group = new Adw.PreferencesGroup();
@ -348,8 +444,9 @@ export default class GjsOskPreferences extends ExtensionPreferences {
page2.add(links_pref_group);
window.add(page2);
settings.bind("layout", layoutDrop, "selected", 0);
settings.bind("layout-landscape", layoutLandscapeDrop, "selected", 0);
settings.bind("layout-portrait", layoutPortraitDrop, "selected", 0);
settings.bind("enable-drag", dragEnableDT, "active", 0);
settings.bind("enable-tap-gesture", dragOpt, "selected", 0);
settings.bind("indicator-enabled", indEnabled, "active", 0);
@ -372,14 +469,29 @@ export default class GjsOskPreferences extends ExtensionPreferences {
settings.bind("font-size-px", numChanger_font, "value", 0);
settings.bind("font-bold", fontBoldEnabled, "active", 0)
settings.bind("border-spacing-px", numChanger_bord, "value", 0);
settings.bind("outer-spacing-px", numChanger_outer, "value", 0);
settings.bind("snap-spacing-px", numChanger_snap, "value", 0)
settings.bind("round-key-corners", roundKeyCDT, "active", 0);
settings.bind("play-sound", soundPlayDT, "active", 0);
settings.bind("show-icons", showIconDT, "active", 0)
settings.bind("default-snap", snapDrop, "selected", 0);
monitorDrop.connect("notify::selected", () => {
currentMonitorMap[monitors.length + ""] = monitors.map(m => { return m.get_connector() })[monitorDrop.selected];
let representation = [];
for (var k of Object.keys(currentMonitorMap)) {
representation.push(k + ":" + currentMonitorMap[k])
}
settings.set_string("default-monitor", representation.join(";"))
})
systemAccColEnabled.connect("state-set", () => {
settings.set_boolean("system-accent-col", systemAccColEnabled.active)
lightCol.set_sensitive(!settings.get_boolean("system-accent-col"));
darkCol.set_sensitive(!settings.get_boolean("system-accent-col"));
})
window.connect("close-request", () => {
settings.set_int("layout", layoutDrop.selected);
settings.set_int("layout-landscape", layoutLandscapeDrop.selected);
settings.set_int("layout-portrait", layoutPortraitDrop.selected);
settings.set_boolean("enable-drag", dragEnableDT.active);
settings.set_int("enable-tap-gesture", dragOpt.selected);
settings.set_boolean("indicator-enabled", indEnabled.active);
@ -398,11 +510,19 @@ export default class GjsOskPreferences extends ExtensionPreferences {
settings.set_int("font-size-px", numChanger_font.value);
settings.set_boolean("font-bold", fontBoldEnabled.active)
settings.set_int("border-spacing-px", numChanger_bord.value);
settings.set_int("outer-spacing-px", numChanger_outer.value);
settings.set_int("snap-spacing-px", numChanger_snap.value)
settings.set_boolean("round-key-corners", roundKeyCDT.active);
settings.set_boolean("play-sound", soundPlayDT.active);
settings.set_boolean("show-icons", showIconDT.active)
settings.set_int("default-snap", snapDrop.selected);
currentMonitorMap[monitors.length + ""] = monitors.map(m => { return m.get_connector() })[monitorDrop.selected];
let representation = [];
for (var k of Object.keys(currentMonitorMap)) {
representation.push(k + ":" + currentMonitorMap[k])
}
settings.set_string("default-monitor", representation.join(";"))
settings.set_boolean("system-accent-col", systemAccColEnabled.active)
})
}
};

View File

@ -1,7 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<schema id="org.gnome.shell.extensions.gjsosk" path="/org/gnome/shell/extensions/gjsosk/">
<key name="layout" type="i">
<key name="layout-landscape" type="i">
<default>0</default>
</key>
<key name="layout-portrait" type="i">
<default>0</default>
</key>
<key name="portrait-width-percent" type="i">
@ -43,6 +46,9 @@
<key name="background-a-dark" type="d">
<default>1</default>
</key>
<key name="system-accent-col" type="b">
<default>false</default>
</key>
<key name="font-size-px" type="i">
<default>14</default>
</key>
@ -52,6 +58,9 @@
<key name="border-spacing-px" type="i">
<default>2</default>
</key>
<key name="outer-spacing-px" type="i">
<default>20</default>
</key>
<key name="snap-spacing-px" type="i">
<default>25</default>
</key>
@ -61,6 +70,9 @@
<key name="default-snap" type="i">
<default>7</default>
</key>
<key name="default-monitor" type="s">
<default>""</default>
</key>
<key name="enable-tap-gesture" type="i">
<default>1</default>
</key>

View File

@ -1,11 +1,13 @@
.regular:pressed {
background-color: rgba(255, 255, 255, 0.2);
color: white;
border: 0;
}
.inverted:pressed {
background-color: rgba(0, 0, 0, 0.2);
color: black;
border: 0;
}
.regular {
@ -17,12 +19,16 @@
background-color: rgba(0, 0, 0, 0.05);
color: black;
}
.key, .moveHandle {
border: 0;
.key,
.moveHandle {
padding: 0;
margin: 0;
background-clip: padding-box;
box-sizing: border-box;
background-image: url(ui/icons/hicolor/scalable/actions/transparent.svg);
background-repeat: no-repeat;
background-position: center;
}
.dr-b {
@ -34,6 +40,7 @@
.close_btn,
.settings_btn,
/* [insert styles handwriting 1] */
.backspace_btn,
.tab_btn,
.capslock_btn,
@ -51,11 +58,13 @@
background-position: center;
}
.close_btn.regular, .close_btn.selected.inverted {
.close_btn.regular,
.close_btn.selected.inverted {
background-image: url(ui/icons/hicolor/scalable/actions/close.svg);
}
.close_btn.inverted, .close_btn.selected.regular {
.close_btn.inverted,
.close_btn.selected.regular {
background-image: url(ui/icons/hicolor/scalable/actions/close-dark.svg);
}
@ -67,107 +76,135 @@
background-image: url(ui/icons/hicolor/scalable/actions/settings-dark.svg);
}
.backspace_btn.regular, .backspace_btn.selected.inverted {
/* [insert styles handwriting 2] */
.backspace_btn.regular,
.backspace_btn.selected.inverted {
background-image: url(ui/icons/hicolor/scalable/actions/backspace.svg);
}
.backspace_btn.inverted, .backspace_btn.selected.regular {
.backspace_btn.inverted,
.backspace_btn.selected.regular {
background-image: url(ui/icons/hicolor/scalable/actions/backspace-dark.svg);
}
.tab_btn.regular, .tab_btn.selected.inverted {
.tab_btn.regular,
.tab_btn.selected.inverted {
background-image: url(ui/icons/hicolor/scalable/actions/tab.svg);
}
.tab_btn.inverted, .tab_btn.selected.regular {
.tab_btn.inverted,
.tab_btn.selected.regular {
background-image: url(ui/icons/hicolor/scalable/actions/tab-dark.svg);
}
.capslock_btn.regular, .capslock_btn.selected.inverted {
.capslock_btn.regular,
.capslock_btn.selected.inverted {
background-image: url(ui/icons/hicolor/scalable/actions/capslock.svg);
}
.capslock_btn.inverted, .capslock_btn.selected.regular {
.capslock_btn.inverted,
.capslock_btn.selected.regular {
background-image: url(ui/icons/hicolor/scalable/actions/capslock-dark.svg);
}
.shift_btn.regular, .shift_btn.selected.inverted {
.shift_btn.regular,
.shift_btn.selected.inverted {
background-image: url(ui/icons/hicolor/scalable/actions/shift.svg);
}
.shift_btn.inverted, .shift_btn.selected.regular {
.shift_btn.inverted,
.shift_btn.selected.regular {
background-image: url(ui/icons/hicolor/scalable/actions/shift-dark.svg);
}
.enter_btn.regular, .enter_btn.selected.inverted {
.enter_btn.regular,
.enter_btn.selected.inverted {
background-image: url(ui/icons/hicolor/scalable/actions/enter.svg);
}
.enter_btn.inverted, .enter_btn.selected.regular {
.enter_btn.inverted,
.enter_btn.selected.regular {
background-image: url(ui/icons/hicolor/scalable/actions/enter-dark.svg);
}
.ctrl_btn.regular, .ctrl_btn.selected.inverted {
.ctrl_btn.regular,
.ctrl_btn.selected.inverted {
background-image: url(ui/icons/hicolor/scalable/actions/ctrl.svg);
}
.ctrl_btn.inverted, .ctrl_btn.selected.regular {
.ctrl_btn.inverted,
.ctrl_btn.selected.regular {
background-image: url(ui/icons/hicolor/scalable/actions/ctrl-dark.svg);
}
.super_btn.regular, .super_btn.selected.inverted {
.super_btn.regular,
.super_btn.selected.inverted {
background-image: url(ui/icons/hicolor/scalable/actions/super.svg);
}
.super_btn.inverted, .super_btn.selected.regular {
.super_btn.inverted,
.super_btn.selected.regular {
background-image: url(ui/icons/hicolor/scalable/actions/super-dark.svg);
}
.alt_btn.regular, .alt_btn.selected.inverted {
.alt_btn.regular,
.alt_btn.selected.inverted {
background-image: url(ui/icons/hicolor/scalable/actions/alt.svg);
}
.alt_btn.inverted, .alt_btn.selected.regular {
.alt_btn.inverted,
.alt_btn.selected.regular {
background-image: url(ui/icons/hicolor/scalable/actions/alt-dark.svg);
}
.space_btn.regular, .space_btn.selected.inverted {
.space_btn.regular,
.space_btn.selected.inverted {
background-image: url(ui/icons/hicolor/scalable/actions/space.svg);
}
.space_btn.inverted, .space_btn.selected.regular {
.space_btn.inverted,
.space_btn.selected.regular {
background-image: url(ui/icons/hicolor/scalable/actions/space-dark.svg);
}
.left_btn.regular, .left_btn.selected.inverted {
.left_btn.regular,
.left_btn.selected.inverted {
background-image: url(ui/icons/hicolor/scalable/actions/left.svg);
}
.left_btn.inverted, .left_btn.selected.regular {
.left_btn.inverted,
.left_btn.selected.regular {
background-image: url(ui/icons/hicolor/scalable/actions/left-dark.svg);
}
.up_btn.regular, .up_btn.selected.inverted {
.up_btn.regular,
.up_btn.selected.inverted {
background-image: url(ui/icons/hicolor/scalable/actions/up.svg);
}
.up_btn.inverted, .up_btn.selected.regular {
.up_btn.inverted,
.up_btn.selected.regular {
background-image: url(ui/icons/hicolor/scalable/actions/up-dark.svg);
}
.down_btn.regular, .down_btn.selected.inverted {
.down_btn.regular,
.down_btn.selected.inverted {
background-image: url(ui/icons/hicolor/scalable/actions/down.svg);
}
.down_btn.inverted, .down_btn.selected.regular {
.down_btn.inverted,
.down_btn.selected.regular {
background-image: url(ui/icons/hicolor/scalable/actions/down-dark.svg);
}
.right_btn.regular, .right_btn.selected.inverted {
.right_btn.regular,
.right_btn.selected.inverted {
background-image: url(ui/icons/hicolor/scalable/actions/right.svg);
}
.right_btn.inverted, .right_btn.selected.regular {
.right_btn.inverted,
.right_btn.selected.regular {
background-image: url(ui/icons/hicolor/scalable/actions/right-dark.svg);
}
@ -196,6 +233,5 @@
}
.boxLay {
padding: 20px;
border-radius: 10px;
}
}

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"></svg>

After

Width:  |  Height:  |  Size: 86 B

View File

@ -3,13 +3,13 @@
// SPDX-License-Identifier: GPL-2.0-or-later
export default {
PACKAGE_VERSION: 58,
PACKAGE_VERSION: 62,
PACKAGE_URL: 'https://github.com/GSConnect/gnome-shell-extension-gsconnect',
PACKAGE_BUGREPORT: 'https://github.com/GSConnect/gnome-shell-extension-gsconnect/issues/new',
PACKAGE_DATADIR: '/usr/local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io',
PACKAGE_LOCALEDIR: '/usr/local/share/locale',
GSETTINGS_SCHEMA_DIR: '/usr/local/share/glib-2.0/schemas',
GNOME_SHELL_LIBDIR: '/usr/local/lib64',
GNOME_SHELL_LIBDIR: '/usr/local/lib/x86_64-linux-gnu',
APP_ID: 'org.gnome.Shell.Extensions.GSConnect',
APP_PATH: '/org/gnome/Shell/Extensions/GSConnect',

View File

@ -22,9 +22,8 @@ import * as Device from './shell/device.js';
import * as Keybindings from './shell/keybindings.js';
import * as Notification from './shell/notification.js';
import * as Input from './shell/input.js';
import * as Utils from './shell/utils.js';
import * as Remote from './utils/remote.js';
import setup from './utils/setup.js';
import * as Setup from './utils/setup.js';
const QuickSettingsMenu = Main.panel.statusArea.quickSettings;
@ -358,7 +357,7 @@ export default class GSConnectExtension extends Extension {
constructor(metadata) {
super(metadata);
setup(this.path);
Setup.setup(this.path);
// If installed as a user extension, this checks the permissions
// on certain critical files in the extension directory
@ -366,13 +365,13 @@ export default class GSConnectExtension extends Extension {
// and makes them executable if not. Some packaging methods
// (particularly GitHub Actions artifacts) automatically remove
// executable bits from all contents, presumably for security.
Utils.ensurePermissions();
Setup.ensurePermissions();
// If installed as a user extension, this will install the Desktop entry,
// DBus and systemd service files necessary for DBus activation and
// GNotifications. Since there's no uninit()/uninstall() hook for extensions
// and they're only used *by* GSConnect, they should be okay to leave.
Utils.installService();
Setup.installService();
// These modify the notification source for GSConnect's GNotifications and
// need to be active even when the extension is disabled (eg. lock screen).

View File

@ -4,9 +4,10 @@
"name": "GSConnect",
"shell-version": [
"46",
"47"
"47",
"48"
],
"url": "https://github.com/GSConnect/gnome-shell-extension-gsconnect/wiki",
"uuid": "gsconnect@andyholmes.github.io",
"version": 58
"version": 62
}

View File

@ -60,7 +60,7 @@ export function rowSeparators(row, before) {
*
* @param {Gtk.ListBoxRow} row1 - The first row
* @param {Gtk.ListBoxRow} row2 - The second row
* @return {number} -1, 0 or 1
* @returns {number} -1, 0 or 1
*/
export function titleSortFunc(row1, row2) {
if (!row1.title || !row2.title)
@ -605,7 +605,7 @@ export const Panel = GObject.registerClass({
const isPresent = value.get_boolean();
resolve(isPresent);
} catch (e) {
} catch {
resolve(false);
}
}
@ -614,7 +614,7 @@ export const Panel = GObject.registerClass({
this.battery_system_label.visible = hasBattery;
this.battery_system.visible = hasBattery;
} catch (e) {
} catch {
this.battery_system_label.visible = false;
this.battery_system.visible = false;
}
@ -814,7 +814,7 @@ export const Panel = GObject.registerClass({
try {
applications = JSON.parse(settings.get_string('applications'));
} catch (e) {
} catch {
applications = {};
}
@ -858,7 +858,7 @@ export const Panel = GObject.registerClass({
try {
applications = JSON.parse(settings.get_string('applications'));
} catch (e) {
} catch {
applications = {};
}

Some files were not shown because too many files have changed in this diff Show More