[gnome] Update extensions for version 48
@ -1,5 +1,5 @@
|
|||||||
// Bing Wallpaper GNOME extension
|
// 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
|
// 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
|
// 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
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
@ -20,11 +20,11 @@ export default class BWClipboard {
|
|||||||
try {
|
try {
|
||||||
let file = Gio.File.new_for_path(filename);
|
let file = Gio.File.new_for_path(filename);
|
||||||
let [success, image_data] = file.load_contents(null);
|
let [success, image_data] = file.load_contents(null);
|
||||||
//log('error: '+success);
|
//console.log('error: '+success);
|
||||||
if (success)
|
if (success)
|
||||||
this.clipboard.set_content(CLIPBOARD_TYPE, 'image/jpeg', image_data);
|
this.clipboard.set_content(CLIPBOARD_TYPE, 'image/jpeg', image_data);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
log('unable to set clipboard to data in '+filename);
|
console.log('unable to set clipboard to data in '+filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,7 @@ Also, check out my related [Google Earth View wallpaper extension](https://githu
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
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)
|
- Favorite - favorite this image (equivalent to doing this via the control bar)
|
||||||
- Apply - set this image as wallpaper
|
- Apply - set this image as wallpaper
|
||||||
- View - open image in image viewer
|
- View - open image in image viewer
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// Bing Wallpaper GNOME extension
|
// 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
|
// 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
|
// 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
|
// 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
|
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)
|
// 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
|
if (debug) // set 'debug' above to false to keep the noise down in journal
|
||||||
console.log("BingWallpaper extension/Blur: " + msg);
|
console.log("BingWallpaper extension/Blur: " + msg);
|
||||||
}
|
}
|
||||||
@ -40,14 +40,14 @@ function log(msg) {
|
|||||||
// we patch UnlockDialog._updateBackgroundEffects()
|
// we patch UnlockDialog._updateBackgroundEffects()
|
||||||
export function _updateBackgroundEffects_BWP(monitorIndex) {
|
export function _updateBackgroundEffects_BWP(monitorIndex) {
|
||||||
// GNOME shell 3.36.4 and above
|
// 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);
|
const themeContext = St.ThemeContext.get_for_stage(global.stage);
|
||||||
for (const widget of this._backgroundGroup.get_children()) {
|
for (const widget of this._backgroundGroup.get_children()) {
|
||||||
// set blur effects, we have two modes in lockscreen: login prompt or clock
|
// set blur effects, we have two modes in lockscreen: login prompt or clock
|
||||||
// blur on when clock is visible is adjustable
|
// blur on when clock is visible is adjustable
|
||||||
const effect = widget.get_effect('blur');
|
const effect = widget.get_effect('blur');
|
||||||
if (promptActive) {
|
if (promptActive) {
|
||||||
log('default blur active');
|
BingLog('default blur active');
|
||||||
if (effect) {
|
if (effect) {
|
||||||
effect.set({ // GNOME defaults when login prompt is visible
|
effect.set({ // GNOME defaults when login prompt is visible
|
||||||
brightness: BLUR_BRIGHTNESS,
|
brightness: BLUR_BRIGHTNESS,
|
||||||
@ -56,7 +56,7 @@ export function _updateBackgroundEffects_BWP(monitorIndex) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log('adjustable blur active');
|
BingLog('adjustable blur active');
|
||||||
if (effect) {
|
if (effect) {
|
||||||
effect.set({ // adjustable blur when clock is visible
|
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
|
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 {
|
export default class Blur {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.enabled = false;
|
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) {
|
set_blur_strength(value) {
|
||||||
BWP_BLUR_SIGMA = _clampValue(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) {
|
set_blur_brightness(value) {
|
||||||
BWP_BLUR_BRIGHTNESS = _clampValue(value);
|
BWP_BLUR_BRIGHTNESS = _clampValue(value);
|
||||||
log("lockscreen brightness set to " + BWP_BLUR_BRIGHTNESS);
|
BingLog("lockscreen brightness set to " + BWP_BLUR_BRIGHTNESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
_switch(enabled) {
|
_switch(enabled) {
|
||||||
@ -116,7 +116,7 @@ export default class Blur {
|
|||||||
|
|
||||||
_enable() {
|
_enable() {
|
||||||
if (supportedVersion()) {
|
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;
|
UnlockDialog.UnlockDialog.prototype._updateBackgroundEffects = _updateBackgroundEffects_BWP;
|
||||||
// we override _showClock and _showPrompt to patch in updates to blur effect before calling the GNOME functions
|
// we override _showClock and _showPrompt to patch in updates to blur effect before calling the GNOME functions
|
||||||
UnlockDialog.UnlockDialog.prototype._showClock = _showClock_BWP;
|
UnlockDialog.UnlockDialog.prototype._showClock = _showClock_BWP;
|
||||||
@ -133,7 +133,7 @@ export default class Blur {
|
|||||||
_disable() {
|
_disable() {
|
||||||
if (!this.enabled)
|
if (!this.enabled)
|
||||||
return;
|
return;
|
||||||
log("_lockscreen_blur_disable() called");
|
BingLog("_lockscreen_blur_disable() called");
|
||||||
if (supportedVersion()) {
|
if (supportedVersion()) {
|
||||||
// restore default functions
|
// restore default functions
|
||||||
UnlockDialog.UnlockDialog.prototype._updateBackgroundEffects = _updateBackgroundEffects;
|
UnlockDialog.UnlockDialog.prototype._updateBackgroundEffects = _updateBackgroundEffects;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// Bing Wallpaper GNOME extension
|
// 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
|
// 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
|
// 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
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
@ -30,7 +30,7 @@ export default class Carousel {
|
|||||||
this.searchEntry = null;
|
this.searchEntry = null;
|
||||||
this.extensionPath = extensionPath
|
this.extensionPath = extensionPath
|
||||||
|
|
||||||
this.log('create carousel...');
|
this._log('create carousel...');
|
||||||
|
|
||||||
this.flowBox = prefs_flowbox;
|
this.flowBox = prefs_flowbox;
|
||||||
this.flowBox.insert(this._create_placeholder_item(), -1);
|
this.flowBox.insert(this._create_placeholder_item(), -1);
|
||||||
@ -43,11 +43,6 @@ export default class Carousel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_create_gallery() {
|
_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) => {
|
this.imageList.forEach((image) => {
|
||||||
let item = this._create_gallery_item(image);
|
let item = this._create_gallery_item(image);
|
||||||
this.flowBox.insert(item, -1);
|
this.flowBox.insert(item, -1);
|
||||||
@ -72,7 +67,7 @@ export default class Carousel {
|
|||||||
|
|
||||||
if (Utils.isFavourite(image)) {
|
if (Utils.isFavourite(image)) {
|
||||||
favButton.set_visible(false);
|
favButton.set_visible(false);
|
||||||
this.log('image is favourited');
|
this._log('image is favourited');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
unfavButton.set_visible(false);
|
unfavButton.set_visible(false);
|
||||||
@ -84,7 +79,7 @@ export default class Carousel {
|
|||||||
catch (e) {
|
catch (e) {
|
||||||
galleryImage.set_from_icon_name('image-missing');
|
galleryImage.set_from_icon_name('image-missing');
|
||||||
galleryImage.set_icon_size = 2; // Gtk.GTK_ICON_SIZE_LARGE;
|
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);
|
galleryImage.set_tooltip_text(image.copyright);
|
||||||
@ -96,16 +91,16 @@ export default class Carousel {
|
|||||||
|
|
||||||
applyButton.connect('clicked', () => {
|
applyButton.connect('clicked', () => {
|
||||||
this.settings.set_string('selected-image', Utils.getImageUrlBase(image));
|
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', () => {
|
infoButton.connect('clicked', () => {
|
||||||
Utils.openInSystemViewer(image.copyrightlink, false);
|
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) => {
|
deleteButton.connect('clicked', (widget) => {
|
||||||
this.log('Delete requested for '+filename);
|
this._log('Delete requested for '+filename);
|
||||||
Utils.deleteImage(filename);
|
Utils.deleteImage(filename);
|
||||||
Utils.setImageHiddenStatus(this.settings, image.urlbase, true);
|
Utils.setImageHiddenStatus(this.settings, image.urlbase, true);
|
||||||
Utils.purgeImages(this.settings); // hide image instead
|
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
|
// button is unchecked, so we want to make the checked one visible
|
||||||
favButton.connect('clicked', (widget) => {
|
favButton.connect('clicked', (widget) => {
|
||||||
this.log('favourited '+Utils.getImageUrlBase(image));
|
this._log('favourited '+Utils.getImageUrlBase(image));
|
||||||
widget.set_visible(false);
|
widget.set_visible(false);
|
||||||
unfavButton.set_visible(true);
|
unfavButton.set_visible(true);
|
||||||
Utils.setImageFavouriteStatus(this.settings, image.urlbase, 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
|
// button is checked, so we want to make the unchecked one visible
|
||||||
unfavButton.connect('clicked', (widget) => {
|
unfavButton.connect('clicked', (widget) => {
|
||||||
this.log('unfavourited '+Utils.getImageUrlBase(image));
|
this._log('unfavourited '+Utils.getImageUrlBase(image));
|
||||||
widget.set_visible(false);
|
widget.set_visible(false);
|
||||||
favButton.set_visible(true);
|
favButton.set_visible(true);
|
||||||
Utils.setImageFavouriteStatus(this.settings, image.urlbase, false);
|
Utils.setImageFavouriteStatus(this.settings, image.urlbase, false);
|
||||||
@ -134,27 +129,6 @@ export default class Carousel {
|
|||||||
return item;
|
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() {
|
_create_placeholder_item() {
|
||||||
let buildable = new Gtk.Builder();
|
let buildable = new Gtk.Builder();
|
||||||
this.flowBox.set_max_children_per_line(1);
|
this.flowBox.set_max_children_per_line(1);
|
||||||
@ -212,7 +186,7 @@ export default class Carousel {
|
|||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
this._set_blank_image(galleryImage);
|
this._set_blank_image(galleryImage);
|
||||||
this.log('create_gallery_image: '+e);
|
this._log('create_gallery_image: '+e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -222,7 +196,7 @@ export default class Carousel {
|
|||||||
//galleryImage.set_icon_size = 2; // Gtk.GTK_ICON_SIZE_LARGE;
|
//galleryImage.set_icon_size = 2; // Gtk.GTK_ICON_SIZE_LARGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
log(msg) {
|
_log(msg) {
|
||||||
if (this.settings.get_boolean('debug-logging'))
|
if (this.settings.get_boolean('debug-logging'))
|
||||||
console.log("BingWallpaper extension: " + msg); // disable to keep the noise down in journal
|
console.log("BingWallpaper extension: " + msg); // disable to keep the noise down in journal
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// Bing Wallpaper GNOME extension
|
// 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
|
// 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
|
// 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
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
@ -54,7 +54,7 @@ const newMenuSwitchItem = (label, state) => {
|
|||||||
return switchItem;
|
return switchItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
function log(msg) {
|
function BingLog(msg) {
|
||||||
if (BingDebug())
|
if (BingDebug())
|
||||||
console.log('BingWallpaper extension: ' + msg); // disable to keep the noise down in journal
|
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);
|
gsettings.set_string('picture-uri-dark', uri);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
log("unable to set dark background for : " + e);
|
BingLog("unable to set dark background for : " + e);
|
||||||
}
|
}
|
||||||
Gio.Settings.sync();
|
Gio.Settings.sync();
|
||||||
gsettings.apply();
|
gsettings.apply();
|
||||||
@ -296,12 +296,12 @@ class BingWallpaperIndicator extends Button {
|
|||||||
toggles.forEach( (e) => {
|
toggles.forEach( (e) => {
|
||||||
this.settings_connections.push(
|
this.settings_connections.push(
|
||||||
this._settings.connect('changed::'+e.key, () => {
|
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.setToggleState(this._settings.get_boolean(e.key));
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
e.toggle.connect('toggled', (item, state) => {
|
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);
|
this._setBooleanSetting(e.key, state);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -319,17 +319,17 @@ class BingWallpaperIndicator extends Button {
|
|||||||
|
|
||||||
_setBooleanSetting(key, state) {
|
_setBooleanSetting(key, state) {
|
||||||
let success = this._settings.set_boolean(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) {
|
_setStringSetting(key, value) {
|
||||||
let success = this._settings.set_string(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) {
|
_setIntSetting(key, value) {
|
||||||
let success = this._settings.set_int(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() {
|
_onDestroy() {
|
||||||
@ -358,14 +358,15 @@ class BingWallpaperIndicator extends Button {
|
|||||||
let maxlongdate = Utils.getMaxLongDate(this._settings);
|
let maxlongdate = Utils.getMaxLongDate(this._settings);
|
||||||
this.refreshduetext =
|
this.refreshduetext =
|
||||||
_("Next refresh") + ": " + (this.refreshdue ? this.refreshdue.format("%Y-%m-%d %X") : '-') +
|
_("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) : '-');
|
_("Last refresh") + ": " + (maxlongdate? this._localeDate(maxlongdate, true) : '-');
|
||||||
// also show when shuffle is next due
|
// also show when shuffle is next due
|
||||||
if (this._settings.get_boolean('random-mode-enabled')) {
|
if (this._settings.get_boolean('random-mode-enabled')) {
|
||||||
this.refreshduetext += "\n" + _("Next shuffle")+": " +
|
this.refreshduetext += "\n" + _("Next shuffle")+": " +
|
||||||
(this.shuffledue ? this.shuffledue.format("%Y-%m-%d %X") : '-') +
|
(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);
|
this.refreshDueItem.label.set_text(this.refreshduetext);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -378,7 +379,7 @@ class BingWallpaperIndicator extends Button {
|
|||||||
_setImage() {
|
_setImage() {
|
||||||
Utils.validate_imagename(this._settings);
|
Utils.validate_imagename(this._settings);
|
||||||
this.selected_image = this._settings.get_string('selected-image');
|
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._selectImage();
|
||||||
//this._setShuffleToggleState();
|
//this._setShuffleToggleState();
|
||||||
}
|
}
|
||||||
@ -398,7 +399,7 @@ class BingWallpaperIndicator extends Button {
|
|||||||
let icon_name = this._settings.get_string('icon-name');
|
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');
|
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'});
|
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.remove_all_children();
|
||||||
this.add_child(this.icon);
|
this.add_child(this.icon);
|
||||||
}
|
}
|
||||||
@ -411,7 +412,7 @@ class BingWallpaperIndicator extends Button {
|
|||||||
this._setThumbnailImage();
|
this._setThumbnailImage();
|
||||||
if (!this.dimensions.width || !this.dimensions.height) // if dimensions aren't in image database yet
|
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);
|
[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'))
|
if (this._settings.get_boolean('set-background'))
|
||||||
this._setBackgroundDesktop();
|
this._setBackgroundDesktop();
|
||||||
}
|
}
|
||||||
@ -439,7 +440,7 @@ class BingWallpaperIndicator extends Button {
|
|||||||
difference = 60;
|
difference = 60;
|
||||||
difference = difference + 300; // 5 minute fudge offset in case of inaccurate local clock
|
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);
|
this._restartTimeout(difference);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -450,7 +451,7 @@ class BingWallpaperIndicator extends Button {
|
|||||||
if (difference < 60 || difference > 86400) // clamp to a reasonable range
|
if (difference < 60 || difference > 86400) // clamp to a reasonable range
|
||||||
difference = 60;
|
difference = 60;
|
||||||
|
|
||||||
log('Next shuffle due ' + difference + ' seconds from now');
|
BingLog('Next shuffle due ' + difference + ' seconds from now');
|
||||||
this._restartShuffleTimeout(difference);
|
this._restartShuffleTimeout(difference);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -563,24 +564,26 @@ class BingWallpaperIndicator extends Button {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const image = new Clutter.Image();
|
const [version] = Config.PACKAGE_VERSION.split('.').map(s => Number(s));
|
||||||
const success = image.set_data(
|
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_pixels(),
|
||||||
pixbuf.get_has_alpha() ? Cogl.PixelFormat.RGBA_8888 : Cogl.PixelFormat.RGB_888,
|
pixbuf.get_has_alpha() ? Cogl.PixelFormat.RGBA_8888 : Cogl.PixelFormat.RGB_888,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
pixbuf.get_rowstride()
|
pixbuf.get_rowstride(),
|
||||||
);
|
]);
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
throw Error("error creating Clutter.Image()");
|
throw Error("error creating St.ImageContent()");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.thumbnailItem.hexpand = false;
|
this.thumbnailItem.hexpand = false;
|
||||||
this.thumbnailItem.vexpand = false;
|
this.thumbnailItem.vexpand = false;
|
||||||
this.thumbnailItem.content = image;
|
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.set_size(480*scale_factor, 270*scale_factor);
|
||||||
this.thumbnailItem.setSensitive(true);
|
this.thumbnailItem.setSensitive(true);
|
||||||
}
|
}
|
||||||
@ -606,7 +609,7 @@ class BingWallpaperIndicator extends Button {
|
|||||||
x.setSensitive(randomEnabled);
|
x.setSensitive(randomEnabled);
|
||||||
});
|
});
|
||||||
if (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._restartShuffleTimeout(5);
|
||||||
this._setBooleanSetting('revert-to-current-image', false);
|
this._setBooleanSetting('revert-to-current-image', false);
|
||||||
}
|
}
|
||||||
@ -619,19 +622,19 @@ class BingWallpaperIndicator extends Button {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_favouriteImage() {
|
_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;
|
this.favourite_status = !this.favourite_status;
|
||||||
Utils.setImageFavouriteStatus(this._settings, this.imageURL, 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);
|
this._setFavouriteIcon(this.favourite_status?this.ICON_FAVE_BUTTON:this.ICON_UNFAVE_BUTTON);
|
||||||
}
|
}
|
||||||
|
|
||||||
_trashImage() {
|
_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;
|
this.hidden_status = !this.hidden_status;
|
||||||
Utils.setImageHiddenStatus(this._settings, this.imageURL, 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);
|
this._setTrashIcon(this.hidden_status?this.ICON_UNTRASH_BUTTON:this.ICON_TRASH_BUTTON);
|
||||||
if (this._settings.get_boolean('trash-deletes-images')) {
|
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.deleteImage(this.filename);
|
||||||
Utils.validate_imagename(this._settings);
|
Utils.validate_imagename(this._settings);
|
||||||
}
|
}
|
||||||
@ -705,7 +708,7 @@ class BingWallpaperIndicator extends Button {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch(error) {
|
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);
|
notifyError('Unable to fetch Bing metadata\n'+error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -721,7 +724,7 @@ class BingWallpaperIndicator extends Button {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (error) {
|
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);
|
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
|
decoder.decode(this.httpSession.send_and_read_finish(message).get_data()): // Soup3
|
||||||
message.response_body.data; // Soup 2
|
message.response_body.data; // Soup 2
|
||||||
|
|
||||||
log('Recieved ' + data.length + ' bytes');
|
BingLog('Recieved ' + data.length + ' bytes');
|
||||||
this._parseData(data);
|
this._parseData(data);
|
||||||
|
|
||||||
if (!this._settings.get_boolean('random-mode-enabled'))
|
if (!this._settings.get_boolean('random-mode-enabled'))
|
||||||
this._selectImage();
|
this._selectImage();
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
log('Network error occured: ' + error);
|
BingLog('Network error occured: ' + error);
|
||||||
notifyError('network error occured\n'+error);
|
notifyError('network error occured\n'+error);
|
||||||
this._updatePending = false;
|
this._updatePending = false;
|
||||||
this._restartTimeout(TIMEOUT_SECONDS_ON_HTTP_ERROR);
|
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._timeout = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, seconds, this._refresh.bind(this));
|
||||||
this.refreshdue = GLib.DateTime.new_now_local().add_seconds(seconds);
|
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) {
|
_restartShuffleTimeout(seconds = null) {
|
||||||
log('_restartShuffleTimeout('+seconds+')');
|
BingLog('_restartShuffleTimeout('+seconds+')');
|
||||||
//console.trace();
|
//console.trace();
|
||||||
|
|
||||||
if (this._shuffleTimeout)
|
if (this._shuffleTimeout)
|
||||||
@ -770,14 +773,14 @@ class BingWallpaperIndicator extends Button {
|
|||||||
|
|
||||||
if (seconds == null) {
|
if (seconds == null) {
|
||||||
let diff = -Math.floor(GLib.DateTime.new_now_local().difference(this.shuffledue)/1000000);
|
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
|
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)
|
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') {
|
else if (this._settings.get_string('random-interval-mode') != 'custom') {
|
||||||
let random_mode = this._settings.get_string('random-interval-mode');
|
let random_mode = this._settings.get_string('random-interval-mode');
|
||||||
seconds = Utils.seconds_until(random_mode); // else we shuffle at specified interval (midnight default)
|
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 {
|
else {
|
||||||
seconds = this._settings.get_int('random-interval'); // or whatever the user has specified (as a timer)
|
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._shuffleTimeout = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, seconds, this._selectImage.bind(this, true));
|
||||||
this.shuffledue = GLib.DateTime.new_now_local().add_seconds(seconds);
|
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
|
// 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);
|
let newImages = Utils.mergeImageLists(this._settings, parsed.images);
|
||||||
|
|
||||||
if (datamarket != prefmarket && prefmarket != 'auto')
|
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.purgeImages(this._settings); // delete older images if enabled
|
||||||
//Utils.cleanupImageList(this._settings); // merged into purgeImages
|
//Utils.cleanupImageList(this._settings); // merged into purgeImages
|
||||||
@ -821,7 +824,7 @@ class BingWallpaperIndicator extends Button {
|
|||||||
if (!this._settings.get_boolean('notify-only-latest')) {
|
if (!this._settings.get_boolean('notify-only-latest')) {
|
||||||
// notify all new images
|
// notify all new images
|
||||||
newImages.forEach((image) => {
|
newImages.forEach((image) => {
|
||||||
log('New image to notify: ' + Utils.getImageTitle(image));
|
BingLog('New image to notify: ' + Utils.getImageTitle(image));
|
||||||
this._createImageNotification(image);
|
this._createImageNotification(image);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -829,7 +832,7 @@ class BingWallpaperIndicator extends Button {
|
|||||||
// notify only the most recent image
|
// notify only the most recent image
|
||||||
let last = newImages.pop();
|
let last = newImages.pop();
|
||||||
if (last) {
|
if (last) {
|
||||||
log('New image to notify: ' + Utils.getImageTitle(last));
|
BingLog('New image to notify: ' + Utils.getImageTitle(last));
|
||||||
this._createImageNotification(last);
|
this._createImageNotification(last);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -839,9 +842,9 @@ class BingWallpaperIndicator extends Button {
|
|||||||
this._updatePending = false;
|
this._updatePending = false;
|
||||||
}
|
}
|
||||||
catch (error) {
|
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);
|
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 msg = _('Bing Wallpaper of the Day for') + ' ' + this._localeDate(image.fullstartdate);
|
||||||
let details = Utils.getImageTitle(image);
|
let details = Utils.getImageTitle(image);
|
||||||
this._createNotification(msg, details);
|
this._createNotification(msg, details);
|
||||||
log('_createImageNotification: '+msg+' details: '+details);
|
BingLog('_createImageNotification: '+msg+' details: '+details);
|
||||||
}
|
}
|
||||||
|
|
||||||
_createNotification(msg, details) {
|
_createNotification(msg, details) {
|
||||||
@ -869,7 +872,7 @@ class BingWallpaperIndicator extends Button {
|
|||||||
});
|
});
|
||||||
systemSource.addNotification(bingNotify);
|
systemSource.addNotification(bingNotify);
|
||||||
//Main.notify(msg, details);
|
//Main.notify(msg, details);
|
||||||
log('_createNotification: '+msg+' details: '+details);
|
BingLog('_createNotification: '+msg+' details: '+details);
|
||||||
}
|
}
|
||||||
|
|
||||||
_shuffleImage() {
|
_shuffleImage() {
|
||||||
@ -885,7 +888,7 @@ class BingWallpaperIndicator extends Button {
|
|||||||
imageList = favImageList;
|
imageList = favImageList;
|
||||||
}
|
}
|
||||||
else {
|
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
|
// shuffle could fail for a number of reasons
|
||||||
@ -893,12 +896,12 @@ class BingWallpaperIndicator extends Button {
|
|||||||
this.imageIndex = Utils.getRandomInt(imageList.length);
|
this.imageIndex = Utils.getRandomInt(imageList.length);
|
||||||
image = imageList[this.imageIndex];
|
image = imageList[this.imageIndex];
|
||||||
|
|
||||||
log('shuffled to image '+image.urlbase);
|
BingLog('shuffled to image '+image.urlbase);
|
||||||
|
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
log('shuffle failed '+e);
|
BingLog('shuffle failed '+e);
|
||||||
return null;
|
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
|
// special values, 'current' is most recent (default mode), 'random' picks one at random, anything else should be filename
|
||||||
|
|
||||||
if (force_shuffle) {
|
if (force_shuffle) {
|
||||||
log('forcing shuffle of image')
|
BingLog('forcing shuffle of image')
|
||||||
image = this._shuffleImage();
|
image = this._shuffleImage();
|
||||||
if (this._settings.get_boolean('random-mode-enabled'))
|
if (this._settings.get_boolean('random-mode-enabled'))
|
||||||
this._restartShuffleTimeout();
|
this._restartShuffleTimeout();
|
||||||
@ -927,7 +930,7 @@ class BingWallpaperIndicator extends Button {
|
|||||||
|
|
||||||
if (image)
|
if (image)
|
||||||
this.imageIndex = Utils.imageIndex(imageList, image.urlbase);
|
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);
|
let stateJSON = JSON.stringify(state);
|
||||||
|
|
||||||
log('Storing state as JSON: ' + stateJSON);
|
BingLog('Storing state as JSON: ' + stateJSON);
|
||||||
this._setStringSetting('state', stateJSON);
|
this._setStringSetting('state', stateJSON);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1016,7 +1019,7 @@ class BingWallpaperIndicator extends Button {
|
|||||||
let state = JSON.parse(stateJSON);
|
let state = JSON.parse(stateJSON);
|
||||||
let maxLongDate = null;
|
let maxLongDate = null;
|
||||||
|
|
||||||
log('restoring state...');
|
BingLog('restoring state...');
|
||||||
maxLongDate = state.maxlongdate ? state.maxlongdate : null;
|
maxLongDate = state.maxlongdate ? state.maxlongdate : null;
|
||||||
this.title = state.title;
|
this.title = state.title;
|
||||||
this.explanation = state.explanation;
|
this.explanation = state.explanation;
|
||||||
@ -1040,7 +1043,7 @@ class BingWallpaperIndicator extends Button {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this._settings.get_boolean('random-mode-enabled')) {
|
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._restartShuffleTimeoutFromDueDate(this.shuffledue); // FIXME: use state value
|
||||||
this._restartTimeoutFromLongDate(maxLongDate);
|
this._restartTimeoutFromLongDate(maxLongDate);
|
||||||
}
|
}
|
||||||
@ -1051,7 +1054,7 @@ class BingWallpaperIndicator extends Button {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
log('bad state - refreshing... error was ' + error);
|
BingLog('bad state - refreshing... error was ' + error);
|
||||||
}
|
}
|
||||||
this._restartTimeout(60);
|
this._restartTimeout(60);
|
||||||
}
|
}
|
||||||
@ -1079,7 +1082,7 @@ class BingWallpaperIndicator extends Button {
|
|||||||
notifyError('Download folder '+BingWallpaperDir+' does not exist or is not writable');
|
notifyError('Download folder '+BingWallpaperDir+' does not exist or is not writable');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
log("Downloading " + url + " to " + file.get_uri());
|
BingLog("Downloading " + url + " to " + file.get_uri());
|
||||||
let request = Soup.Message.new('GET', url);
|
let request = Soup.Message.new('GET', url);
|
||||||
|
|
||||||
// queue the http request
|
// queue the http request
|
||||||
@ -1096,7 +1099,7 @@ class BingWallpaperIndicator extends Button {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
log('error sending libsoup message '+error);
|
BingLog('error sending libsoup message '+error);
|
||||||
notifyError('Network error '+error);
|
notifyError('Network error '+error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1118,17 +1121,17 @@ class BingWallpaperIndicator extends Button {
|
|||||||
file.replace_contents_finish(res);
|
file.replace_contents_finish(res);
|
||||||
if (set_background)
|
if (set_background)
|
||||||
this._setBackground();
|
this._setBackground();
|
||||||
log('Download successful');
|
BingLog('Download successful');
|
||||||
}
|
}
|
||||||
catch(e) {
|
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);
|
notifyError('Image '+file.get_path()+' is not writable, check folder permissions or select a different folder\n'+e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
catch (error) {
|
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);
|
notifyError('Image '+file.get_path()+' file error, check folder permissions, disk space or select a different folder\n'+e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,9 +7,10 @@
|
|||||||
"shell-version": [
|
"shell-version": [
|
||||||
"45",
|
"45",
|
||||||
"46",
|
"46",
|
||||||
"47"
|
"47",
|
||||||
|
"48"
|
||||||
],
|
],
|
||||||
"url": "https://github.com/neffo/bing-wallpaper-gnome-extension",
|
"url": "https://github.com/neffo/bing-wallpaper-gnome-extension",
|
||||||
"uuid": "BingWallpaper@ineffable-gmail.com",
|
"uuid": "BingWallpaper@ineffable-gmail.com",
|
||||||
"version": 50
|
"version": 51
|
||||||
}
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
// Bing Wallpaper GNOME extension
|
// 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
|
// 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
|
// 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
|
// 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 carousel = null;
|
||||||
let httpSession = null;
|
let httpSession = null;
|
||||||
|
|
||||||
let log = (msg) => { // avoids need for globals
|
let BingLog = (msg) => { // avoids need for globals
|
||||||
if (settings.get_boolean('debug-logging'))
|
if (settings.get_boolean('debug-logging'))
|
||||||
console.log("BingWallpaper extension: " + msg); // disable to keep the noise down in journal
|
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 debug_page = buildable.get_object('debug_page');
|
||||||
const json_actionrow = buildable.get_object('json_actionrow');
|
const json_actionrow = buildable.get_object('json_actionrow');
|
||||||
const about_page = buildable.get_object('about_page');
|
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');
|
const change_log = buildable.get_object('change_log');
|
||||||
|
|
||||||
window.add(settings_page);
|
window.add(settings_page);
|
||||||
@ -104,18 +104,12 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen
|
|||||||
|
|
||||||
// add wallpaper folder open and change buttons
|
// add wallpaper folder open and change buttons
|
||||||
const openBtn = new Gtk.Button( {
|
const openBtn = new Gtk.Button( {
|
||||||
child: new Adw.ButtonContent({
|
|
||||||
icon_name: 'folder-pictures-symbolic',
|
|
||||||
label: _('Open folder'),
|
label: _('Open folder'),
|
||||||
},),
|
|
||||||
valign: Gtk.Align.CENTER,
|
valign: Gtk.Align.CENTER,
|
||||||
halign: Gtk.Align.CENTER,
|
halign: Gtk.Align.CENTER,
|
||||||
});
|
});
|
||||||
const changeBtn = new Gtk.Button( {
|
const changeBtn = new Gtk.Button( {
|
||||||
child: new Adw.ButtonContent({
|
|
||||||
icon_name: 'folder-download-symbolic',
|
|
||||||
label: _('Change folder'),
|
label: _('Change folder'),
|
||||||
},),
|
|
||||||
valign: Gtk.Align.CENTER,
|
valign: Gtk.Align.CENTER,
|
||||||
halign: 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'));
|
brightnessAdjustment.set_value(settings.get_int('lockscreen-blur-brightness'));
|
||||||
|
|
||||||
const defaultBtn = new Gtk.Button( {
|
const defaultBtn = new Gtk.Button( {
|
||||||
child: new Adw.ButtonContent({
|
|
||||||
icon_name: 'emblem-default-symbolic',
|
|
||||||
label: _('Default'),
|
label: _('Default'),
|
||||||
},),
|
|
||||||
valign: Gtk.Align.CENTER,
|
valign: Gtk.Align.CENTER,
|
||||||
halign: Gtk.Align.CENTER,
|
halign: Gtk.Align.CENTER,
|
||||||
});
|
});
|
||||||
const noBlurBtn = new Gtk.Button( {
|
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,
|
valign: Gtk.Align.CENTER,
|
||||||
halign: Gtk.Align.CENTER,
|
halign: Gtk.Align.CENTER,
|
||||||
});
|
});
|
||||||
const slightBlurBtn = new Gtk.Button( {
|
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,
|
valign: Gtk.Align.CENTER,
|
||||||
halign: 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
|
// these buttons either export or import saved JSON data
|
||||||
const buttonImportData = new Gtk.Button( {
|
const buttonImportData = new Gtk.Button( {
|
||||||
child: new Adw.ButtonContent({
|
|
||||||
icon_name: 'document-send-symbolic',
|
|
||||||
label: _('Import'),
|
label: _('Import'),
|
||||||
},),
|
|
||||||
valign: Gtk.Align.CENTER,
|
valign: Gtk.Align.CENTER,
|
||||||
halign: Gtk.Align.CENTER,
|
halign: Gtk.Align.CENTER,
|
||||||
});
|
});
|
||||||
const buttonExportData = new Gtk.Button( {
|
const buttonExportData = new Gtk.Button( {
|
||||||
child: new Adw.ButtonContent({
|
|
||||||
icon_name: 'document-save-symbolic',
|
|
||||||
label: _('Export'),
|
label: _('Export'),
|
||||||
},),
|
|
||||||
valign: Gtk.Align.CENTER,
|
valign: Gtk.Align.CENTER,
|
||||||
halign: 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(buttonImportData);
|
||||||
json_actionrow.add_suffix(buttonExportData);
|
json_actionrow.add_suffix(buttonExportData);
|
||||||
|
|
||||||
version_button.set_label(this.metadata.version.toString());
|
version_row.set_subtitle(this.metadata.version.toString());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
httpSession = new Soup.Session();
|
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;
|
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) {
|
catch (e) {
|
||||||
log("Error creating httpSession: " + e);
|
BingLog("Error creating httpSession: " + e);
|
||||||
}
|
}
|
||||||
const icon_image = buildable.get_object('icon_image');
|
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)
|
// check that these are valid (can be edited through dconf-editor)
|
||||||
Utils.validate_resolution(settings);
|
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);
|
Utils.validate_interval(settings);
|
||||||
|
|
||||||
// Indicator & notifications
|
// Indicator & notifications
|
||||||
settings.bind('hide', hideSwitch, 'active', Gio.SettingsBindFlags.DEFAULT);
|
settings.bind('hide', hideSwitch, 'active', Gio.SettingsBindFlags.DEFAULT);
|
||||||
settings.bind('notify', notifySwitch, 'active', Gio.SettingsBindFlags.DEFAULT);
|
settings.bind('notify', notifySwitch, 'active', Gio.SettingsBindFlags.DEFAULT);
|
||||||
settings.connect('changed::icon-name', () => {
|
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')));
|
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.set_initial_folder(Gio.File.new_for_path(Utils.getWallpaperDir(settings)));
|
||||||
dirChooser.select_folder(window, null, (self, res) => {
|
dirChooser.select_folder(window, null, (self, res) => {
|
||||||
let new_path = self.select_folder_finish(res).get_uri().replace('file://', '');
|
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.moveImagesToNewFolder(settings, Utils.getWallpaperDir(settings), new_path);
|
||||||
Utils.setWallpaperDir(settings, new_path);
|
Utils.setWallpaperDir(settings, new_path);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// Bing Wallpaper GNOME extension
|
// 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
|
// 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
|
// 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
|
// 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.pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(filePath, w, h);
|
||||||
this.srcFile = Gio.File.new_for_path(filePath);
|
this.srcFile = Gio.File.new_for_path(filePath);
|
||||||
} catch (err) {
|
} 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -68,6 +68,9 @@ Author: Michael Carroll
|
|||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="vexpand">1</property>
|
<property name="vexpand">1</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
|
<style>
|
||||||
|
<class name="linked"/>
|
||||||
|
</style>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="favButton">
|
<object class="GtkButton" id="favButton">
|
||||||
<property name="tooltip-text" translatable="yes">Favorite</property>
|
<property name="tooltip-text" translatable="yes">Favorite</property>
|
||||||
|
|||||||
@ -23,7 +23,7 @@ Bing Wallpaper GNOME extension by: Michael Carroll
|
|||||||
<requires lib="gtk" version="4.0"/>
|
<requires lib="gtk" version="4.0"/>
|
||||||
<requires lib="libadwaita" version="1.0"/>
|
<requires lib="libadwaita" version="1.0"/>
|
||||||
<object class="AdwPreferencesPage" id="settings_page">
|
<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>
|
<property name="title" translatable="yes">Settings</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwPreferencesGroup" id="ui_group">
|
<object class="AdwPreferencesGroup" id="ui_group">
|
||||||
@ -110,7 +110,7 @@ Bing Wallpaper GNOME extension by: Michael Carroll
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<object class="AdwPreferencesPage" id="lockscreen_page">
|
<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>
|
<property name="title" translatable="yes">Lock screen</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwPreferencesGroup" id="ls_group">
|
<object class="AdwPreferencesGroup" id="ls_group">
|
||||||
@ -163,7 +163,7 @@ Bing Wallpaper GNOME extension by: Michael Carroll
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<object class="AdwPreferencesPage" id="gallery_page">
|
<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>
|
<property name="title" translatable="yes">Gallery</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkScrolledWindow" id="carouselViewPort">
|
<object class="GtkScrolledWindow" id="carouselViewPort">
|
||||||
@ -286,7 +286,8 @@ Bing Wallpaper GNOME extension by: Michael Carroll
|
|||||||
<!-- <property name="orientation">vertical</property>-->
|
<!-- <property name="orientation">vertical</property>-->
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImage" id="app_icon_image">
|
<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>
|
<property name="accessible-role">presentation</property>
|
||||||
<style>
|
<style>
|
||||||
<class name="icon-dropshadow"/>
|
<class name="icon-dropshadow"/>
|
||||||
@ -324,19 +325,13 @@ Bing Wallpaper GNOME extension by: Michael Carroll
|
|||||||
<child>
|
<child>
|
||||||
<object class="AdwPreferencesGroup" id="change_log_group">
|
<object class="AdwPreferencesGroup" id="change_log_group">
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwActionRow" id="details_row">
|
<object class="AdwActionRow" id="version_row">
|
||||||
<property name="title" translatable="yes">Version</property>
|
<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>
|
<style>
|
||||||
<class name="app-version"/>
|
<class name="property"/>
|
||||||
</style>
|
</style>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwExpanderRow" id="expander_row">
|
<object class="AdwExpanderRow" id="expander_row">
|
||||||
<property name="title" translatable="yes">Release notes</property>
|
<property name="title" translatable="yes">Release notes</property>
|
||||||
@ -367,6 +362,8 @@ Bing Wallpaper GNOME extension by: Michael Carroll
|
|||||||
<child>
|
<child>
|
||||||
<object class="GtkLinkButton" id="extension_page_linkbutton">
|
<object class="GtkLinkButton" id="extension_page_linkbutton">
|
||||||
<property name="uri">https://extensions.gnome.org/extension/1262/bing-wallpaper-changer/</property>
|
<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>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@ -386,6 +383,8 @@ Bing Wallpaper GNOME extension by: Michael Carroll
|
|||||||
<child>
|
<child>
|
||||||
<object class="GtkLinkButton" id="source_code_linkbutton">
|
<object class="GtkLinkButton" id="source_code_linkbutton">
|
||||||
<property name="uri">https://github.com/neffo/bing-wallpaper-gnome-extension</property>
|
<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>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@ -405,6 +404,8 @@ Bing Wallpaper GNOME extension by: Michael Carroll
|
|||||||
<child>
|
<child>
|
||||||
<object class="GtkLinkButton" id="bug_report_linkbutton">
|
<object class="GtkLinkButton" id="bug_report_linkbutton">
|
||||||
<property name="uri">https://github.com/neffo/bing-wallpaper-gnome-extension/issues</property>
|
<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>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@ -424,6 +425,8 @@ Bing Wallpaper GNOME extension by: Michael Carroll
|
|||||||
<child>
|
<child>
|
||||||
<object class="GtkLinkButton" id="contributors_linkbutton">
|
<object class="GtkLinkButton" id="contributors_linkbutton">
|
||||||
<property name="uri">https://github.com/neffo/bing-wallpaper-gnome-extension/graphs/contributors</property>
|
<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>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// Bing Wallpaper GNOME extension
|
// 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
|
// 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
|
// 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
|
// 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 BingImageURL = 'https://www.bing.com/HPImageArchive.aspx';
|
||||||
export var BingParams = { format: 'js', idx: '0' , n: '8' , mbl: '1' , mkt: '' } ;
|
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()');
|
BingLog('validate_icon()');
|
||||||
let icon_name = settings.get_string('icon-name');
|
let icon_name = settings.get_string('icon-name');
|
||||||
if (icon_name == '' || icon_list.indexOf(icon_name) == -1) {
|
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');
|
icon_name = settings.get_string('icon-name');
|
||||||
}
|
}
|
||||||
// if called from prefs
|
// if called from prefs
|
||||||
if (icon_image) {
|
if (icon_image && app_icon_image) {
|
||||||
BingLog('set icon to: ' + extension_path + '/icons/' + icon_name + '.svg');
|
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);
|
let pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(extension_path + '/icons/' + icon_name + '.svg', 64, 64);
|
||||||
icon_image.set_from_pixbuf(pixbuf);
|
icon_image.set_from_pixbuf(pixbuf);
|
||||||
|
app_icon_image.set_from_pixbuf(pixbuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -54,7 +54,7 @@ export function TalkativeLog(msg) {
|
|||||||
* @returns {string} the version
|
* @returns {string} the version
|
||||||
*/
|
*/
|
||||||
export function getFullVersion() {
|
export function getFullVersion() {
|
||||||
return '1.10.0'; // FULL_VERSION
|
return '1.11.0'; // FULL_VERSION
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -6,9 +6,10 @@
|
|||||||
"settings-schema": "org.gnome.shell.extensions.EasyScreenCast",
|
"settings-schema": "org.gnome.shell.extensions.EasyScreenCast",
|
||||||
"shell-version": [
|
"shell-version": [
|
||||||
"46",
|
"46",
|
||||||
"47"
|
"47",
|
||||||
|
"48"
|
||||||
],
|
],
|
||||||
"url": "https://github.com/EasyScreenCast/EasyScreenCast",
|
"url": "https://github.com/EasyScreenCast/EasyScreenCast",
|
||||||
"uuid": "EasyScreenCast@iacopodeenosee.gmail.com",
|
"uuid": "EasyScreenCast@iacopodeenosee.gmail.com",
|
||||||
"version": 51
|
"version": 52
|
||||||
}
|
}
|
||||||
@ -67,8 +67,7 @@ var VitalsMenuButton = GObject.registerClass({
|
|||||||
x_align: Clutter.ActorAlign.START,
|
x_align: Clutter.ActorAlign.START,
|
||||||
y_align: Clutter.ActorAlign.CENTER,
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
reactive: true,
|
reactive: true,
|
||||||
x_expand: true,
|
x_expand: true
|
||||||
pack_start: false
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this._drawMenu();
|
this._drawMenu();
|
||||||
@ -128,8 +127,7 @@ var VitalsMenuButton = GObject.registerClass({
|
|||||||
x_align: Clutter.ActorAlign.CENTER,
|
x_align: Clutter.ActorAlign.CENTER,
|
||||||
y_align: Clutter.ActorAlign.CENTER,
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
reactive: true,
|
reactive: true,
|
||||||
x_expand: true,
|
x_expand: true
|
||||||
pack_start: false
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// custom round refresh button
|
// custom round refresh button
|
||||||
@ -417,8 +415,7 @@ var VitalsMenuButton = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(key === "_gpu#1_domain_number_")
|
|
||||||
console.error('UPDATING: ', key);
|
|
||||||
// have we added this sensor before?
|
// have we added this sensor before?
|
||||||
let item = this._sensorMenuItems[key];
|
let item = this._sensorMenuItems[key];
|
||||||
if (item) {
|
if (item) {
|
||||||
@ -567,7 +564,6 @@ var VitalsMenuButton = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
let centered = this._settings.get_boolean('menu-centered')
|
let centered = this._settings.get_boolean('menu-centered')
|
||||||
|
|
||||||
if (centered) arrow_pos = 0.5;
|
if (centered) arrow_pos = 0.5;
|
||||||
|
|
||||||
// set arrow position when initializing and moving vitals
|
// set arrow position when initializing and moving vitals
|
||||||
|
|||||||
@ -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 |
@ -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 |
@ -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 |
@ -10,9 +10,10 @@
|
|||||||
"shell-version": [
|
"shell-version": [
|
||||||
"45",
|
"45",
|
||||||
"46",
|
"46",
|
||||||
"47"
|
"47",
|
||||||
|
"48"
|
||||||
],
|
],
|
||||||
"url": "https://github.com/corecoding/Vitals",
|
"url": "https://github.com/corecoding/Vitals",
|
||||||
"uuid": "Vitals@CoreCoding.com",
|
"uuid": "Vitals@CoreCoding.com",
|
||||||
"version": 69
|
"version": 71
|
||||||
}
|
}
|
||||||
@ -898,7 +898,7 @@
|
|||||||
<property name="halign">start</property>
|
<property name="halign">start</property>
|
||||||
<property name="margin-start">5</property>
|
<property name="margin-start">5</property>
|
||||||
<property name="margin-end">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>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@ -1224,6 +1224,8 @@
|
|||||||
<item translatable="yes">BAT2</item>
|
<item translatable="yes">BAT2</item>
|
||||||
<item translatable="yes">BATT</item>
|
<item translatable="yes">BATT</item>
|
||||||
<item translatable="yes">CMB0</item>
|
<item translatable="yes">CMB0</item>
|
||||||
|
<item translatable="yes">CMB1</item>
|
||||||
|
<item translatable="yes">CMB2</item>
|
||||||
<item translatable="yes">macsmc-battery</item>
|
<item translatable="yes">macsmc-battery</item>
|
||||||
</items>
|
</items>
|
||||||
</object>
|
</object>
|
||||||
|
|||||||
@ -54,6 +54,8 @@ export const Sensors = GObject.registerClass({
|
|||||||
this._addSettingChangedSignal('update-time', this._reconfigureNvidiaSmiProcess.bind(this));
|
this._addSettingChangedSignal('update-time', this._reconfigureNvidiaSmiProcess.bind(this));
|
||||||
//this._addSettingChangedSignal('include-static-gpu-info', 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_smi_process = null;
|
||||||
this._nvidia_labels = [];
|
this._nvidia_labels = [];
|
||||||
this._bad_split_count = 0;
|
this._bad_split_count = 0;
|
||||||
@ -74,7 +76,7 @@ export const Sensors = GObject.registerClass({
|
|||||||
|
|
||||||
_refreshIPAddress(callback) {
|
_refreshIPAddress(callback) {
|
||||||
// check IP address
|
// 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);
|
let obj = JSON.parse(contents);
|
||||||
this._returnValue(callback, 'Public IP', obj['IPv4'], 'network', 'string');
|
this._returnValue(callback, 'Public IP', obj['IPv4'], 'network', 'string');
|
||||||
}).catch(err => { });
|
}).catch(err => { });
|
||||||
@ -375,20 +377,20 @@ export const Sensors = GObject.registerClass({
|
|||||||
_queryBattery(callback) {
|
_queryBattery(callback) {
|
||||||
let battery_slot = this._settings.get_int('battery-slot');
|
let battery_slot = this._settings.get_int('battery-slot');
|
||||||
|
|
||||||
// addresses issue #161
|
// create a mapping of indices to battery paths (from prefs.ui)
|
||||||
let battery_key = 'BAT'; // BAT0, BAT1 and BAT2
|
const BATTERY_PATHS = {
|
||||||
if (battery_slot == 3) {
|
0: 'BAT0',
|
||||||
battery_slot = 'T';
|
1: 'BAT1',
|
||||||
} else if (battery_slot == 4) {
|
2: 'BAT2',
|
||||||
battery_key = 'CMB'; // CMB0
|
3: 'BATT',
|
||||||
battery_slot = 0;
|
4: 'CMB0',
|
||||||
} else if (battery_slot == 5) {
|
5: 'CMB1',
|
||||||
battery_key = 'macsmc-battery'; // supports Asahi linux
|
6: 'CMB2',
|
||||||
battery_slot = '';
|
7: 'macsmc-battery'
|
||||||
}
|
};
|
||||||
|
|
||||||
// uevent has all necessary fields, no need to read individual files
|
// 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 => {
|
new FileModule.File(battery_path).read("\n").then(lines => {
|
||||||
let output = {};
|
let output = {};
|
||||||
for (let line of lines) {
|
for (let line of lines) {
|
||||||
@ -496,8 +498,14 @@ export const Sensors = GObject.registerClass({
|
|||||||
|
|
||||||
_queryGpu(callback) {
|
_queryGpu(callback) {
|
||||||
if (!this._nvidia_smi_process) {
|
if (!this._nvidia_smi_process) {
|
||||||
|
// no nvidia-smi, so we use sysfs DRM if any cards was discovered
|
||||||
|
if (!this._gpu_drm_indices){
|
||||||
this._disableGpuLabels(callback);
|
this._disableGpuLabels(callback);
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
this._readGpuDrm(callback);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this._nvidia_smi_process.read('\n').then(lines => {
|
this._nvidia_smi_process.read('\n').then(lines => {
|
||||||
@ -511,7 +519,6 @@ export const Sensors = GObject.registerClass({
|
|||||||
this._parseNvidiaSmiLine(callback, lines[i], i + 1, lines.length > 1);
|
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.
|
// 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
|
// 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
|
// and the nvidia-smi commmand won't be queried for static info either
|
||||||
@ -572,13 +579,10 @@ export const Sensors = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const typeName = 'gpu#' + gpuNum;
|
const typeName = 'gpu#' + gpuNum;
|
||||||
const globalLabel = 'GPU' + (multiGpu ? ' ' + gpuNum : '');
|
const globalLabel = 'GPU' + (multiGpu ? ' ' + gpuNum : '');
|
||||||
|
|
||||||
const memTempValid = !isNaN(parseInt(temp_mem));
|
const memTempValid = !isNaN(parseInt(temp_mem));
|
||||||
|
|
||||||
|
|
||||||
this._returnGpuValue(callback, 'Graphics', parseInt(util_gpu) * 0.01, typeName + '-group', 'percent');
|
this._returnGpuValue(callback, 'Graphics', parseInt(util_gpu) * 0.01, typeName + '-group', 'percent');
|
||||||
|
|
||||||
this._returnGpuValue(callback, 'Name', label, typeName, '');
|
this._returnGpuValue(callback, 'Name', label, typeName, '');
|
||||||
@ -628,6 +632,50 @@ export const Sensors = GObject.registerClass({
|
|||||||
this._returnStaticGpuValue(callback, 'Sub Device ID', staticInfo['sub_device_id'], typeName, 'string');
|
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) {
|
_disableGpuLabels(callback) {
|
||||||
for (let labelObj of this._nvidia_labels)
|
for (let labelObj of this._nvidia_labels)
|
||||||
this._returnValue(callback, labelObj.label, 'disabled', labelObj.type, labelObj.format);
|
this._returnValue(callback, labelObj.label, 'disabled', labelObj.type, labelObj.format);
|
||||||
@ -645,7 +693,7 @@ export const Sensors = GObject.registerClass({
|
|||||||
_returnGpuValue(callback, label, value, type, format, display = true) {
|
_returnGpuValue(callback, label, value, type, format, display = true) {
|
||||||
if(!display) return;
|
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};
|
let nvidiaLabel = {'label': label, 'type': type, 'format': format};
|
||||||
if (!this._nvidia_labels.includes(nvidiaLabel))
|
if (!this._nvidia_labels.includes(nvidiaLabel))
|
||||||
@ -748,6 +796,27 @@ export const Sensors = GObject.registerClass({
|
|||||||
|
|
||||||
// Launch nvidia-smi subprocess if nvidia querying is enabled
|
// Launch nvidia-smi subprocess if nvidia querying is enabled
|
||||||
this._reconfigureNvidiaSmiProcess();
|
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
|
// The nvidia-smi subprocess will keep running and print new sensor data to stdout every
|
||||||
|
|||||||
@ -7,7 +7,8 @@
|
|||||||
"shell-version": [
|
"shell-version": [
|
||||||
"45",
|
"45",
|
||||||
"46",
|
"46",
|
||||||
"47"
|
"47",
|
||||||
|
"48"
|
||||||
],
|
],
|
||||||
"url": "https://github.com/ubuntu/gnome-shell-extension-appindicator",
|
"url": "https://github.com/ubuntu/gnome-shell-extension-appindicator",
|
||||||
"uuid": "appindicatorsupport@rgcjonas.gmail.com",
|
"uuid": "appindicatorsupport@rgcjonas.gmail.com",
|
||||||
|
|||||||
@ -11,10 +11,10 @@
|
|||||||
"original-author": "mi-jan-sena@proton.me",
|
"original-author": "mi-jan-sena@proton.me",
|
||||||
"settings-schema": "org.gnome.shell.extensions.auto-activities",
|
"settings-schema": "org.gnome.shell.extensions.auto-activities",
|
||||||
"shell-version": [
|
"shell-version": [
|
||||||
"47"
|
"48"
|
||||||
],
|
],
|
||||||
"url": "https://github.com/CleoMenezesJr/auto-activities",
|
"url": "https://github.com/CleoMenezesJr/auto-activities",
|
||||||
"uuid": "auto-activities@CleoMenezesJr.github.io",
|
"uuid": "auto-activities@CleoMenezesJr.github.io",
|
||||||
"version": 14,
|
"version": 15,
|
||||||
"version-name": "47.0"
|
"version-name": "48.0"
|
||||||
}
|
}
|
||||||
@ -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>.
|
||||||
@ -148,6 +148,14 @@ export const OverviewBlur = class OverviewBlur {
|
|||||||
}
|
}
|
||||||
// add the container widget for the overview only to the overview group
|
// add the container widget for the overview only to the overview group
|
||||||
Main.layoutManager.overviewGroup.insert_child_at_index(this.overview_background_group, 0);
|
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
|
/// Updates the classname to style overview components with semi-transparent
|
||||||
@ -166,6 +174,11 @@ export const OverviewBlur = class OverviewBlur {
|
|||||||
remove_background_actors() {
|
remove_background_actors() {
|
||||||
this.overview_background_group.remove_all_children();
|
this.overview_background_group.remove_all_children();
|
||||||
this.animation_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 => {
|
this.overview_background_managers.forEach(background_manager => {
|
||||||
background_manager._bms_pipeline.destroy();
|
background_manager._bms_pipeline.destroy();
|
||||||
background_manager.destroy();
|
background_manager.destroy();
|
||||||
|
|||||||
@ -54,9 +54,6 @@ export const PanelBlur = class PanelBlur {
|
|||||||
// the blur when a window is near a panel
|
// the blur when a window is near a panel
|
||||||
this.connect_to_windows_and_overview();
|
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
|
// connect to workareas change
|
||||||
this.connections.connect(global.display, 'workareas-changed',
|
this.connections.connect(global.display, 'workareas-changed',
|
||||||
_ => this.reset()
|
_ => this.reset()
|
||||||
@ -468,12 +465,16 @@ export const PanelBlur = class PanelBlur {
|
|||||||
this.settings.panel.OVERRIDE_BACKGROUND
|
this.settings.panel.OVERRIDE_BACKGROUND
|
||||||
&&
|
&&
|
||||||
should_override
|
should_override
|
||||||
)
|
) {
|
||||||
panel.add_style_class_name(
|
panel.add_style_class_name(
|
||||||
PANEL_STYLES[this.settings.panel.STYLE_PANEL]
|
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() {
|
update_pipeline() {
|
||||||
this.actors_list.forEach(actors =>
|
this.actors_list.forEach(actors =>
|
||||||
actors.bg_manager._bms_pipeline.change_pipeline_to(
|
actors.bg_manager._bms_pipeline.change_pipeline_to(
|
||||||
|
|||||||
@ -148,6 +148,11 @@ export function get_supported_effects(_ = () => "") {
|
|||||||
name: _("Use base pixel"),
|
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."),
|
description: _("Whether or not the original pixel is counted for the blur. If it is, the image will be more legible."),
|
||||||
type: "boolean"
|
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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -5,6 +5,7 @@ uniform float brightness;
|
|||||||
uniform float width;
|
uniform float width;
|
||||||
uniform float height;
|
uniform float height;
|
||||||
uniform bool use_base_pixel;
|
uniform bool use_base_pixel;
|
||||||
|
uniform bool prefer_closer_pixels;
|
||||||
|
|
||||||
float srand(vec2 a) {
|
float srand(vec2 a) {
|
||||||
return sin(dot(a, vec2(1233.224, 1743.335)));
|
return sin(dot(a, vec2(1233.224, 1743.335)));
|
||||||
@ -19,24 +20,31 @@ void main() {
|
|||||||
vec2 uv = cogl_tex_coord0_in.st;
|
vec2 uv = cogl_tex_coord0_in.st;
|
||||||
vec2 p = 16 * radius / vec2(width, height);
|
vec2 p = 16 * radius / vec2(width, height);
|
||||||
float r = srand(uv);
|
float r = srand(uv);
|
||||||
|
|
||||||
vec2 rv;
|
vec2 rv;
|
||||||
|
vec2 dir;
|
||||||
|
vec2 new_uv;
|
||||||
|
int strength;
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
vec4 c = vec4(0.);
|
vec4 c = vec4(0.);
|
||||||
|
|
||||||
for (int i = 0; i < iterations; i++) {
|
for (int i = 0; i < iterations; i++) {
|
||||||
rv.x = rand(r);
|
rv.x = rand(r);
|
||||||
rv.y = rand(r);
|
rv.y = rand(r) * 3.141592;
|
||||||
vec2 new_uv = uv + rv * p;
|
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) {
|
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);
|
strength = prefer_closer_pixels ? (iterations - i)^2 : 1;
|
||||||
count += 1;
|
c += strength * texture2D(tex, new_uv);
|
||||||
|
count += strength;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count == 0 || use_base_pixel) {
|
if (count == 0 || use_base_pixel) {
|
||||||
c += texture2D(tex, uv);
|
strength = prefer_closer_pixels ? (iterations + 1)^2 : 1;
|
||||||
count += 1;
|
c += strength * texture2D(tex, uv);
|
||||||
|
count += strength;
|
||||||
}
|
}
|
||||||
|
|
||||||
c.xyz *= brightness;
|
c.xyz *= brightness;
|
||||||
|
|||||||
@ -8,7 +8,8 @@ const Clutter = await utils.import_in_shell_only('gi://Clutter');
|
|||||||
const SHADER_FILENAME = 'monte_carlo_blur.glsl';
|
const SHADER_FILENAME = 'monte_carlo_blur.glsl';
|
||||||
const DEFAULT_PARAMS = {
|
const DEFAULT_PARAMS = {
|
||||||
radius: 2., iterations: 5, brightness: .6,
|
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,
|
GObject.ParamFlags.READWRITE,
|
||||||
true,
|
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 {
|
}, class MonteCarloBlurEffect extends Clutter.ShaderEffect {
|
||||||
constructor(params) {
|
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) {
|
vfunc_set_actor(actor) {
|
||||||
if (this._actor_connection_size_id) {
|
if (this._actor_connection_size_id) {
|
||||||
let old_actor = this.get_actor();
|
let old_actor = this.get_actor();
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import Meta from 'gi://Meta';
|
import Meta from 'gi://Meta';
|
||||||
import Clutter from 'gi://Clutter';
|
import Clutter from 'gi://Clutter';
|
||||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
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';
|
import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js';
|
||||||
|
|
||||||
@ -253,6 +254,12 @@ export default class BlurMyShell extends Extension {
|
|||||||
|
|
||||||
/// Add the Clutter debug flag.
|
/// Add the Clutter debug flag.
|
||||||
_disable_clipped_redraws() {
|
_disable_clipped_redraws() {
|
||||||
|
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(
|
Meta.add_clutter_debug_flags(
|
||||||
null, Clutter.DrawDebugFlag.DISABLE_CLIPPED_REDRAWS, null
|
null, Clutter.DrawDebugFlag.DISABLE_CLIPPED_REDRAWS, null
|
||||||
);
|
);
|
||||||
@ -260,6 +267,12 @@ export default class BlurMyShell extends Extension {
|
|||||||
|
|
||||||
/// Remove the Clutter debug flag.
|
/// Remove the Clutter debug flag.
|
||||||
_reenable_clipped_redraws() {
|
_reenable_clipped_redraws() {
|
||||||
|
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(
|
Meta.remove_clutter_debug_flags(
|
||||||
null, Clutter.DrawDebugFlag.DISABLE_CLIPPED_REDRAWS, null
|
null, Clutter.DrawDebugFlag.DISABLE_CLIPPED_REDRAWS, null
|
||||||
);
|
);
|
||||||
|
|||||||
@ -17,9 +17,10 @@
|
|||||||
"settings-schema": "org.gnome.shell.extensions.blur-my-shell",
|
"settings-schema": "org.gnome.shell.extensions.blur-my-shell",
|
||||||
"shell-version": [
|
"shell-version": [
|
||||||
"46",
|
"46",
|
||||||
"47"
|
"47",
|
||||||
|
"48"
|
||||||
],
|
],
|
||||||
"url": "https://github.com/aunetx/blur-my-shell",
|
"url": "https://github.com/aunetx/blur-my-shell",
|
||||||
"uuid": "blur-my-shell@aunetx",
|
"uuid": "blur-my-shell@aunetx",
|
||||||
"version": 67
|
"version": 68
|
||||||
}
|
}
|
||||||
@ -11,7 +11,8 @@
|
|||||||
"shell-version": [
|
"shell-version": [
|
||||||
"45",
|
"45",
|
||||||
"46",
|
"46",
|
||||||
"47"
|
"47",
|
||||||
|
"48"
|
||||||
],
|
],
|
||||||
"url": "https://github.com/forge-ext/forge",
|
"url": "https://github.com/forge-ext/forge",
|
||||||
"uuid": "forge@jmmaranan.com",
|
"uuid": "forge@jmmaranan.com",
|
||||||
|
|||||||
@ -13,6 +13,9 @@ import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js';
|
|||||||
import * as QuickSettings from 'resource:///org/gnome/shell/ui/quickSettings.js';
|
import * as QuickSettings from 'resource:///org/gnome/shell/ui/quickSettings.js';
|
||||||
import * as KeyboardManager from 'resource:///org/gnome/shell/misc/keyboardManager.js';
|
import * as KeyboardManager from 'resource:///org/gnome/shell/misc/keyboardManager.js';
|
||||||
import * as KeyboardUI from 'resource:///org/gnome/shell/ui/keyboard.js';
|
import * as KeyboardUI from 'resource:///org/gnome/shell/ui/keyboard.js';
|
||||||
|
import * as InputSourceManager from 'resource:///org/gnome/shell/ui/status/keyboard.js';
|
||||||
|
import * as Config from 'resource:///org/gnome/shell/misc/config.js'
|
||||||
|
const [major, minor] = Config.PACKAGE_VERSION.split('.').map(s => Number(s));
|
||||||
import { Dialog } from 'resource:///org/gnome/shell/ui/dialog.js';
|
import { Dialog } from 'resource:///org/gnome/shell/ui/dialog.js';
|
||||||
|
|
||||||
import { Extension, gettext as _ } from 'resource:///org/gnome/shell/extensions/extension.js';
|
import { Extension, gettext as _ } from 'resource:///org/gnome/shell/extensions/extension.js';
|
||||||
@ -71,6 +74,9 @@ class KeyboardMenuToggle extends QuickSettings.QuickMenuToggle {
|
|||||||
|
|
||||||
let keycodes;
|
let keycodes;
|
||||||
let layouts;
|
let layouts;
|
||||||
|
let currentMonitorId = 0;
|
||||||
|
let extract_dir = GLib.get_user_cache_dir() + "/gjs-osk";
|
||||||
|
// [insert handwriting 1]
|
||||||
|
|
||||||
export default class GjsOskExtension extends Extension {
|
export default class GjsOskExtension extends Extension {
|
||||||
_openKeyboard(instant) {
|
_openKeyboard(instant) {
|
||||||
@ -104,6 +110,7 @@ export default class GjsOskExtension extends Extension {
|
|||||||
this.openInterval = null;
|
this.openInterval = null;
|
||||||
}
|
}
|
||||||
this.openInterval = setInterval(() => {
|
this.openInterval = setInterval(() => {
|
||||||
|
if (this.Keyboard != null) {
|
||||||
if (global.stage.key_focus == this.Keyboard && this.Keyboard.prevKeyFocus != null) {
|
if (global.stage.key_focus == this.Keyboard && this.Keyboard.prevKeyFocus != null) {
|
||||||
global.stage.key_focus = this.Keyboard.prevKeyFocus
|
global.stage.key_focus = this.Keyboard.prevKeyFocus
|
||||||
}
|
}
|
||||||
@ -119,6 +126,7 @@ export default class GjsOskExtension extends Extension {
|
|||||||
this.Keyboard.closedFromButton = false
|
this.Keyboard.closedFromButton = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}, 300);
|
}, 300);
|
||||||
this.tapConnect = global.stage.connect("event", (_actor, event) => {
|
this.tapConnect = global.stage.connect("event", (_actor, event) => {
|
||||||
if (event.type() !== 4 && event.type() !== 5) {
|
if (event.type() !== 4 && event.type() !== 5) {
|
||||||
@ -130,7 +138,7 @@ export default class GjsOskExtension extends Extension {
|
|||||||
enable() {
|
enable() {
|
||||||
this.settings = this.getSettings();
|
this.settings = this.getSettings();
|
||||||
this.darkSchemeSettings = this.getSettings("org.gnome.desktop.interface");
|
this.darkSchemeSettings = this.getSettings("org.gnome.desktop.interface");
|
||||||
this.inputLanguageSettings = this.getSettings('org.gnome.desktop.input-sources')
|
this.inputLanguageSettings = InputSourceManager.getInputSourceManager();
|
||||||
this.gnomeKeyboardSettings = this.getSettings('org.gnome.desktop.a11y.applications');
|
this.gnomeKeyboardSettings = this.getSettings('org.gnome.desktop.a11y.applications');
|
||||||
this.isGnomeKeyboardEnabled = this.gnomeKeyboardSettings.get_boolean('screen-keyboard-enabled');
|
this.isGnomeKeyboardEnabled = this.gnomeKeyboardSettings.get_boolean('screen-keyboard-enabled');
|
||||||
this.gnomeKeyboardSettings.set_boolean('screen-keyboard-enabled', false)
|
this.gnomeKeyboardSettings.set_boolean('screen-keyboard-enabled', false)
|
||||||
@ -150,16 +158,39 @@ export default class GjsOskExtension extends Extension {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let refresh = () => {
|
let refresh = () => {
|
||||||
if (!Gio.File.new_for_path(this.path + "/keycodes").query_exists(null)) {
|
// [insert handwriting 2]
|
||||||
Gio.File.new_for_path(this.path + "/keycodes").make_directory(null);
|
let currentMonitors = this.settings.get_string("default-monitor").split(";")
|
||||||
let [status, out, err, code] = GLib.spawn_command_line_sync("tar -Jxf " + this.path + "/keycodes.tar.xz -C " + this.path + "/keycodes")
|
let currentMonitorMap = {};
|
||||||
|
let monitors = Main.layoutManager.monitors;
|
||||||
|
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];
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
currentMonitorId = global.backend.get_monitor_manager().get_monitor_for_connector(currentMonitorMap[monitors.length + ""]);
|
||||||
|
if (currentMonitorId == -1) {
|
||||||
|
currentMonitorId = 0;
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
currentMonitorId = 0;
|
||||||
|
}
|
||||||
|
if (!Gio.File.new_for_path(extract_dir).query_exists(null)) {
|
||||||
|
Gio.File.new_for_path(extract_dir).make_directory(null);
|
||||||
|
Gio.File.new_for_path(extract_dir + "/keycodes").make_directory(null);
|
||||||
|
let [status, out, err, code] = GLib.spawn_command_line_sync("tar -Jxf " + this.path + "/keycodes.tar.xz -C " + extract_dir + "/keycodes")
|
||||||
if (err != "" || code != 0) {
|
if (err != "" || code != 0) {
|
||||||
throw new Error(err);
|
throw new Error(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.Keyboard)
|
if (this.Keyboard != null) {
|
||||||
this.Keyboard.destroy();
|
this.Keyboard.destroy();
|
||||||
let [ok, contents] = GLib.file_get_contents(this.path + '/keycodes/' + KeyboardManager.getKeyboardManager().currentLayout.id + '.json');
|
this.Keyboard = null;
|
||||||
|
}
|
||||||
|
let [ok, contents] = GLib.file_get_contents(extract_dir + "/keycodes/" + KeyboardManager.getKeyboardManager().currentLayout.id + '.json');
|
||||||
if (ok) {
|
if (ok) {
|
||||||
keycodes = JSON.parse(contents);
|
keycodes = JSON.parse(contents);
|
||||||
}
|
}
|
||||||
@ -200,7 +231,11 @@ export default class GjsOskExtension extends Extension {
|
|||||||
this._toggleKeyboard();
|
this._toggleKeyboard();
|
||||||
})
|
})
|
||||||
let settingsChanged = () => {
|
let settingsChanged = () => {
|
||||||
let opened = this.Keyboard.opened
|
let opened;
|
||||||
|
if (this.Keyboard != null)
|
||||||
|
opened = this.Keyboard.opened
|
||||||
|
else
|
||||||
|
opened = false
|
||||||
if (this.darkSchemeSettings.get_string("color-scheme") == "prefer-dark")
|
if (this.darkSchemeSettings.get_string("color-scheme") == "prefer-dark")
|
||||||
this.settings.scheme = "-dark"
|
this.settings.scheme = "-dark"
|
||||||
else
|
else
|
||||||
@ -246,7 +281,7 @@ export default class GjsOskExtension extends Extension {
|
|||||||
this.settingsHandlers = [
|
this.settingsHandlers = [
|
||||||
this.settings.connect("changed", settingsChanged),
|
this.settings.connect("changed", settingsChanged),
|
||||||
this.darkSchemeSettings.connect("changed", (_, key) => { if (key == "color-scheme") settingsChanged() }),
|
this.darkSchemeSettings.connect("changed", (_, key) => { if (key == "color-scheme") settingsChanged() }),
|
||||||
this.inputLanguageSettings.connect("changed", settingsChanged)
|
this.inputLanguageSettings.connect("current-source-changed", settingsChanged)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,6 +297,7 @@ export default class GjsOskExtension extends Extension {
|
|||||||
this._indicator.destroy();
|
this._indicator.destroy();
|
||||||
this._indicator = null;
|
this._indicator = null;
|
||||||
}
|
}
|
||||||
|
if (this.Keyboard != null)
|
||||||
this.Keyboard.destroy();
|
this.Keyboard.destroy();
|
||||||
this.settings.disconnect(this.settingsHandlers[0]);
|
this.settings.disconnect(this.settingsHandlers[0]);
|
||||||
this.darkSchemeSettings.disconnect(this.settingsHandlers[1])
|
this.darkSchemeSettings.disconnect(this.settingsHandlers[1])
|
||||||
@ -289,6 +325,7 @@ export default class GjsOskExtension extends Extension {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// [insert handwriting 3]
|
||||||
|
|
||||||
class Keyboard extends Dialog {
|
class Keyboard extends Dialog {
|
||||||
static [GObject.signals] = {
|
static [GObject.signals] = {
|
||||||
@ -304,19 +341,20 @@ class Keyboard extends Dialog {
|
|||||||
this.settingsOpenFunction = extensionObject.openPrefs
|
this.settingsOpenFunction = extensionObject.openPrefs
|
||||||
this.inputDevice = Clutter.get_default_backend().get_default_seat().create_virtual_device(Clutter.InputDeviceType.KEYBOARD_DEVICE);
|
this.inputDevice = Clutter.get_default_backend().get_default_seat().create_virtual_device(Clutter.InputDeviceType.KEYBOARD_DEVICE);
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
let monitor = Main.layoutManager.primaryMonitor;
|
let monitor = Main.layoutManager.monitors[currentMonitorId];
|
||||||
super._init(Main.layoutManager.modalDialogGroup, 'db-keyboard-content');
|
super._init(Main.layoutManager.modalDialogGroup, 'db-keyboard-content');
|
||||||
this.box = new St.Widget({
|
this.box = new St.Widget({
|
||||||
|
reactive: true,
|
||||||
layout_manager: new Clutter.GridLayout({
|
layout_manager: new Clutter.GridLayout({
|
||||||
orientation: Clutter.Orientation.HORIZONTAL,
|
orientation: Clutter.Orientation.HORIZONTAL,
|
||||||
row_spacing: settings.get_int("border-spacing-px") * 2,
|
|
||||||
column_spacing: settings.get_int("border-spacing-px") * 2,
|
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
this.widthPercent = (monitor.width > monitor.height) ? settings.get_int("landscape-width-percent") / 100 : settings.get_int("portrait-width-percent") / 100;
|
this.widthPercent = (monitor.width > monitor.height) ? settings.get_int("landscape-width-percent") / 100 : settings.get_int("portrait-width-percent") / 100;
|
||||||
this.heightPercent = (monitor.width > monitor.height) ? settings.get_int("landscape-height-percent") / 100 : settings.get_int("portrait-height-percent") / 100;
|
this.heightPercent = (monitor.width > monitor.height) ? settings.get_int("landscape-height-percent") / 100 : settings.get_int("portrait-height-percent") / 100;
|
||||||
|
this.nonDragBlocker = new Clutter.Actor();
|
||||||
this.buildUI();
|
this.buildUI();
|
||||||
this.draggable = false;
|
this.draggable = false;
|
||||||
|
// [insert handwriting 4]
|
||||||
this.add_child(this.box);
|
this.add_child(this.box);
|
||||||
this.close();
|
this.close();
|
||||||
this.box.set_name("osk-gjs")
|
this.box.set_name("osk-gjs")
|
||||||
@ -328,7 +366,9 @@ class Keyboard extends Dialog {
|
|||||||
this.opened = false;
|
this.opened = false;
|
||||||
this.state = State.CLOSED;
|
this.state = State.CLOSED;
|
||||||
this.delta = [];
|
this.delta = [];
|
||||||
this.checkMonitor();
|
this.monitorChecker = global.backend.get_monitor_manager().connect('monitors-changed', () => {
|
||||||
|
this.refresh()
|
||||||
|
});
|
||||||
this._dragging = false;
|
this._dragging = false;
|
||||||
let side = null;
|
let side = null;
|
||||||
switch (this.settings.get_int("default-snap")) {
|
switch (this.settings.get_int("default-snap")) {
|
||||||
@ -401,10 +441,6 @@ class Keyboard extends Dialog {
|
|||||||
global.stage.remove_action_by_name('osk')
|
global.stage.remove_action_by_name('osk')
|
||||||
if (this.oldBottomDragAction !== null && this.oldBottomDragAction instanceof Clutter.Action)
|
if (this.oldBottomDragAction !== null && this.oldBottomDragAction instanceof Clutter.Action)
|
||||||
global.stage.add_action_full('osk', Clutter.EventPhase.CAPTURE, this.oldBottomDragAction)
|
global.stage.add_action_full('osk', Clutter.EventPhase.CAPTURE, this.oldBottomDragAction)
|
||||||
if (this.monitorChecker !== null) {
|
|
||||||
clearInterval(this.monitorChecker);
|
|
||||||
this.monitorChecker = null;
|
|
||||||
}
|
|
||||||
if (this.textboxChecker !== null) {
|
if (this.textboxChecker !== null) {
|
||||||
clearInterval(this.textboxChecker);
|
clearInterval(this.textboxChecker);
|
||||||
this.textboxChecker = null;
|
this.textboxChecker = null;
|
||||||
@ -419,7 +455,11 @@ class Keyboard extends Dialog {
|
|||||||
}
|
}
|
||||||
this.keymap.disconnect(this.capslockConnect);
|
this.keymap.disconnect(this.capslockConnect);
|
||||||
this.keymap.disconnect(this.numLockConnect);
|
this.keymap.disconnect(this.numLockConnect);
|
||||||
|
global.backend.get_monitor_manager().disconnect(this.monitorChecker)
|
||||||
super.destroy();
|
super.destroy();
|
||||||
|
if (this.nonDragBlocker !== null) {
|
||||||
|
Main.layoutManager.removeChrome(this.nonDragBlocker)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
startDragging(event, delta) {
|
startDragging(event, delta) {
|
||||||
@ -492,7 +532,13 @@ class Keyboard extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
snapMovement(xPos, yPos) {
|
snapMovement(xPos, yPos) {
|
||||||
let monitor = Main.layoutManager.primaryMonitor
|
let monitor = Main.layoutManager.monitors[currentMonitorId]
|
||||||
|
if (xPos < monitor.x || yPos < monitor.y || xPos > monitor.x + monitor.width || yPos > monitor.y + monitor.width) {
|
||||||
|
this.set_translation(xPos, yPos, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
xPos -= monitor.x;
|
||||||
|
yPos -= monitor.y;
|
||||||
let snap_px = this.settings.get_int("snap-spacing-px")
|
let snap_px = this.settings.get_int("snap-spacing-px")
|
||||||
if (Math.abs(xPos - ((monitor.width * .5) - ((this.width * .5)))) <= 50) {
|
if (Math.abs(xPos - ((monitor.width * .5) - ((this.width * .5)))) <= 50) {
|
||||||
xPos = ((monitor.width * .5) - ((this.width * .5)));
|
xPos = ((monitor.width * .5) - ((this.width * .5)));
|
||||||
@ -508,34 +554,24 @@ class Keyboard extends Dialog {
|
|||||||
} else if (Math.abs(yPos - ((monitor.height * .5) - (this.height * .5))) <= 50) {
|
} else if (Math.abs(yPos - ((monitor.height * .5) - (this.height * .5))) <= 50) {
|
||||||
yPos = (monitor.height * .5) - (this.height * .5);
|
yPos = (monitor.height * .5) - (this.height * .5);
|
||||||
}
|
}
|
||||||
this.set_translation(xPos, yPos, 0);
|
this.set_translation(xPos + monitor.x, yPos + monitor.y, 0);
|
||||||
}
|
|
||||||
|
|
||||||
checkMonitor() {
|
|
||||||
let monitor = Main.layoutManager.primaryMonitor;
|
|
||||||
let oldMonitorDimensions = [monitor.width, monitor.height];
|
|
||||||
this.monitorChecker = setInterval(() => {
|
|
||||||
monitor = Main.layoutManager.primaryMonitor;
|
|
||||||
if (oldMonitorDimensions[0] != monitor.width || oldMonitorDimensions[1] != monitor.height) {
|
|
||||||
this.refresh()
|
|
||||||
oldMonitorDimensions = [monitor.width, monitor.height];
|
|
||||||
}
|
|
||||||
}, 200);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setOpenState(percent) {
|
setOpenState(percent) {
|
||||||
let monitor = Main.layoutManager.primaryMonitor;
|
let monitor = Main.layoutManager.monitors[currentMonitorId];
|
||||||
let posX = [this.settings.get_int("snap-spacing-px"), ((monitor.width * .5) - ((this.width * .5))), monitor.width - this.width - this.settings.get_int("snap-spacing-px")][(this.settings.get_int("default-snap") % 3)];
|
let posX = [this.settings.get_int("snap-spacing-px"), ((monitor.width * .5) - ((this.width * .5))), monitor.width - this.width - this.settings.get_int("snap-spacing-px")][(this.settings.get_int("default-snap") % 3)];
|
||||||
let posY = [this.settings.get_int("snap-spacing-px"), ((monitor.height * .5) - ((this.height * .5))), monitor.height - this.height - this.settings.get_int("snap-spacing-px")][Math.floor((this.settings.get_int("default-snap") / 3))];
|
let posY = [this.settings.get_int("snap-spacing-px"), ((monitor.height * .5) - ((this.height * .5))), monitor.height - this.height - this.settings.get_int("snap-spacing-px")][Math.floor((this.settings.get_int("default-snap") / 3))];
|
||||||
let mX = [-this.box.width, 0, this.box.width][(this.settings.get_int("default-snap") % 3)];
|
let mX = [-this.box.width, 0, this.box.width][(this.settings.get_int("default-snap") % 3)];
|
||||||
let mY = [-this.box.height, 0, this.box.height][Math.floor((this.settings.get_int("default-snap") / 3))]
|
let mY = [-this.box.height, 0, this.box.height][Math.floor((this.settings.get_int("default-snap") / 3))]
|
||||||
let [dx, dy] = [posX + mX * ((100 - percent) / 100), posY + mY * ((100 - percent) / 100)]
|
let [dx, dy] = [posX + mX * ((100 - percent) / 100) + monitor.x, posY + mY * ((100 - percent) / 100) + monitor.y]
|
||||||
let op = 255 * (percent / 100);
|
let op = 255 * (percent / 100);
|
||||||
this.set_translation(dx, dy, 0)
|
this.set_translation(dx, dy, 0)
|
||||||
this.box.set_opacity(op)
|
this.box.set_opacity(op)
|
||||||
}
|
}
|
||||||
|
|
||||||
open(noPrep = null, instant = null) {
|
open(noPrep = null, instant = null) {
|
||||||
|
if (this.updateCapsLock) this.updateCapsLock()
|
||||||
|
if (this.updateNumLock) this.updateNumLock()
|
||||||
if (noPrep == null || !noPrep) {
|
if (noPrep == null || !noPrep) {
|
||||||
this.prevKeyFocus = global.stage.key_focus
|
this.prevKeyFocus = global.stage.key_focus
|
||||||
this.inputDevice = Clutter.get_default_backend().get_default_seat().create_virtual_device(Clutter.InputDeviceType.KEYBOARD_DEVICE);
|
this.inputDevice = Clutter.get_default_backend().get_default_seat().create_virtual_device(Clutter.InputDeviceType.KEYBOARD_DEVICE);
|
||||||
@ -543,13 +579,13 @@ class Keyboard extends Dialog {
|
|||||||
this.show();
|
this.show();
|
||||||
}
|
}
|
||||||
if (noPrep == null || noPrep) {
|
if (noPrep == null || noPrep) {
|
||||||
let monitor = Main.layoutManager.primaryMonitor;
|
let monitor = Main.layoutManager.monitors[currentMonitorId];
|
||||||
let posX = [this.settings.get_int("snap-spacing-px"), ((monitor.width * .5) - ((this.width * .5))), monitor.width - this.width - this.settings.get_int("snap-spacing-px")][(this.settings.get_int("default-snap") % 3)];
|
let posX = [this.settings.get_int("snap-spacing-px"), ((monitor.width * .5) - ((this.width * .5))), monitor.width - this.width - this.settings.get_int("snap-spacing-px")][(this.settings.get_int("default-snap") % 3)];
|
||||||
let posY = [this.settings.get_int("snap-spacing-px"), ((monitor.height * .5) - ((this.height * .5))), monitor.height - this.height - this.settings.get_int("snap-spacing-px")][Math.floor((this.settings.get_int("default-snap") / 3))];
|
let posY = [this.settings.get_int("snap-spacing-px"), ((monitor.height * .5) - ((this.height * .5))), monitor.height - this.height - this.settings.get_int("snap-spacing-px")][Math.floor((this.settings.get_int("default-snap") / 3))];
|
||||||
if (noPrep == null) {
|
if (noPrep == null) {
|
||||||
let mX = [-this.box.width, 0, this.box.width][(this.settings.get_int("default-snap") % 3)];
|
let mX = [-this.box.width, 0, this.box.width][(this.settings.get_int("default-snap") % 3)];
|
||||||
let mY = [-this.box.height, 0, this.box.height][Math.floor((this.settings.get_int("default-snap") / 3))]
|
let mY = [-this.box.height, 0, this.box.height][Math.floor((this.settings.get_int("default-snap") / 3))]
|
||||||
this.set_translation(posX + mX, posY + mY, 0)
|
this.set_translation(posX + mX + monitor.x, posY + mY + monitor.y, 0)
|
||||||
}
|
}
|
||||||
this.box.ease({
|
this.box.ease({
|
||||||
opacity: 255,
|
opacity: 255,
|
||||||
@ -566,18 +602,25 @@ class Keyboard extends Dialog {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.ease({
|
this.ease({
|
||||||
translation_x: posX,
|
translation_x: posX + monitor.x,
|
||||||
translation_y: posY,
|
translation_y: posY + monitor.y,
|
||||||
duration: instant == null || !instant ? 100 : 0,
|
duration: instant == null || !instant ? 100 : 0,
|
||||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD
|
mode: Clutter.AnimationMode.EASE_OUT_QUAD
|
||||||
})
|
})
|
||||||
|
if (!this.settings.get_boolean("enable-drag") && this.nonDragBlocker !== null) {
|
||||||
|
Main.layoutManager.addChrome(this.nonDragBlocker, {
|
||||||
|
affectsStruts: true,
|
||||||
|
trackFullscreen: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
this.opened = true;
|
this.opened = true;
|
||||||
|
// [insert handwriting 5]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
close(instant = null) {
|
close(instant = null) {
|
||||||
this.prevKeyFocus = null;
|
this.prevKeyFocus = null;
|
||||||
let monitor = Main.layoutManager.primaryMonitor;
|
let monitor = Main.layoutManager.monitors[currentMonitorId];
|
||||||
let posX = [this.settings.get_int("snap-spacing-px"), ((monitor.width * .5) - ((this.width * .5))), monitor.width - this.width - this.settings.get_int("snap-spacing-px")][(this.settings.get_int("default-snap") % 3)];
|
let posX = [this.settings.get_int("snap-spacing-px"), ((monitor.width * .5) - ((this.width * .5))), monitor.width - this.width - this.settings.get_int("snap-spacing-px")][(this.settings.get_int("default-snap") % 3)];
|
||||||
let posY = [this.settings.get_int("snap-spacing-px"), ((monitor.height * .5) - ((this.height * .5))), monitor.height - this.height - this.settings.get_int("snap-spacing-px")][Math.floor((this.settings.get_int("default-snap") / 3))];
|
let posY = [this.settings.get_int("snap-spacing-px"), ((monitor.height * .5) - ((this.height * .5))), monitor.height - this.height - this.settings.get_int("snap-spacing-px")][Math.floor((this.settings.get_int("default-snap") / 3))];
|
||||||
let mX = [-this.box.width, 0, this.box.width][(this.settings.get_int("default-snap") % 3)];
|
let mX = [-this.box.width, 0, this.box.width][(this.settings.get_int("default-snap") % 3)];
|
||||||
@ -600,13 +643,20 @@ class Keyboard extends Dialog {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.ease({
|
this.ease({
|
||||||
translation_x: posX + mX,
|
translation_x: posX + mX + monitor.x,
|
||||||
translation_y: posY + mY,
|
translation_y: posY + mY + monitor.y,
|
||||||
duration: instant == null || !instant ? 100 : 0,
|
duration: instant == null || !instant ? 100 : 0,
|
||||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD
|
mode: Clutter.AnimationMode.EASE_OUT_QUAD
|
||||||
})
|
})
|
||||||
|
if (!this.settings.get_boolean("enable-drag") && this.nonDragBlocker !== null) {
|
||||||
|
Main.layoutManager.removeChrome(this.nonDragBlocker, {
|
||||||
|
affectsStruts: true,
|
||||||
|
trackFullscreen: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
this.openedFromButton = false
|
this.openedFromButton = false
|
||||||
this.releaseAllKeys();
|
this.releaseAllKeys();
|
||||||
|
// [insert handwrting 6]
|
||||||
}
|
}
|
||||||
|
|
||||||
vfunc_button_press_event() {
|
vfunc_button_press_event() {
|
||||||
@ -651,11 +701,52 @@ class Keyboard extends Dialog {
|
|||||||
buildUI() {
|
buildUI() {
|
||||||
this.box.set_opacity(0);
|
this.box.set_opacity(0);
|
||||||
this.keys = [];
|
this.keys = [];
|
||||||
let layoutName = Object.keys(layouts)[this.settings.get_int("layout")];
|
let monitor = Main.layoutManager.monitors[currentMonitorId]
|
||||||
let monitor = Main.layoutManager.primaryMonitor
|
let layoutName = Object.keys(layouts)[(monitor.width > monitor.height) ? this.settings.get_int("layout-landscape") : this.settings.get_int("layout-portrait")];
|
||||||
this.box.width = Math.round((monitor.width - this.settings.get_int("snap-spacing-px") * 2) * (layoutName.includes("Split") ? 1 : this.widthPercent))
|
this.box.width = Math.round((monitor.width - this.settings.get_int("snap-spacing-px") * 2) * (layoutName.includes("Split") ? 1 : this.widthPercent))
|
||||||
this.box.height = Math.round((monitor.height - this.settings.get_int("snap-spacing-px") * 2) * this.heightPercent)
|
this.box.height = Math.round((monitor.height - this.settings.get_int("snap-spacing-px") * 2) * this.heightPercent)
|
||||||
|
|
||||||
|
if (!this.settings.get_boolean("enable-drag")) {
|
||||||
|
this.nonDragBlocker = new Clutter.Actor();
|
||||||
|
switch (this.settings.get_int("default-snap")) {
|
||||||
|
case 0:
|
||||||
|
case 1:
|
||||||
|
case 2:
|
||||||
|
this.nonDragBlocker.x = monitor.x;
|
||||||
|
this.nonDragBlocker.y = monitor.y;
|
||||||
|
this.nonDragBlocker.width = monitor.width;
|
||||||
|
this.nonDragBlocker.height = this.box.height + 2 * this.settings.get_int("snap-spacing-px");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
this.nonDragBlocker.x = monitor.x;
|
||||||
|
this.nonDragBlocker.y = monitor.y;
|
||||||
|
this.nonDragBlocker.width = this.box.width + 2 * this.settings.get_int("snap-spacing-px");
|
||||||
|
this.nonDragBlocker.height = monitor.height;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
this.nonDragBlocker.x = monitor.x + monitor.width - (this.box.width + 2 * this.settings.get_int("snap-spacing-px"));
|
||||||
|
this.nonDragBlocker.y = monitor.y;
|
||||||
|
this.nonDragBlocker.width = this.box.width + 2 * this.settings.get_int("snap-spacing-px");
|
||||||
|
this.nonDragBlocker.height = monitor.height;
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
case 7:
|
||||||
|
case 8:
|
||||||
|
this.nonDragBlocker.x = monitor.x;
|
||||||
|
this.nonDragBlocker.y = monitor.y + monitor.height - (this.box.height + 2 * this.settings.get_int("snap-spacing-px"));
|
||||||
|
this.nonDragBlocker.width = monitor.width;
|
||||||
|
this.nonDragBlocker.height = this.box.height + 2 * this.settings.get_int("snap-spacing-px");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (this.settings.get_int("default-snap") == 4) {
|
||||||
|
this.nonDragBlocker.destroy();
|
||||||
|
this.nonDragBlocker = null;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.nonDragBlocker.destroy();
|
||||||
|
this.nonDragBlocker = null;
|
||||||
|
}
|
||||||
|
|
||||||
const grid = this.box.layout_manager
|
const grid = this.box.layout_manager
|
||||||
grid.set_row_homogeneous(true)
|
grid.set_row_homogeneous(true)
|
||||||
grid.set_column_homogeneous(!layoutName.includes("Split"))
|
grid.set_column_homogeneous(!layoutName.includes("Split"))
|
||||||
@ -665,13 +756,14 @@ class Keyboard extends Dialog {
|
|||||||
let currentGrid = grid;
|
let currentGrid = grid;
|
||||||
let left;
|
let left;
|
||||||
let right;
|
let right;
|
||||||
|
let topBtnWidth;
|
||||||
|
|
||||||
if (layoutName.includes("Split")) {
|
if (layoutName.includes("Split")) {
|
||||||
|
this.box.reactive = false;
|
||||||
left = new St.Widget({
|
left = new St.Widget({
|
||||||
|
reactive: true,
|
||||||
layout_manager: new Clutter.GridLayout({
|
layout_manager: new Clutter.GridLayout({
|
||||||
orientation: Clutter.Orientation.HORIZONTAL,
|
orientation: Clutter.Orientation.HORIZONTAL,
|
||||||
row_spacing: this.settings.get_int("border-spacing-px") * 2,
|
|
||||||
column_spacing: this.settings.get_int("border-spacing-px") * 2,
|
|
||||||
row_homogeneous: true,
|
row_homogeneous: true,
|
||||||
column_homogeneous: true
|
column_homogeneous: true
|
||||||
}),
|
}),
|
||||||
@ -679,13 +771,13 @@ class Keyboard extends Dialog {
|
|||||||
})
|
})
|
||||||
gridLeft = left.layout_manager;
|
gridLeft = left.layout_manager;
|
||||||
let middle = new St.Widget({
|
let middle = new St.Widget({
|
||||||
|
reactive: false,
|
||||||
width: this.box.width * (1 - this.widthPercent) - 10 + this.settings.get_int("border-spacing-px")
|
width: this.box.width * (1 - this.widthPercent) - 10 + this.settings.get_int("border-spacing-px")
|
||||||
});
|
});
|
||||||
right = new St.Widget({
|
right = new St.Widget({
|
||||||
|
reactive: true,
|
||||||
layout_manager: new Clutter.GridLayout({
|
layout_manager: new Clutter.GridLayout({
|
||||||
orientation: Clutter.Orientation.HORIZONTAL,
|
orientation: Clutter.Orientation.HORIZONTAL,
|
||||||
row_spacing: this.settings.get_int("border-spacing-px") * 2,
|
|
||||||
column_spacing: this.settings.get_int("border-spacing-px") * 2,
|
|
||||||
row_homogeneous: true,
|
row_homogeneous: true,
|
||||||
column_homogeneous: true
|
column_homogeneous: true
|
||||||
}),
|
}),
|
||||||
@ -698,6 +790,7 @@ class Keyboard extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.shiftButtons = [];
|
this.shiftButtons = [];
|
||||||
|
// [insert handwriting 7]
|
||||||
|
|
||||||
let currentLayout = layouts[layoutName];
|
let currentLayout = layouts[layoutName];
|
||||||
let width = 0;
|
let width = 0;
|
||||||
@ -725,6 +818,7 @@ class Keyboard extends Dialog {
|
|||||||
if (this.settings.get_boolean("show-icons")) {
|
if (this.settings.get_boolean("show-icons")) {
|
||||||
iconKeys = ["left", "up", "right", "down", "backspace", "tab", "capslock", "shift", "enter", "ctrl", "super", "alt", "space"]
|
iconKeys = ["left", "up", "right", "down", "backspace", "tab", "capslock", "shift", "enter", "ctrl", "super", "alt", "space"]
|
||||||
}
|
}
|
||||||
|
// [insert handwriting 8]
|
||||||
if (iconKeys.some(j => { return i.layers.default.toLowerCase() == j })) {
|
if (iconKeys.some(j => { return i.layers.default.toLowerCase() == j })) {
|
||||||
params.style_class = i.layers.default.toLowerCase() + "_btn"
|
params.style_class = i.layers.default.toLowerCase() + "_btn"
|
||||||
for (var key of Object.keys(i.layers)) {
|
for (var key of Object.keys(i.layers)) {
|
||||||
@ -746,20 +840,23 @@ class Keyboard extends Dialog {
|
|||||||
this.capslockConnect = this.keymap.connect("state-changed", (a, e) => {
|
this.capslockConnect = this.keymap.connect("state-changed", (a, e) => {
|
||||||
this.setCapsLock(keyBtn, this.keymap.get_caps_lock_state())
|
this.setCapsLock(keyBtn, this.keymap.get_caps_lock_state())
|
||||||
})
|
})
|
||||||
|
this.updateCapsLock = () => this.setCapsLock(keyBtn, this.keymap.get_caps_lock_state())
|
||||||
} else if (i.code == 69) {
|
} else if (i.code == 69) {
|
||||||
this.keymap = Clutter.get_default_backend().get_default_seat().get_keymap()
|
this.keymap = Clutter.get_default_backend().get_default_seat().get_keymap()
|
||||||
this.numLockConnect = this.keymap.connect("state-changed", (a, e) => {
|
this.numLockConnect = this.keymap.connect("state-changed", (a, e) => {
|
||||||
this.setNumLock(keyBtn, this.keymap.get_num_lock_state())
|
this.setNumLock(keyBtn, this.keymap.get_num_lock_state())
|
||||||
})
|
})
|
||||||
|
this.updateNumLock = () => this.setNumLock(keyBtn, this.keymap.get_num_lock_state())
|
||||||
} else if (i.code == 42 || i.code == 54) {
|
} else if (i.code == 42 || i.code == 54) {
|
||||||
this.shiftButtons.push(keyBtn)
|
this.shiftButtons.push(keyBtn)
|
||||||
}
|
}
|
||||||
currentGrid.attach(keyBtn, c, 6 + r, (Object.hasOwn(keydef, "width") ? keydef.width : 1) * 8, r == 0 ? 6 : (Object.hasOwn(keydef, "height") ? keydef.height : 1) * 8)
|
currentGrid.attach(keyBtn, c, 5 + r, (Object.hasOwn(keydef, "width") ? keydef.width : 1) * 2, r == 0 ? 3 : (Object.hasOwn(keydef, "height") ? keydef.height : 1) * 4)
|
||||||
keyBtn.visible = true
|
keyBtn.visible = true
|
||||||
c += (Object.hasOwn(keydef, "width") ? keydef.width : 1) * 8
|
c += (Object.hasOwn(keydef, "width") ? keydef.width : 1) * 2
|
||||||
this.keys.push(keyBtn)
|
this.keys.push(keyBtn)
|
||||||
|
// [insert handwriting 9]
|
||||||
} else if (i == "empty space") {
|
} else if (i == "empty space") {
|
||||||
c += (Object.hasOwn(keydef, "width") ? keydef.width : 1) * 8
|
c += (Object.hasOwn(keydef, "width") ? keydef.width : 1) * 2
|
||||||
} else if (i == "split") {
|
} else if (i == "split") {
|
||||||
currentGrid = gridRight
|
currentGrid = gridRight
|
||||||
const size = c
|
const size = c
|
||||||
@ -774,25 +871,36 @@ class Keyboard extends Dialog {
|
|||||||
}
|
}
|
||||||
for (const keydef of kRow) {
|
for (const keydef of kRow) {
|
||||||
if (keydef instanceof Array) {
|
if (keydef instanceof Array) {
|
||||||
keydef.forEach(i => {doAddKey(i); r += 4; c -= 8});
|
keydef.forEach(i => { doAddKey(i); r += 2; c -= (Object.hasOwn(i, "width") ? i.width : 1) * 2 });
|
||||||
c += 8;
|
c += (Object.hasOwn(keydef[0], "width") ? keydef[0].width : 1) * 2;
|
||||||
r -= 8;
|
r -= 4;
|
||||||
} else {
|
} else {
|
||||||
doAddKey(keydef)
|
doAddKey(keydef)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!topBtnWidth) topBtnWidth = ((Object.hasOwn(kRow[kRow.length - 1], "width") && (Object.hasOwn(kRow[kRow.length - 1], "key"))) ? kRow[kRow.length - 1].width : 1)
|
||||||
const size = c;
|
const size = c;
|
||||||
if (!rowSize) rowSize = size;
|
if (!rowSize) rowSize = size;
|
||||||
r += r == 0 ? 6 : 8
|
r += r == 0 ? 3 : 4
|
||||||
}
|
}
|
||||||
|
|
||||||
if (left != null) {
|
if (left != null) {
|
||||||
this.set_reactive(false)
|
this.set_reactive(false)
|
||||||
left.add_style_class_name("boxLay");
|
left.add_style_class_name("boxLay");
|
||||||
left.set_style("background-color: rgba(" + this.settings.get_double("background-r" + this.settings.scheme) + "," + this.settings.get_double("background-g" + this.settings.scheme) + "," + this.settings.get_double("background-b" + this.settings.scheme) + ", " + this.settings.get_double("background-a" + this.settings.scheme) + ");")
|
|
||||||
right.add_style_class_name("boxLay");
|
right.add_style_class_name("boxLay");
|
||||||
right.set_style("background-color: rgba(" + this.settings.get_double("background-r" + this.settings.scheme) + "," + this.settings.get_double("background-g" + this.settings.scheme) + "," + this.settings.get_double("background-b" + this.settings.scheme) + ", " + this.settings.get_double("background-a" + this.settings.scheme) + ");")
|
if (this.settings.get_boolean("system-accent-col") && major >= 47) {
|
||||||
if (this.lightOrDark(this.settings.get_double("background-r" + this.settings.scheme), this.settings.get_double("background-g" + this.settings.scheme), this.settings.get_double("background-b" + this.settings.scheme))) {
|
if (this.settings.scheme == "-dark") {
|
||||||
|
left.set_style("background-color: st-darken(-st-accent-color, 30%); padding: " + this.settings.get_int("outer-spacing-px") + "px;")
|
||||||
|
right.set_style("background-color: st-darken(-st-accent-color, 30%); padding: " + this.settings.get_int("outer-spacing-px") + "px;")
|
||||||
|
} else {
|
||||||
|
left.set_style("background-color: st-lighten(-st-accent-color, 10%); padding: " + this.settings.get_int("outer-spacing-px") + "px;")
|
||||||
|
right.set_style("background-color: st-lighten(-st-accent-color, 10%); padding: " + this.settings.get_int("outer-spacing-px") + "px;")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
left.set_style("background-color: rgba(" + this.settings.get_double("background-r" + this.settings.scheme) + "," + this.settings.get_double("background-g" + this.settings.scheme) + "," + this.settings.get_double("background-b" + this.settings.scheme) + ", " + this.settings.get_double("background-a" + this.settings.scheme) + "); padding: " + this.settings.get_int("outer-spacing-px") + "px;")
|
||||||
|
right.set_style("background-color: rgba(" + this.settings.get_double("background-r" + this.settings.scheme) + "," + this.settings.get_double("background-g" + this.settings.scheme) + "," + this.settings.get_double("background-b" + this.settings.scheme) + ", " + this.settings.get_double("background-a" + this.settings.scheme) + "); padding: " + this.settings.get_int("outer-spacing-px") + "px;")
|
||||||
|
}
|
||||||
|
if (this.lightOrDark()) {
|
||||||
left.add_style_class_name("inverted");
|
left.add_style_class_name("inverted");
|
||||||
right.add_style_class_name("inverted");
|
right.add_style_class_name("inverted");
|
||||||
} else {
|
} else {
|
||||||
@ -808,7 +916,7 @@ class Keyboard extends Dialog {
|
|||||||
settingsBtn.connect("clicked", () => {
|
settingsBtn.connect("clicked", () => {
|
||||||
this.settingsOpenFunction();
|
this.settingsOpenFunction();
|
||||||
})
|
})
|
||||||
gridLeft.attach(settingsBtn, 0, 0, 8, 5)
|
gridLeft.attach(settingsBtn, 0, 0, 2 * topBtnWidth, 3)
|
||||||
this.keys.push(settingsBtn)
|
this.keys.push(settingsBtn)
|
||||||
|
|
||||||
const closeBtn = new St.Button({
|
const closeBtn = new St.Button({
|
||||||
@ -821,7 +929,7 @@ class Keyboard extends Dialog {
|
|||||||
this.close();
|
this.close();
|
||||||
this.closedFromButton = true;
|
this.closedFromButton = true;
|
||||||
})
|
})
|
||||||
gridRight.attach(closeBtn, (rowSize - 8), 0, 8, 5)
|
gridRight.attach(closeBtn, (rowSize - 2 * topBtnWidth), 0, 2 * topBtnWidth, 3)
|
||||||
this.keys.push(closeBtn)
|
this.keys.push(closeBtn)
|
||||||
|
|
||||||
let moveHandleLeft = new St.Button({
|
let moveHandleLeft = new St.Button({
|
||||||
@ -829,8 +937,8 @@ class Keyboard extends Dialog {
|
|||||||
y_expand: true
|
y_expand: true
|
||||||
})
|
})
|
||||||
moveHandleLeft.add_style_class_name("moveHandle")
|
moveHandleLeft.add_style_class_name("moveHandle")
|
||||||
moveHandleLeft.set_style("font-size: " + this.settings.get_int("font-size-px") + "px; border-radius: " + (this.settings.get_boolean("round-key-corners") ? "5px;" : "0;") + "background-size: " + this.settings.get_int("font-size-px") + "px;");
|
moveHandleLeft.set_style("font-size: " + this.settings.get_int("font-size-px") + "px; border-radius: " + (this.settings.get_boolean("round-key-corners") ? "5px;" : "0;") + "background-size: " + this.settings.get_int("font-size-px") + "px; font-weight: " + (this.settings.get_boolean("font-bold") ? "bold" : "normal") + "; border: " + this.settings.get_int("border-spacing-px") + "px solid transparent;");
|
||||||
if (this.lightOrDark(this.settings.get_double("background-r" + this.settings.scheme), this.settings.get_double("background-g" + this.settings.scheme), this.settings.get_double("background-b" + this.settings.scheme))) {
|
if (this.lightOrDark()) {
|
||||||
moveHandleLeft.add_style_class_name("inverted");
|
moveHandleLeft.add_style_class_name("inverted");
|
||||||
} else {
|
} else {
|
||||||
moveHandleLeft.add_style_class_name("regular");
|
moveHandleLeft.add_style_class_name("regular");
|
||||||
@ -842,15 +950,15 @@ class Keyboard extends Dialog {
|
|||||||
}
|
}
|
||||||
this.event(event, false)
|
this.event(event, false)
|
||||||
})
|
})
|
||||||
gridLeft.attach(moveHandleLeft, 8, 0, (halfSize - 8), 5)
|
gridLeft.attach(moveHandleLeft, 2 * topBtnWidth, 0, (halfSize - 2 * topBtnWidth), 3)
|
||||||
|
|
||||||
let moveHandleRight = new St.Button({
|
let moveHandleRight = new St.Button({
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
y_expand: true
|
y_expand: true
|
||||||
})
|
})
|
||||||
moveHandleRight.add_style_class_name("moveHandle")
|
moveHandleRight.add_style_class_name("moveHandle")
|
||||||
moveHandleRight.set_style("font-size: " + this.settings.get_int("font-size-px") + "px; border-radius: " + (this.settings.get_boolean("round-key-corners") ? "5px;" : "0;") + "background-size: " + this.settings.get_int("font-size-px") + "px;");
|
moveHandleRight.set_style("font-size: " + this.settings.get_int("font-size-px") + "px; border-radius: " + (this.settings.get_boolean("round-key-corners") ? "5px;" : "0;") + "background-size: " + this.settings.get_int("font-size-px") + "px; font-weight: " + (this.settings.get_boolean("font-bold") ? "bold" : "normal") + "; border: " + this.settings.get_int("border-spacing-px") + "px solid transparent;");
|
||||||
if (this.lightOrDark(this.settings.get_double("background-r" + this.settings.scheme), this.settings.get_double("background-g" + this.settings.scheme), this.settings.get_double("background-b" + this.settings.scheme))) {
|
if (this.lightOrDark()) {
|
||||||
moveHandleRight.add_style_class_name("inverted");
|
moveHandleRight.add_style_class_name("inverted");
|
||||||
} else {
|
} else {
|
||||||
moveHandleRight.add_style_class_name("regular");
|
moveHandleRight.add_style_class_name("regular");
|
||||||
@ -862,13 +970,21 @@ class Keyboard extends Dialog {
|
|||||||
}
|
}
|
||||||
this.event(event, false)
|
this.event(event, false)
|
||||||
})
|
})
|
||||||
gridRight.attach(moveHandleRight, (rowSize - halfSize), 0, (rowSize - halfSize - 4), 5)
|
gridRight.attach(moveHandleRight, halfSize, 0, (rowSize - halfSize - 2 * topBtnWidth), 3)
|
||||||
gridLeft.attach(new St.Widget({x_expand: true, y_expand: true}), 0, 5, halfSize, 1)
|
gridLeft.attach(new St.Widget({ x_expand: true, y_expand: true }), 0, 3, halfSize, 1)
|
||||||
gridRight.attach(new St.Widget({x_expand: true, y_expand: true}), (rowSize - halfSize), 5, (rowSize - halfSize + 4), 1)
|
gridRight.attach(new St.Widget({ x_expand: true, y_expand: true }), halfSize, 3, (rowSize - halfSize), 1)
|
||||||
} else {
|
} else {
|
||||||
this.box.add_style_class_name("boxLay");
|
this.box.add_style_class_name("boxLay");
|
||||||
this.box.set_style("background-color: rgba(" + this.settings.get_double("background-r" + this.settings.scheme) + "," + this.settings.get_double("background-g" + this.settings.scheme) + "," + this.settings.get_double("background-b" + this.settings.scheme) + ", " + this.settings.get_double("background-a" + this.settings.scheme) + ");")
|
if (this.settings.get_boolean("system-accent-col") && major >= 47) {
|
||||||
if (this.lightOrDark(this.settings.get_double("background-r" + this.settings.scheme), this.settings.get_double("background-g" + this.settings.scheme), this.settings.get_double("background-b" + this.settings.scheme))) {
|
if (this.settings.scheme == "-dark") {
|
||||||
|
this.box.set_style("background-color: st-darken(-st-accent-color, 30%); padding: " + this.settings.get_int("outer-spacing-px") + "px;")
|
||||||
|
} else {
|
||||||
|
this.box.set_style("background-color: st-lighten(-st-accent-color, 10%); padding: " + this.settings.get_int("outer-spacing-px") + "px;")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.box.set_style("background-color: rgba(" + this.settings.get_double("background-r" + this.settings.scheme) + "," + this.settings.get_double("background-g" + this.settings.scheme) + "," + this.settings.get_double("background-b" + this.settings.scheme) + ", " + this.settings.get_double("background-a" + this.settings.scheme) + "); padding: " + this.settings.get_int("outer-spacing-px") + "px;")
|
||||||
|
}
|
||||||
|
if (this.lightOrDark()) {
|
||||||
this.box.add_style_class_name("inverted");
|
this.box.add_style_class_name("inverted");
|
||||||
} else {
|
} else {
|
||||||
this.box.add_style_class_name("regular");
|
this.box.add_style_class_name("regular");
|
||||||
@ -883,7 +999,7 @@ class Keyboard extends Dialog {
|
|||||||
settingsBtn.connect("clicked", () => {
|
settingsBtn.connect("clicked", () => {
|
||||||
this.settingsOpenFunction();
|
this.settingsOpenFunction();
|
||||||
})
|
})
|
||||||
grid.attach(settingsBtn, 0, 0, 8, 5)
|
grid.attach(settingsBtn, 0, 0, 2 * topBtnWidth, 3)
|
||||||
this.keys.push(settingsBtn)
|
this.keys.push(settingsBtn)
|
||||||
|
|
||||||
const closeBtn = new St.Button({
|
const closeBtn = new St.Button({
|
||||||
@ -896,16 +1012,18 @@ class Keyboard extends Dialog {
|
|||||||
this.close();
|
this.close();
|
||||||
this.closedFromButton = true;
|
this.closedFromButton = true;
|
||||||
})
|
})
|
||||||
grid.attach(closeBtn, (rowSize - 8), 0, 8, 5)
|
grid.attach(closeBtn, (rowSize - 2 * topBtnWidth), 0, 2 * topBtnWidth, 3)
|
||||||
this.keys.push(closeBtn)
|
this.keys.push(closeBtn)
|
||||||
|
|
||||||
|
// [insert handwriting 10]
|
||||||
|
|
||||||
let moveHandle = new St.Button({
|
let moveHandle = new St.Button({
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
y_expand: true
|
y_expand: true
|
||||||
})
|
})
|
||||||
moveHandle.add_style_class_name("moveHandle")
|
moveHandle.add_style_class_name("moveHandle")
|
||||||
moveHandle.set_style("font-size: " + this.settings.get_int("font-size-px") + "px; border-radius: " + (this.settings.get_boolean("round-key-corners") ? "5px;" : "0;") + "background-size: " + this.settings.get_int("font-size-px") + "px;");
|
moveHandle.set_style("font-size: " + this.settings.get_int("font-size-px") + "px; border-radius: " + (this.settings.get_boolean("round-key-corners") ? "5px;" : "0;") + "background-size: " + this.settings.get_int("font-size-px") + "px; font-weight: " + (this.settings.get_boolean("font-bold") ? "bold" : "normal") + "; border: " + this.settings.get_int("border-spacing-px") + "px solid transparent;");
|
||||||
if (this.lightOrDark(this.settings.get_double("background-r" + this.settings.scheme), this.settings.get_double("background-g" + this.settings.scheme), this.settings.get_double("background-b" + this.settings.scheme))) {
|
if (this.lightOrDark()) {
|
||||||
moveHandle.add_style_class_name("inverted");
|
moveHandle.add_style_class_name("inverted");
|
||||||
} else {
|
} else {
|
||||||
moveHandle.add_style_class_name("regular");
|
moveHandle.add_style_class_name("regular");
|
||||||
@ -917,13 +1035,13 @@ class Keyboard extends Dialog {
|
|||||||
}
|
}
|
||||||
this.event(event, false)
|
this.event(event, false)
|
||||||
})
|
})
|
||||||
grid.attach(moveHandle, 8, 0, (rowSize - 16), 5)
|
grid.attach(moveHandle, 2 * topBtnWidth, 0, (rowSize - 4 * topBtnWidth), 3) // [insert handwriting 11]
|
||||||
grid.attach(new St.Widget({x_expand: true, y_expand: true}), 0, 5, rowSize, 1)
|
grid.attach(new St.Widget({ x_expand: true, y_expand: true }), 0, 3, rowSize, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.keys.forEach(item => {
|
this.keys.forEach(item => {
|
||||||
item.set_style("font-size: " + this.settings.get_int("font-size-px") + "px; border-radius: " + (this.settings.get_boolean("round-key-corners") ? "5px;" : "0;") + "background-size: " + this.settings.get_int("font-size-px") + "px; font-weight: " + (this.settings.get_boolean("font-bold") ? "bold" : "normal") + ";");
|
item.set_style("font-size: " + this.settings.get_int("font-size-px") + "px; border-radius: " + (this.settings.get_boolean("round-key-corners") ? (this.settings.get_int("border-spacing-px") + 5) + "px;" : "0;") + "background-size: " + this.settings.get_int("font-size-px") + "px; font-weight: " + (this.settings.get_boolean("font-bold") ? "bold" : "normal") + "; border: " + this.settings.get_int("border-spacing-px") + "px solid transparent;");
|
||||||
if (this.lightOrDark(this.settings.get_double("background-r" + this.settings.scheme), this.settings.get_double("background-g" + this.settings.scheme), this.settings.get_double("background-b" + this.settings.scheme))) {
|
if (this.lightOrDark()) {
|
||||||
item.add_style_class_name("inverted");
|
item.add_style_class_name("inverted");
|
||||||
} else {
|
} else {
|
||||||
item.add_style_class_name("regular");
|
item.add_style_class_name("regular");
|
||||||
@ -948,6 +1066,7 @@ class Keyboard extends Dialog {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
let pressEv = (evType) => {
|
let pressEv = (evType) => {
|
||||||
|
this.box.set_child_at_index(item, this.box.get_children().length - 1);
|
||||||
item.space_motion_handler = null
|
item.space_motion_handler = null
|
||||||
item.set_scale(1.2, 1.2)
|
item.set_scale(1.2, 1.2)
|
||||||
item.add_style_pseudo_class("pressed")
|
item.add_style_pseudo_class("pressed")
|
||||||
@ -1052,18 +1171,22 @@ class Keyboard extends Dialog {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
lightOrDark(r, g, b) {
|
lightOrDark() {
|
||||||
|
let r, g, b;
|
||||||
|
if (this.settings.get_boolean("system-accent-col")) {
|
||||||
|
return this.settings.scheme != "-dark"
|
||||||
|
} else {
|
||||||
|
r = this.settings.get_double("background-r" + this.settings.scheme);
|
||||||
|
g = this.settings.get_double("background-g" + this.settings.scheme);
|
||||||
|
b = this.settings.get_double("background-b" + this.settings.scheme);
|
||||||
|
}
|
||||||
var hsp;
|
var hsp;
|
||||||
hsp = Math.sqrt(
|
hsp = Math.sqrt(
|
||||||
0.299 * (r * r) +
|
0.299 * (r * r) +
|
||||||
0.587 * (g * g) +
|
0.587 * (g * g) +
|
||||||
0.114 * (b * b)
|
0.114 * (b * b)
|
||||||
);
|
);
|
||||||
if (hsp > 127.5) {
|
return hsp > 127.5
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
releaseAllKeys() {
|
releaseAllKeys() {
|
||||||
let instances = [];
|
let instances = [];
|
||||||
@ -1202,12 +1325,13 @@ class Keyboard extends Dialog {
|
|||||||
if (!(button.char.code == 42) && !(button.char.code == 54))
|
if (!(button.char.code == 42) && !(button.char.code == 54))
|
||||||
button.remove_style_class_name("selected");
|
button.remove_style_class_name("selected");
|
||||||
this.modBtns.splice(this.modBtns.indexOf(button), this.modBtns.indexOf(button) + 1);
|
this.modBtns.splice(this.modBtns.indexOf(button), this.modBtns.indexOf(button) + 1);
|
||||||
this.sendKey([button.char.code]);
|
this.inputDevice.notify_key(Clutter.get_current_event_time(), button.char.code, Clutter.KeyState.RELEASED);
|
||||||
} else {
|
} else {
|
||||||
if (!(button.char.code == 42) && !(button.char.code == 54))
|
if (!(button.char.code == 42) && !(button.char.code == 54))
|
||||||
button.add_style_class_name("selected");
|
button.add_style_class_name("selected");
|
||||||
this.mod.push(button.char.code);
|
this.mod.push(button.char.code);
|
||||||
this.modBtns.push(button);
|
this.modBtns.push(button);
|
||||||
|
this.inputDevice.notify_key(Clutter.get_current_event_time(), button.char.code, Clutter.KeyState.PRESSED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"_generated": "Generated by SweetTooth, do not edit",
|
|
||||||
"description": "A new Onscreen Keyboard built using GNOME JS",
|
"description": "A new Onscreen Keyboard built using GNOME JS",
|
||||||
"gettext-domain": "gjsosk@vishram1123.com",
|
"gettext-domain": "gjsosk@vishram1123.com",
|
||||||
"name": "GJS OSK",
|
"name": "GJS OSK",
|
||||||
@ -7,9 +6,10 @@
|
|||||||
"shell-version": [
|
"shell-version": [
|
||||||
"45",
|
"45",
|
||||||
"46",
|
"46",
|
||||||
"47"
|
"47",
|
||||||
|
"48"
|
||||||
],
|
],
|
||||||
"url": "https://github.com/Vishram1123/gjs-osk",
|
"url": "https://github.com/Vishram1123/gjs-osk",
|
||||||
"uuid": "gjsosk@vishram1123.com",
|
"uuid": "gjsosk@vishram1123.com",
|
||||||
"version": 27
|
"version": 100000
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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":"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":"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"}]
|
[{"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}]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -3,9 +3,11 @@
|
|||||||
import Adw from 'gi://Adw';
|
import Adw from 'gi://Adw';
|
||||||
import Gtk from 'gi://Gtk';
|
import Gtk from 'gi://Gtk';
|
||||||
import Gdk from 'gi://Gdk';
|
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 { 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 {
|
export default class GjsOskPreferences extends ExtensionPreferences {
|
||||||
fillPreferencesWindow(window) {
|
fillPreferencesWindow(window) {
|
||||||
@ -25,18 +27,41 @@ export default class GjsOskPreferences extends ExtensionPreferences {
|
|||||||
});
|
});
|
||||||
page1.add(behaviorGroup);
|
page1.add(behaviorGroup);
|
||||||
|
|
||||||
const layoutRow = new Adw.ActionRow({
|
const layoutRow = new Adw.ExpanderRow({
|
||||||
title: _('Layout')
|
title: _('Layout')
|
||||||
});
|
});
|
||||||
behaviorGroup.add(layoutRow);
|
behaviorGroup.add(layoutRow);
|
||||||
|
|
||||||
let layoutList = ["Full Sized International", "Full Sized US", "Tenkeyless International", "Tenkeyless US", "Compact International", "Compact US", "Split International", "Split US"];
|
const layoutLandscapeRow = new Adw.ActionRow({
|
||||||
let layoutDrop = Gtk.DropDown.new_from_strings(layoutList);
|
title: _('Landscape Layout')
|
||||||
layoutDrop.valign = Gtk.Align.CENTER;
|
});
|
||||||
layoutDrop.selected = settings.get_int("layout");
|
layoutRow.add_row(layoutLandscapeRow);
|
||||||
|
|
||||||
layoutRow.add_suffix(layoutDrop);
|
let layouts;
|
||||||
layoutRow.activatable_widget = layoutDrop;
|
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({
|
const enableDragRow = new Adw.ActionRow({
|
||||||
title: _('Enable Dragging')
|
title: _('Enable Dragging')
|
||||||
@ -132,6 +157,49 @@ export default class GjsOskPreferences extends ExtensionPreferences {
|
|||||||
landscapeSizing.add_row(lW);
|
landscapeSizing.add_row(lW);
|
||||||
landscapeSizing.add_row(lH);
|
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({
|
const defaultPosition = new Adw.ActionRow({
|
||||||
title: _('Default Position')
|
title: _('Default Position')
|
||||||
});
|
});
|
||||||
@ -203,6 +271,23 @@ export default class GjsOskPreferences extends ExtensionPreferences {
|
|||||||
darkCol.add_suffix(colorButton_d);
|
darkCol.add_suffix(colorButton_d);
|
||||||
darkCol.activatable_widget = 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({
|
let fontSize = new Adw.ActionRow({
|
||||||
title: _('Font Size (px)')
|
title: _('Font Size (px)')
|
||||||
});
|
});
|
||||||
@ -239,6 +324,17 @@ export default class GjsOskPreferences extends ExtensionPreferences {
|
|||||||
borderSpacing.add_suffix(numChanger_bord);
|
borderSpacing.add_suffix(numChanger_bord);
|
||||||
borderSpacing.activatable_widget = 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({
|
let snapSpacing = new Adw.ActionRow({
|
||||||
title: _('Drag snap spacing (px)')
|
title: _('Drag snap spacing (px)')
|
||||||
});
|
});
|
||||||
@ -309,7 +405,7 @@ export default class GjsOskPreferences extends ExtensionPreferences {
|
|||||||
context.add_class("title-1");
|
context.add_class("title-1");
|
||||||
|
|
||||||
let another_label = new Gtk.Label({
|
let another_label = new Gtk.Label({
|
||||||
label: _("Autorelease ") + `fab8e97`
|
label: _("Autorelease ") + `776e35f`
|
||||||
});
|
});
|
||||||
|
|
||||||
let links_pref_group = new Adw.PreferencesGroup();
|
let links_pref_group = new Adw.PreferencesGroup();
|
||||||
@ -349,7 +445,8 @@ export default class GjsOskPreferences extends ExtensionPreferences {
|
|||||||
|
|
||||||
window.add(page2);
|
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-drag", dragEnableDT, "active", 0);
|
||||||
settings.bind("enable-tap-gesture", dragOpt, "selected", 0);
|
settings.bind("enable-tap-gesture", dragOpt, "selected", 0);
|
||||||
settings.bind("indicator-enabled", indEnabled, "active", 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-size-px", numChanger_font, "value", 0);
|
||||||
settings.bind("font-bold", fontBoldEnabled, "active", 0)
|
settings.bind("font-bold", fontBoldEnabled, "active", 0)
|
||||||
settings.bind("border-spacing-px", numChanger_bord, "value", 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("snap-spacing-px", numChanger_snap, "value", 0)
|
||||||
settings.bind("round-key-corners", roundKeyCDT, "active", 0);
|
settings.bind("round-key-corners", roundKeyCDT, "active", 0);
|
||||||
settings.bind("play-sound", soundPlayDT, "active", 0);
|
settings.bind("play-sound", soundPlayDT, "active", 0);
|
||||||
settings.bind("show-icons", showIconDT, "active", 0)
|
settings.bind("show-icons", showIconDT, "active", 0)
|
||||||
settings.bind("default-snap", snapDrop, "selected", 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", () => {
|
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_boolean("enable-drag", dragEnableDT.active);
|
||||||
settings.set_int("enable-tap-gesture", dragOpt.selected);
|
settings.set_int("enable-tap-gesture", dragOpt.selected);
|
||||||
settings.set_boolean("indicator-enabled", indEnabled.active);
|
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_int("font-size-px", numChanger_font.value);
|
||||||
settings.set_boolean("font-bold", fontBoldEnabled.active)
|
settings.set_boolean("font-bold", fontBoldEnabled.active)
|
||||||
settings.set_int("border-spacing-px", numChanger_bord.value);
|
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_int("snap-spacing-px", numChanger_snap.value)
|
||||||
settings.set_boolean("round-key-corners", roundKeyCDT.active);
|
settings.set_boolean("round-key-corners", roundKeyCDT.active);
|
||||||
settings.set_boolean("play-sound", soundPlayDT.active);
|
settings.set_boolean("play-sound", soundPlayDT.active);
|
||||||
settings.set_boolean("show-icons", showIconDT.active)
|
settings.set_boolean("show-icons", showIconDT.active)
|
||||||
settings.set_int("default-snap", snapDrop.selected);
|
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)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<schemalist>
|
<schemalist>
|
||||||
<schema id="org.gnome.shell.extensions.gjsosk" path="/org/gnome/shell/extensions/gjsosk/">
|
<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>
|
<default>0</default>
|
||||||
</key>
|
</key>
|
||||||
<key name="portrait-width-percent" type="i">
|
<key name="portrait-width-percent" type="i">
|
||||||
@ -43,6 +46,9 @@
|
|||||||
<key name="background-a-dark" type="d">
|
<key name="background-a-dark" type="d">
|
||||||
<default>1</default>
|
<default>1</default>
|
||||||
</key>
|
</key>
|
||||||
|
<key name="system-accent-col" type="b">
|
||||||
|
<default>false</default>
|
||||||
|
</key>
|
||||||
<key name="font-size-px" type="i">
|
<key name="font-size-px" type="i">
|
||||||
<default>14</default>
|
<default>14</default>
|
||||||
</key>
|
</key>
|
||||||
@ -52,6 +58,9 @@
|
|||||||
<key name="border-spacing-px" type="i">
|
<key name="border-spacing-px" type="i">
|
||||||
<default>2</default>
|
<default>2</default>
|
||||||
</key>
|
</key>
|
||||||
|
<key name="outer-spacing-px" type="i">
|
||||||
|
<default>20</default>
|
||||||
|
</key>
|
||||||
<key name="snap-spacing-px" type="i">
|
<key name="snap-spacing-px" type="i">
|
||||||
<default>25</default>
|
<default>25</default>
|
||||||
</key>
|
</key>
|
||||||
@ -61,6 +70,9 @@
|
|||||||
<key name="default-snap" type="i">
|
<key name="default-snap" type="i">
|
||||||
<default>7</default>
|
<default>7</default>
|
||||||
</key>
|
</key>
|
||||||
|
<key name="default-monitor" type="s">
|
||||||
|
<default>""</default>
|
||||||
|
</key>
|
||||||
<key name="enable-tap-gesture" type="i">
|
<key name="enable-tap-gesture" type="i">
|
||||||
<default>1</default>
|
<default>1</default>
|
||||||
</key>
|
</key>
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
.regular:pressed {
|
.regular:pressed {
|
||||||
background-color: rgba(255, 255, 255, 0.2);
|
background-color: rgba(255, 255, 255, 0.2);
|
||||||
color: white;
|
color: white;
|
||||||
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inverted:pressed {
|
.inverted:pressed {
|
||||||
background-color: rgba(0, 0, 0, 0.2);
|
background-color: rgba(0, 0, 0, 0.2);
|
||||||
color: black;
|
color: black;
|
||||||
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.regular {
|
.regular {
|
||||||
@ -17,12 +19,16 @@
|
|||||||
background-color: rgba(0, 0, 0, 0.05);
|
background-color: rgba(0, 0, 0, 0.05);
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
.key, .moveHandle {
|
|
||||||
border: 0;
|
.key,
|
||||||
|
.moveHandle {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background-clip: padding-box;
|
background-clip: padding-box;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
background-image: url(ui/icons/hicolor/scalable/actions/transparent.svg);
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dr-b {
|
.dr-b {
|
||||||
@ -34,6 +40,7 @@
|
|||||||
|
|
||||||
.close_btn,
|
.close_btn,
|
||||||
.settings_btn,
|
.settings_btn,
|
||||||
|
/* [insert styles handwriting 1] */
|
||||||
.backspace_btn,
|
.backspace_btn,
|
||||||
.tab_btn,
|
.tab_btn,
|
||||||
.capslock_btn,
|
.capslock_btn,
|
||||||
@ -51,11 +58,13 @@
|
|||||||
background-position: center;
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
background-image: url(ui/icons/hicolor/scalable/actions/right-dark.svg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,6 +233,5 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.boxLay {
|
.boxLay {
|
||||||
padding: 20px;
|
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
@ -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 |
@ -3,13 +3,13 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
PACKAGE_VERSION: 58,
|
PACKAGE_VERSION: 62,
|
||||||
PACKAGE_URL: 'https://github.com/GSConnect/gnome-shell-extension-gsconnect',
|
PACKAGE_URL: 'https://github.com/GSConnect/gnome-shell-extension-gsconnect',
|
||||||
PACKAGE_BUGREPORT: 'https://github.com/GSConnect/gnome-shell-extension-gsconnect/issues/new',
|
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_DATADIR: '/usr/local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io',
|
||||||
PACKAGE_LOCALEDIR: '/usr/local/share/locale',
|
PACKAGE_LOCALEDIR: '/usr/local/share/locale',
|
||||||
GSETTINGS_SCHEMA_DIR: '/usr/local/share/glib-2.0/schemas',
|
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_ID: 'org.gnome.Shell.Extensions.GSConnect',
|
||||||
APP_PATH: '/org/gnome/Shell/Extensions/GSConnect',
|
APP_PATH: '/org/gnome/Shell/Extensions/GSConnect',
|
||||||
|
|||||||
@ -22,9 +22,8 @@ import * as Device from './shell/device.js';
|
|||||||
import * as Keybindings from './shell/keybindings.js';
|
import * as Keybindings from './shell/keybindings.js';
|
||||||
import * as Notification from './shell/notification.js';
|
import * as Notification from './shell/notification.js';
|
||||||
import * as Input from './shell/input.js';
|
import * as Input from './shell/input.js';
|
||||||
import * as Utils from './shell/utils.js';
|
|
||||||
import * as Remote from './utils/remote.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;
|
const QuickSettingsMenu = Main.panel.statusArea.quickSettings;
|
||||||
|
|
||||||
@ -358,7 +357,7 @@ export default class GSConnectExtension extends Extension {
|
|||||||
|
|
||||||
constructor(metadata) {
|
constructor(metadata) {
|
||||||
super(metadata);
|
super(metadata);
|
||||||
setup(this.path);
|
Setup.setup(this.path);
|
||||||
|
|
||||||
// If installed as a user extension, this checks the permissions
|
// If installed as a user extension, this checks the permissions
|
||||||
// on certain critical files in the extension directory
|
// 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
|
// and makes them executable if not. Some packaging methods
|
||||||
// (particularly GitHub Actions artifacts) automatically remove
|
// (particularly GitHub Actions artifacts) automatically remove
|
||||||
// executable bits from all contents, presumably for security.
|
// executable bits from all contents, presumably for security.
|
||||||
Utils.ensurePermissions();
|
Setup.ensurePermissions();
|
||||||
|
|
||||||
// If installed as a user extension, this will install the Desktop entry,
|
// If installed as a user extension, this will install the Desktop entry,
|
||||||
// DBus and systemd service files necessary for DBus activation and
|
// DBus and systemd service files necessary for DBus activation and
|
||||||
// GNotifications. Since there's no uninit()/uninstall() hook for extensions
|
// GNotifications. Since there's no uninit()/uninstall() hook for extensions
|
||||||
// and they're only used *by* GSConnect, they should be okay to leave.
|
// 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
|
// These modify the notification source for GSConnect's GNotifications and
|
||||||
// need to be active even when the extension is disabled (eg. lock screen).
|
// need to be active even when the extension is disabled (eg. lock screen).
|
||||||
|
|||||||
@ -4,9 +4,10 @@
|
|||||||
"name": "GSConnect",
|
"name": "GSConnect",
|
||||||
"shell-version": [
|
"shell-version": [
|
||||||
"46",
|
"46",
|
||||||
"47"
|
"47",
|
||||||
|
"48"
|
||||||
],
|
],
|
||||||
"url": "https://github.com/GSConnect/gnome-shell-extension-gsconnect/wiki",
|
"url": "https://github.com/GSConnect/gnome-shell-extension-gsconnect/wiki",
|
||||||
"uuid": "gsconnect@andyholmes.github.io",
|
"uuid": "gsconnect@andyholmes.github.io",
|
||||||
"version": 58
|
"version": 62
|
||||||
}
|
}
|
||||||
@ -60,7 +60,7 @@ export function rowSeparators(row, before) {
|
|||||||
*
|
*
|
||||||
* @param {Gtk.ListBoxRow} row1 - The first row
|
* @param {Gtk.ListBoxRow} row1 - The first row
|
||||||
* @param {Gtk.ListBoxRow} row2 - The second 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) {
|
export function titleSortFunc(row1, row2) {
|
||||||
if (!row1.title || !row2.title)
|
if (!row1.title || !row2.title)
|
||||||
@ -605,7 +605,7 @@ export const Panel = GObject.registerClass({
|
|||||||
const isPresent = value.get_boolean();
|
const isPresent = value.get_boolean();
|
||||||
|
|
||||||
resolve(isPresent);
|
resolve(isPresent);
|
||||||
} catch (e) {
|
} catch {
|
||||||
resolve(false);
|
resolve(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -614,7 +614,7 @@ export const Panel = GObject.registerClass({
|
|||||||
|
|
||||||
this.battery_system_label.visible = hasBattery;
|
this.battery_system_label.visible = hasBattery;
|
||||||
this.battery_system.visible = hasBattery;
|
this.battery_system.visible = hasBattery;
|
||||||
} catch (e) {
|
} catch {
|
||||||
this.battery_system_label.visible = false;
|
this.battery_system_label.visible = false;
|
||||||
this.battery_system.visible = false;
|
this.battery_system.visible = false;
|
||||||
}
|
}
|
||||||
@ -814,7 +814,7 @@ export const Panel = GObject.registerClass({
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
applications = JSON.parse(settings.get_string('applications'));
|
applications = JSON.parse(settings.get_string('applications'));
|
||||||
} catch (e) {
|
} catch {
|
||||||
applications = {};
|
applications = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -858,7 +858,7 @@ export const Panel = GObject.registerClass({
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
applications = JSON.parse(settings.get_string('applications'));
|
applications = JSON.parse(settings.get_string('applications'));
|
||||||
} catch (e) {
|
} catch {
|
||||||
applications = {};
|
applications = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||