mirror of
https://gitlab.com/thebiblelover7/dotfiles.git
synced 2025-12-14 04:03:50 +00:00
initial commit
This commit is contained in:
@@ -0,0 +1,152 @@
|
||||
const AppSystem = imports.gi.Shell.AppSystem;
|
||||
const WindowTracker = imports.gi.Shell.WindowTracker;
|
||||
const getSettings = imports.misc.extensionUtils.getSettings;
|
||||
const GLib = imports.gi.GLib;
|
||||
const Me = imports.misc.extensionUtils.getCurrentExtension();
|
||||
|
||||
var leftClick = function (icon, event) {
|
||||
let trayApp = getTrayApp(icon);
|
||||
if (trayApp) {
|
||||
let focusedApp = WindowTracker.get_default().focusApp;
|
||||
let windows = trayApp.get_windows();
|
||||
|
||||
if (windows == "") {
|
||||
return openApplication(trayApp, icon, event);
|
||||
}
|
||||
|
||||
if (focusedApp != null && focusedApp.id == trayApp.id) {
|
||||
return minimizeWindows(focusedApp.get_windows(), icon, event);
|
||||
}
|
||||
|
||||
return activateWindows(windows, trayApp, event);
|
||||
}
|
||||
|
||||
icon.click(event);
|
||||
|
||||
// On Windows double-click restore app
|
||||
if (isWine(icon)) {
|
||||
icon.click(event);
|
||||
}
|
||||
};
|
||||
|
||||
var middleClick = function (icon, event) {
|
||||
// When holding SHIFT
|
||||
if (event.get_state_full()[1] === 1) {
|
||||
let trayApp = getTrayApp(icon);
|
||||
if (trayApp) {
|
||||
const pid = getPid(icon);
|
||||
// Kill app
|
||||
if (isUsingQt(pid)) {
|
||||
return GLib.spawn_command_line_sync(`/bin/kill ${pid}`);
|
||||
}
|
||||
let windows = trayApp.get_windows();
|
||||
windows.forEach((window) => {
|
||||
window.kill();
|
||||
});
|
||||
trayApp.request_quit();
|
||||
}
|
||||
} else {
|
||||
icon.click(event);
|
||||
}
|
||||
};
|
||||
|
||||
var getAppSetting = function (icon, setting) {
|
||||
const iconApp = getTrayApp(icon);
|
||||
const appsSettings = JSON.parse(getSettings().get_string("applications"));
|
||||
const appSettings = appsSettings.find((app) => app.id == iconApp.get_id());
|
||||
|
||||
return appSettings?.[setting];
|
||||
};
|
||||
|
||||
function getTrayApp(icon) {
|
||||
if (isWine(icon)) {
|
||||
const wineApps = AppSystem.get_default()
|
||||
.get_running()
|
||||
.filter((app) => {
|
||||
return app.get_windows()[0].wm_class.includes(".exe");
|
||||
});
|
||||
return wineApps[0];
|
||||
}
|
||||
|
||||
const searchedApps = AppSystem.search(getWmClass(icon.wm_class));
|
||||
if (searchedApps[0] && searchedApps[0][0]) {
|
||||
var i = 1;
|
||||
for (let lookup of searchedApps[0]) {
|
||||
let app = AppSystem.get_default().lookup_app(lookup);
|
||||
if (app.get_windows() != "" || i == searchedApps[0].length) {
|
||||
return app;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function openApplication(trayApp, icon, event) {
|
||||
const isFlatpak = trayApp.app_info.has_key("X-Flatpak");
|
||||
const onBlacklist = Me.metadata["open-blacklist"].includes(icon.wm_class); // Caprine
|
||||
if (isUsingQt(getPid(icon)) || isFlatpak || onBlacklist) {
|
||||
return icon.click(event);
|
||||
}
|
||||
|
||||
return trayApp.open_new_window(0);
|
||||
}
|
||||
|
||||
function minimizeWindows(windows, icon, event) {
|
||||
if (isUsingQt(getPid(icon))) {
|
||||
return icon.click(event);
|
||||
}
|
||||
|
||||
windows.forEach((window) => {
|
||||
window.minimize();
|
||||
});
|
||||
}
|
||||
|
||||
function activateWindows(windows, trayApp, event) {
|
||||
windows.forEach((window) => {
|
||||
if (getSettings().get_boolean("invoke-to-workspace")) {
|
||||
window.change_workspace(global.workspace_manager.get_active_workspace());
|
||||
}
|
||||
trayApp.activate_window(window, event.get_time());
|
||||
window.unminimize();
|
||||
});
|
||||
}
|
||||
|
||||
function isWine(icon) {
|
||||
if (
|
||||
(icon.wm_class == "Wine" || icon.wm_class == "explorer.exe") &&
|
||||
getSettings().get_boolean("wine-behavior")
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function isUsingQt(pid) {
|
||||
let [ok, out, err, exit] = GLib.spawn_command_line_sync(
|
||||
`/bin/bash -c 'pmap -p ${pid} | grep Qt'`
|
||||
);
|
||||
if (out.length) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function getWmClass(wmclass) {
|
||||
wmclass = wmclass.replace(/[0-9]/g, ""); // skype discord
|
||||
wmclass = wmclass.replace("Desktop", ""); // telegram
|
||||
return wmclass;
|
||||
}
|
||||
|
||||
function getPid(icon) {
|
||||
const wmclass = getWmClass(icon.wm_class);
|
||||
if (icon.title != "snixembed") {
|
||||
return icon.pid;
|
||||
}
|
||||
|
||||
let [ok, out, err, exit] = GLib.spawn_command_line_sync(
|
||||
`/bin/bash -c "pidof -s ${wmclass}"`
|
||||
);
|
||||
if (out.length) {
|
||||
return Number(out);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
const { GObject, Clutter, St, GLib } = imports.gi;
|
||||
const { panelMenu, popupMenu } = imports.ui;
|
||||
const { getCurrentExtension, getSettings } = imports.misc.extensionUtils;
|
||||
const AppManager = getCurrentExtension().imports.AppManager;
|
||||
|
||||
var TrayIndicator = GObject.registerClass(
|
||||
class TrayIndicator extends panelMenu.Button {
|
||||
_init() {
|
||||
this._icons = [];
|
||||
|
||||
super._init(0.0, null, false);
|
||||
this._overflow = false;
|
||||
|
||||
this._indicators = new St.BoxLayout();
|
||||
this.add_child(this._indicators);
|
||||
|
||||
this._icon = new St.Icon({
|
||||
icon_name: "view-more-horizontal",
|
||||
style_class: "system-status-icon",
|
||||
reactive: true,
|
||||
track_hover: true,
|
||||
});
|
||||
this._indicators.add_child(this._icon);
|
||||
|
||||
this._menuItem = new popupMenu.PopupBaseMenuItem({
|
||||
reactive: false,
|
||||
can_focus: true,
|
||||
});
|
||||
this.menu.addMenuItem(this._menuItem);
|
||||
this.menu.actor.add_style_class_name("TrayIndicatorPopup");
|
||||
this.hide();
|
||||
}
|
||||
|
||||
get size() {
|
||||
const context = St.ThemeContext.get_for_stage(global.stage);
|
||||
return this._size * context.scale_factor;
|
||||
}
|
||||
|
||||
setSize(size, margin, padding) {
|
||||
this._size = size;
|
||||
this._margin = margin;
|
||||
this._padding = padding;
|
||||
|
||||
this._icons.forEach((icon) => {
|
||||
icon.get_parent().style = this._getButtonStyle();
|
||||
icon.set_size(this._size, this._size);
|
||||
});
|
||||
}
|
||||
|
||||
addIcon(icon) {
|
||||
const isHidden = AppManager.getAppSetting(icon, "hidden");
|
||||
if (isHidden) return;
|
||||
|
||||
const button = new St.Button({
|
||||
child: icon,
|
||||
button_mask:
|
||||
St.ButtonMask.ONE | St.ButtonMask.TWO | St.ButtonMask.THREE,
|
||||
style: this._getButtonStyle(),
|
||||
style_class: "panel-button",
|
||||
});
|
||||
icon.opacity = 0;
|
||||
icon.set_x_align(Clutter.ActorAlign.CENTER);
|
||||
icon.set_y_align(Clutter.ActorAlign.CENTER);
|
||||
icon.inOverflow = this._overflow;
|
||||
GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1000, () => {
|
||||
icon.set_size(this.size, this.size);
|
||||
icon.ease({
|
||||
opacity: 255,
|
||||
duration: 400,
|
||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||
});
|
||||
this._addEffectIcon(icon);
|
||||
return GLib.SOURCE_REMOVE;
|
||||
});
|
||||
icon.connect("destroy", () => {
|
||||
button.destroy();
|
||||
});
|
||||
|
||||
button.connect("button-release-event", (actor, event) => {
|
||||
switch (event.get_button()) {
|
||||
case 1:
|
||||
AppManager.leftClick(icon, event);
|
||||
break;
|
||||
case 2:
|
||||
AppManager.middleClick(icon, event);
|
||||
break;
|
||||
case 3:
|
||||
icon.click(event);
|
||||
break;
|
||||
}
|
||||
if (AppManager.isWine(icon)) {
|
||||
GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1, () => {
|
||||
this.menu.close();
|
||||
return GLib.SOURCE_REMOVE;
|
||||
});
|
||||
} else {
|
||||
this.menu.close();
|
||||
}
|
||||
});
|
||||
|
||||
this._icons.push(icon);
|
||||
|
||||
if (this._overflow) {
|
||||
this._menuItem.actor.add(button);
|
||||
} else {
|
||||
this._indicators.insert_child_at_index(button, 0);
|
||||
}
|
||||
|
||||
this.checkOverflow();
|
||||
}
|
||||
|
||||
removeIcon(icon, ignoreCheckOverflow) {
|
||||
const index = this._icons.indexOf(icon);
|
||||
this._icons.splice(index, 1);
|
||||
|
||||
const actor = icon.get_parent();
|
||||
actor.remove_actor(icon);
|
||||
actor.destroy();
|
||||
|
||||
if (!ignoreCheckOverflow) {
|
||||
this.checkOverflow();
|
||||
}
|
||||
}
|
||||
|
||||
checkOverflow() {
|
||||
if (this._icons.length >= getSettings().get_int("icons-limit")) {
|
||||
this._overflow = true;
|
||||
this._icon.visible = true;
|
||||
this.reactive = true;
|
||||
this.style_class = "panel-button TrayIndicator";
|
||||
} else {
|
||||
this._overflow = false;
|
||||
this._icon.visible = false;
|
||||
this.reactive = false;
|
||||
this.style_class = "TrayIndicator";
|
||||
}
|
||||
|
||||
if (this._icons.length) {
|
||||
this.show();
|
||||
} else {
|
||||
this.hide();
|
||||
}
|
||||
|
||||
this._refreshIcons(this._overflow);
|
||||
}
|
||||
|
||||
_refreshIcons(overflow) {
|
||||
this._icons.forEach((icon) => {
|
||||
if (icon.inOverflow != overflow) {
|
||||
this.removeIcon(icon, true);
|
||||
this.addIcon(icon);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_getButtonStyle() {
|
||||
let style;
|
||||
if (!this._overflow) {
|
||||
style = `margin: ${this._margin.vertical}px ${this._margin.horizontal}px; padding: ${this._padding.vertical}px ${this._padding.horizontal}px`;
|
||||
}
|
||||
return `width: ${this.size}px; height: ${this.size}px;${style}`;
|
||||
}
|
||||
|
||||
_addEffectIcon(icon) {
|
||||
let brightnessContrast = new Clutter.BrightnessContrastEffect({});
|
||||
brightnessContrast.set_contrast(
|
||||
getSettings().get_int("icon-contrast") / 100
|
||||
);
|
||||
brightnessContrast.set_brightness(
|
||||
getSettings().get_int("icon-brightness") / 100
|
||||
);
|
||||
icon.add_effect_with_name("brightnessContrast", brightnessContrast);
|
||||
icon.add_effect_with_name(
|
||||
"desaturate",
|
||||
new Clutter.DesaturateEffect({
|
||||
factor: getSettings().get_int("icon-saturation") / 100,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
setEffect(contrast, saturation, brightness) {
|
||||
this._icons.forEach((icon) => {
|
||||
let brightnessContrast = icon.get_effect("brightnessContrast");
|
||||
brightnessContrast.set_contrast(contrast / 100);
|
||||
brightnessContrast.set_brightness(brightness / 100);
|
||||
|
||||
let desaturate = icon.get_effect("desaturate");
|
||||
desaturate.set_factor(saturation / 100);
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,97 @@
|
||||
const { GObject, Shell } = imports.gi;
|
||||
const { getCurrentExtension, getSettings } = imports.misc.extensionUtils;
|
||||
const System = imports.system;
|
||||
const Main = imports.ui.main;
|
||||
const TrayIndicator = getCurrentExtension().imports.TrayIndicator;
|
||||
|
||||
var TrayIconsClass = GObject.registerClass(
|
||||
class TrayIconsClass extends GObject.Object {
|
||||
_init() {
|
||||
this.tray = new Shell.TrayManager();
|
||||
this.indicators = new TrayIndicator.TrayIndicator();
|
||||
|
||||
this.tray.connect('tray-icon-added', this._onIconAdded.bind(this));
|
||||
this.tray.connect('tray-icon-removed', this._onIconRemoved.bind(this));
|
||||
|
||||
this.tray.manage_screen(Main.panel);
|
||||
}
|
||||
|
||||
_onIconAdded(trayManager, icon) { this.indicators.addIcon(icon); }
|
||||
_onIconRemoved(trayManager, icon) { this.indicators.removeIcon(icon); }
|
||||
|
||||
_destroy() {
|
||||
this.tray = null;
|
||||
|
||||
this.indicators.destroy();
|
||||
System.gc();
|
||||
}
|
||||
});
|
||||
|
||||
let TrayIcons;
|
||||
|
||||
class Extension {
|
||||
_setIconSize() {
|
||||
const margin = { vertical: this._settings.get_int('icon-margin-vertical'), horizontal: this._settings.get_int('icon-margin-horizontal') }
|
||||
const padding = { vertical: this._settings.get_int('icon-padding-vertical'), horizontal: this._settings.get_int('icon-padding-horizontal') }
|
||||
TrayIcons.indicators.setSize(this._settings.get_int('icon-size'), margin, padding);
|
||||
}
|
||||
|
||||
_setTrayMargin() {
|
||||
TrayIcons.indicators.set_style('margin-left: ' + this._settings.get_int('tray-margin-left') + 'px; margin-right: ' + this._settings.get_int('tray-margin-right') + 'px');
|
||||
}
|
||||
|
||||
_setTrayArea() {
|
||||
Main.panel.statusArea['TrayIconsReloaded'] = null;
|
||||
Main.panel.addToStatusArea('TrayIconsReloaded', TrayIcons.indicators, this._settings.get_int('position-weight'), this._settings.get_string('tray-position'));
|
||||
}
|
||||
|
||||
_setIconsLimit() {
|
||||
TrayIcons.indicators.checkOverflow();
|
||||
}
|
||||
|
||||
_setIconEffect() {
|
||||
TrayIcons.indicators.setEffect(this._settings.get_int('icon-contrast'), this._settings.get_int('icon-saturation'), this._settings.get_int('icon-brightness'));
|
||||
}
|
||||
|
||||
_onChange() {
|
||||
this._settings.connect('changed::tray-position', this._setTrayArea.bind(this));
|
||||
this._settings.connect('changed::position-weight', this._setTrayArea.bind(this));
|
||||
this._settings.connect('changed::tray-margin-left', this._setTrayMargin.bind(this));
|
||||
this._settings.connect('changed::tray-margin-right', this._setTrayMargin.bind(this));
|
||||
this._settings.connect('changed::icon-size', this._setIconSize.bind(this));
|
||||
this._settings.connect('changed::icon-margin-horizontal', this._setIconSize.bind(this));
|
||||
this._settings.connect('changed::icon-margin-vertical', this._setIconSize.bind(this));
|
||||
this._settings.connect('changed::icon-padding-vertical', this._setIconSize.bind(this));
|
||||
this._settings.connect('changed::icon-padding-horizontal', this._setIconSize.bind(this));
|
||||
this._settings.connect('changed::icons-limit', this._setIconsLimit.bind());
|
||||
this._settings.connect('changed::icon-saturation', this._setIconEffect.bind(this));
|
||||
this._settings.connect('changed::icon-contrast', this._setIconEffect.bind(this));
|
||||
this._settings.connect('changed::icon-brightness', this._setIconEffect.bind(this));
|
||||
}
|
||||
|
||||
enable() {
|
||||
TrayIcons = new TrayIconsClass();
|
||||
this._settings = getSettings();
|
||||
this._setTrayMargin();
|
||||
this._setIconSize();
|
||||
this._onChange();
|
||||
|
||||
if (Main.layoutManager._startingUp) {
|
||||
this._startupComplete = Main.layoutManager.connect('startup-complete', () => {
|
||||
this._setTrayArea();
|
||||
Main.layoutManager.disconnect(this._startupComplete);
|
||||
});
|
||||
} else {
|
||||
this._setTrayArea();
|
||||
}
|
||||
}
|
||||
|
||||
disable() {
|
||||
TrayIcons._destroy();
|
||||
this._settings.run_dispose();
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
return new Extension();
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_generated": "Generated by SweetTooth, do not edit",
|
||||
"description": "Tray Icons Reloaded is a GNOME Shell extension which bring back Tray Icons to top panel, with additional features.\n\n>>> Read compatibility note on GitHub there is also bug reporting <<<",
|
||||
"name": "Tray Icons: Reloaded",
|
||||
"open-blacklist": [
|
||||
"Electron",
|
||||
"Yad"
|
||||
],
|
||||
"settings-schema": "org.gnome.shell.extensions.trayIconsReloaded",
|
||||
"shell-version": [
|
||||
"41"
|
||||
],
|
||||
"url": "https://github.com/MartinPL/Tray-Icons-Reloaded",
|
||||
"uuid": "trayIconsReloaded@selfmade.pl",
|
||||
"version": 19
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
const { GObject, Gtk } = imports.gi;
|
||||
const ExtensionUtils = imports.misc.extensionUtils;
|
||||
const getSettings = ExtensionUtils.getSettings;
|
||||
|
||||
var AppChooser = GObject.registerClass(
|
||||
class AppChooser extends Gtk.AppChooserDialog {
|
||||
_init(parent) {
|
||||
super._init({
|
||||
transient_for: parent,
|
||||
modal: true,
|
||||
});
|
||||
|
||||
this._widget = this.get_widget();
|
||||
this._widget.set({
|
||||
show_all: true,
|
||||
show_other: true,
|
||||
});
|
||||
this._widget.connect(
|
||||
"application-selected",
|
||||
this._updateSensitivity.bind(this)
|
||||
);
|
||||
|
||||
this.connect("response", this._onResponse.bind(this));
|
||||
this._updateSensitivity();
|
||||
}
|
||||
|
||||
_updateSensitivity() {
|
||||
const apps = JSON.parse(getSettings().get_string("applications"));
|
||||
const appInfo = this._widget.get_app_info();
|
||||
|
||||
this.set_response_sensitive(
|
||||
Gtk.ResponseType.OK,
|
||||
appInfo && !apps.some((app) => app.id.startsWith(appInfo.get_id()))
|
||||
);
|
||||
}
|
||||
|
||||
_onResponse(dlg, id) {
|
||||
const appInfo =
|
||||
id === Gtk.ResponseType.OK ? this._widget.get_app_info() : null;
|
||||
|
||||
if (appInfo) {
|
||||
let apps = JSON.parse(getSettings().get_string("applications"));
|
||||
apps = [
|
||||
...apps,
|
||||
{
|
||||
id: appInfo.get_id(),
|
||||
},
|
||||
];
|
||||
|
||||
getSettings().set_string("applications", JSON.stringify(apps));
|
||||
}
|
||||
|
||||
this.destroy();
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,54 @@
|
||||
const { GObject, Gtk, Gio } = imports.gi;
|
||||
const ExtensionUtils = imports.misc.extensionUtils;
|
||||
const getSettings = ExtensionUtils.getSettings;
|
||||
const Me = ExtensionUtils.getCurrentExtension();
|
||||
|
||||
var AppRow = GObject.registerClass(
|
||||
{
|
||||
GTypeName: "AppRow",
|
||||
Template: Me.dir.get_child("preferences/AppRow.xml").get_uri(),
|
||||
InternalChildren: ["icon", "label", "revealButton", "revealer", "hidden"],
|
||||
},
|
||||
class AppRow extends Gtk.ListBoxRow {
|
||||
_init(app) {
|
||||
super._init();
|
||||
this._appInfo = Gio.DesktopAppInfo.new(app.id);
|
||||
this._settings = getSettings();
|
||||
this._icon.gicon = this._appInfo.get_icon();
|
||||
this._label.label = this._appInfo.get_display_name();
|
||||
this._hidden.set_active(app.hidden);
|
||||
this._hidden.connect("state-set", () => {
|
||||
this._updateApp();
|
||||
});
|
||||
this.appId = this._appInfo.get_id();
|
||||
}
|
||||
|
||||
toggleSettingsVisibility() {
|
||||
this._revealer.reveal_child = !this._revealer.reveal_child;
|
||||
|
||||
if (this._revealer.reveal_child) {
|
||||
this._revealButton.get_style_context().add_class("expanded");
|
||||
} else {
|
||||
this._revealButton.get_style_context().remove_class("expanded");
|
||||
}
|
||||
}
|
||||
|
||||
removeRow() {
|
||||
const current = JSON.parse(this._settings.get_string("applications"));
|
||||
const updated = current.filter((app) => app.id !== this.appId);
|
||||
|
||||
this._settings.set_string("applications", JSON.stringify(updated));
|
||||
}
|
||||
|
||||
_updateApp() {
|
||||
let apps = JSON.parse(this._settings.get_string("applications"));
|
||||
const index = apps.findIndex((app) => app.id == this.appId);
|
||||
apps[index] = {
|
||||
id: this.appId,
|
||||
hidden: this._hidden.get_active(),
|
||||
};
|
||||
|
||||
this._settings.set_string("applications", JSON.stringify(apps));
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="AppRow" parent="GtkListBoxRow">
|
||||
<property name="selectable">false</property>
|
||||
<property name="activatable">false</property>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<property name="margin-top">12</property>
|
||||
<property name="margin-bottom">12</property>
|
||||
<property name="column-spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="icon">
|
||||
<property name="pixel-size">32</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label">
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">true</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="remove-button">
|
||||
<property name="tooltip-text" translatable="yes">Remove</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<signal name="clicked" handler="removeRow" swapped="no" />
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon-name">user-trash-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="revealButton">
|
||||
<property name="valign">center</property>
|
||||
<property name="has-frame">false</property>
|
||||
<property name="icon-name">pan-end-symbolic</property>
|
||||
<signal name="clicked" handler="toggleSettingsVisibility" swapped="no" />
|
||||
<style>
|
||||
<class name="reveal-button"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRevealer" id="revealer">
|
||||
<child>
|
||||
<object class="GtkListBox">
|
||||
<property name="margin-top">8</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="selectable">false</property>
|
||||
<property name="activatable">false</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin-top">8</property>
|
||||
<property name="margin-bottom">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Hidden</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">true</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="hidden">
|
||||
<property name="halign">end</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<layout>
|
||||
<property name="column">0</property>
|
||||
<property name="row">1</property>
|
||||
<property name="column-span">5</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,6 @@
|
||||
.reveal-button image {
|
||||
transition: 250ms;
|
||||
}
|
||||
.reveal-button--expanded image {
|
||||
-gtk-icon-transform: rotate(0.25turn);
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
const { GObject, Gtk, Gio, Gdk } = imports.gi;
|
||||
const ExtensionUtils = imports.misc.extensionUtils;
|
||||
const getSettings = ExtensionUtils.getSettings;
|
||||
const Me = ExtensionUtils.getCurrentExtension();
|
||||
const AppRow = Me.imports.preferences.AppRow.AppRow;
|
||||
const AppChooser = Me.imports.preferences.AppChooser.AppChooser;
|
||||
|
||||
const schemaNames = [
|
||||
"tray-position",
|
||||
"position-weight",
|
||||
"tray-margin-left",
|
||||
"tray-margin-right",
|
||||
"icons-limit",
|
||||
"icon-size",
|
||||
"icon-margin-vertical",
|
||||
"icon-margin-horizontal",
|
||||
"icon-padding-vertical",
|
||||
"icon-padding-horizontal",
|
||||
"icon-saturation",
|
||||
"icon-contrast",
|
||||
"icon-brightness",
|
||||
"invoke-to-workspace",
|
||||
"wine-behavior",
|
||||
];
|
||||
|
||||
const settingIds = schemaNames.map(function (name) {
|
||||
return name.replaceAll("-", "_");
|
||||
});
|
||||
|
||||
var Prefs = GObject.registerClass(
|
||||
{
|
||||
GTypeName: "Prefs",
|
||||
Template: Me.dir.get_child("preferences/Prefs.xml").get_uri(),
|
||||
InternalChildren: ["headerBar", "appList", ...settingIds],
|
||||
},
|
||||
class Prefs extends Gtk.Box {
|
||||
_init(params = {}) {
|
||||
super._init(params);
|
||||
|
||||
this._bindSettings(schemaNames);
|
||||
|
||||
this.connect("realize", () => {
|
||||
const window = this.get_root();
|
||||
window.set_titlebar(this._headerBar);
|
||||
});
|
||||
|
||||
let provider = new Gtk.CssProvider();
|
||||
provider.load_from_file(
|
||||
Gio.File.new_for_uri(
|
||||
Me.dir.get_child("preferences/Prefs.css").get_uri()
|
||||
)
|
||||
);
|
||||
Gtk.StyleContext.add_provider_for_display(
|
||||
Gdk.Display.get_default(),
|
||||
provider,
|
||||
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
|
||||
);
|
||||
|
||||
this._settings = getSettings();
|
||||
|
||||
this._changeId = this._settings.connect(
|
||||
"changed::applications",
|
||||
this._syncAppsRows.bind(this)
|
||||
);
|
||||
|
||||
this._syncAppsRows();
|
||||
}
|
||||
|
||||
showAppChooser() {
|
||||
const dialog = new AppChooser(this.get_root());
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
_syncAppsRows() {
|
||||
this._settings.block_signal_handler(this._changeId);
|
||||
|
||||
const oldApps = [...this._appList].filter((row) => !!row.appId);
|
||||
const newApps = JSON.parse(
|
||||
this._settings.get_string("applications")
|
||||
).filter((app) => !!app);
|
||||
|
||||
newApps.forEach((appInfo, index) => {
|
||||
if (!oldApps.some((row) => row.appId == appInfo.id)) {
|
||||
const appRow = new AppRow(appInfo);
|
||||
this._appList.insert(appRow, index);
|
||||
|
||||
if (this._notFirstSync) {
|
||||
appRow.toggleSettingsVisibility();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
oldApps.forEach((row, index) => {
|
||||
if (!newApps.some((app) => row.appId == app.id)) {
|
||||
this._appList.remove(row);
|
||||
}
|
||||
});
|
||||
|
||||
this._notFirstSync = true;
|
||||
|
||||
this._settings.unblock_signal_handler(this._changeId);
|
||||
}
|
||||
|
||||
_bindSettings(settings) {
|
||||
settings.forEach((name) => {
|
||||
let obj = eval("this._" + name.replaceAll("-", "_"));
|
||||
let valueType;
|
||||
|
||||
switch (obj.css_name) {
|
||||
case "combobox":
|
||||
valueType = "active-id";
|
||||
break;
|
||||
case "switch":
|
||||
valueType = "active";
|
||||
break;
|
||||
default:
|
||||
valueType = "value";
|
||||
}
|
||||
|
||||
getSettings().bind(name, obj, valueType, Gio.SettingsBindFlags.DEFAULT);
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,566 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkHeaderBar" id="headerBar">
|
||||
<property name="title-widget">
|
||||
<object class="GtkStackSwitcher">
|
||||
<property name="stack">stack</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
<template class="Prefs" parent="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkStack" id="stack">
|
||||
<property name="transition-type">slide-left-right</property>
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="title">General</property>
|
||||
<property name="child">
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="vscrollbar-policy">never</property>
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="width-request">630</property>
|
||||
<property name="margin-top">24</property>
|
||||
<property name="margin-bottom">24</property>
|
||||
<property name="margin-start">24</property>
|
||||
<property name="margin-end">24</property>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin-top">8</property>
|
||||
<property name="margin-bottom">8</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<property name="spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Tray position</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="tray_position">
|
||||
<property name="halign">end</property>
|
||||
<items>
|
||||
<item translatable="yes" id="left">Left</item>
|
||||
<item translatable="yes" id="center">Center</item>
|
||||
<item translatable="yes" id="right">Right</item>
|
||||
</items>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAdjustment" id="adjustment-position-weight">
|
||||
<property name="step-increment">1</property>
|
||||
<property name="lower">-99</property>
|
||||
<property name="upper">99</property>
|
||||
</object>
|
||||
<object class="GtkSpinButton" id="position_weight">
|
||||
<property name="tooltip-text" translatable="yes">Position weight</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="adjustment">adjustment-position-weight</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin-top">8</property>
|
||||
<property name="margin-bottom">8</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Tray icons limit</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAdjustment" id="adjustment-icons-limit">
|
||||
<property name="step-increment">1</property>
|
||||
<property name="lower">1</property>
|
||||
<property name="upper">16</property>
|
||||
</object>
|
||||
<object class="GtkSpinButton" id="icons_limit">
|
||||
<property name="halign">end</property>
|
||||
<property name="adjustment">adjustment-icons-limit</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin-top">8</property>
|
||||
<property name="margin-bottom">8</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Icon size</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAdjustment" id="adjustment-icon-size">
|
||||
<property name="step-increment">1</property>
|
||||
<property name="lower">16</property>
|
||||
<property name="upper">32</property>
|
||||
</object>
|
||||
<object class="GtkSpinButton" id="icon_size">
|
||||
<property name="halign">end</property>
|
||||
<property name="adjustment">adjustment-icon-size</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Colors</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin-top">24</property>
|
||||
<property name="margin-bottom">8</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin-top">8</property>
|
||||
<property name="margin-bottom">8</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Icon saturation</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAdjustment" id="adjustment-icon-saturation">
|
||||
<property name="step-increment">10</property>
|
||||
<property name="page-size">20</property>
|
||||
<property name="upper">100</property>
|
||||
</object>
|
||||
<object class="GtkSpinButton" id="icon_saturation">
|
||||
<property name="halign">end</property>
|
||||
<property name="adjustment">adjustment-icon-saturation</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin-top">8</property>
|
||||
<property name="margin-bottom">8</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Icon contrast</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAdjustment" id="adjustment-icon-contrast">
|
||||
<property name="step-increment">10</property>
|
||||
<property name="page-size">20</property>
|
||||
<property name="lower">-100</property>
|
||||
<property name="upper">100</property>
|
||||
</object>
|
||||
<object class="GtkSpinButton" id="icon_contrast">
|
||||
<property name="halign">end</property>
|
||||
<property name="adjustment">adjustment-icon-contrast</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin-top">8</property>
|
||||
<property name="margin-bottom">8</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Icon brightness</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAdjustment" id="adjustment-icon-brightness">
|
||||
<property name="step-increment">10</property>
|
||||
<property name="page-size">20</property>
|
||||
<property name="lower">-100</property>
|
||||
<property name="upper">100</property>
|
||||
</object>
|
||||
<object class="GtkSpinButton" id="icon_brightness">
|
||||
<property name="halign">end</property>
|
||||
<property name="adjustment">adjustment-icon-brightness</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Spacing</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin-top">24</property>
|
||||
<property name="margin-bottom">8</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin-top">8</property>
|
||||
<property name="margin-bottom">8</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<property name="spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Tray margin</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAdjustment" id="adjustment-tray-margin-left">
|
||||
<property name="step-increment">1</property>
|
||||
<property name="upper">24</property>
|
||||
</object>
|
||||
<object class="GtkSpinButton" id="tray_margin_left">
|
||||
<property name="halign">center</property>
|
||||
<property name="adjustment">adjustment-tray-margin-left</property>
|
||||
<property name="tooltip-text" translatable="yes">Left margin</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAdjustment" id="adjustment-tray-margin-right">
|
||||
<property name="step-increment">1</property>
|
||||
<property name="upper">24</property>
|
||||
</object>
|
||||
<object class="GtkSpinButton" id="tray_margin_right">
|
||||
<property name="halign">end</property>
|
||||
<property name="adjustment">adjustment-tray-margin-right</property>
|
||||
<property name="tooltip-text" translatable="yes">Right margin</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin-top">8</property>
|
||||
<property name="margin-bottom">8</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<property name="spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Icon margin</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAdjustment" id="adjustment-icon-margin-vertical">
|
||||
<property name="step-increment">1</property>
|
||||
<property name="upper">24</property>
|
||||
</object>
|
||||
<object class="GtkSpinButton" id="icon_margin_vertical">
|
||||
<property name="halign">center</property>
|
||||
<property name="adjustment">adjustment-icon-margin-vertical</property>
|
||||
<property name="tooltip-text" translatable="yes">Vertical icon margin. NOTE: May not update in real time</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAdjustment" id="adjustment-icon-margin-horizontal">
|
||||
<property name="step-increment">1</property>
|
||||
<property name="upper">24</property>
|
||||
</object>
|
||||
<object class="GtkSpinButton" id="icon_margin_horizontal">
|
||||
<property name="halign">end</property>
|
||||
<property name="adjustment">adjustment-icon-margin-horizontal</property>
|
||||
<property name="tooltip-text" translatable="yes">Horizontal icon margin</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin-top">8</property>
|
||||
<property name="margin-bottom">8</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<property name="spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Icon padding</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAdjustment" id="adjustment-icon-padding-vertical">
|
||||
<property name="step-increment">1</property>
|
||||
<property name="upper">24</property>
|
||||
</object>
|
||||
<object class="GtkSpinButton" id="icon_padding_vertical">
|
||||
<property name="valign">center</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="adjustment">adjustment-icon-padding-vertical</property>
|
||||
<property name="tooltip-text" translatable="yes">Vertical icon padding</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAdjustment" id="adjustment-icon-padding-horizontal">
|
||||
<property name="step-increment">1</property>
|
||||
<property name="upper">24</property>
|
||||
</object>
|
||||
<object class="GtkSpinButton" id="icon_padding_horizontal">
|
||||
<property name="tooltip-text" translatable="yes">Horizontal icon padding</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="adjustment">adjustment-icon-padding-horizontal</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Behavior</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin-top">24</property>
|
||||
<property name="margin-bottom">8</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin-top">8</property>
|
||||
<property name="margin-bottom">8</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Invoke windows to current workspace</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="invoke_to_workspace">
|
||||
<property name="halign">end</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin-top">8</property>
|
||||
<property name="margin-bottom">8</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Modify Wine apps behavior</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="wine_behavior">
|
||||
<property name="halign">end</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="margin-top">16</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="halign">center</property>
|
||||
<child>
|
||||
<object class="GtkLinkButton">
|
||||
<property name="label">GitHub</property>
|
||||
<property name="uri">https://github.com/MartinPL/Tray-Icons-Reloaded</property>
|
||||
<property name="halign">start</property>
|
||||
<layout>
|
||||
<property name="row">0</property>
|
||||
<property name="column">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLinkButton">
|
||||
<property name="label">Donate</property>
|
||||
<property name="uri">https://revolut.me/martinpl</property>
|
||||
<property name="halign">end</property>
|
||||
<layout>
|
||||
<property name="row">0</property>
|
||||
<property name="column">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="title">Applications</property>
|
||||
<property name="child">
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="propagate-natural-height">1</property>
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="width-request">630</property>
|
||||
<property name="margin-top">24</property>
|
||||
<property name="margin-bottom">24</property>
|
||||
<property name="margin-start">24</property>
|
||||
<property name="margin-end">24</property>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="child">
|
||||
<object class="GtkListBox" id="appList">
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="height-request">50</property>
|
||||
<property name="selectable">false</property>
|
||||
<property name="activatable">false</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="receives_default">True</property>
|
||||
<signal name="clicked" handler="showAppChooser" swapped="no" />
|
||||
<child>
|
||||
<object class="GtkImage" id="add-button">
|
||||
<property name="icon-name">list-add-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,8 @@
|
||||
const Me = imports.misc.extensionUtils.getCurrentExtension();
|
||||
const Prefs = Me.imports.preferences.Prefs.Prefs;
|
||||
|
||||
function buildPrefsWidget() {
|
||||
return new Prefs();
|
||||
}
|
||||
|
||||
function init() {}
|
||||
Binary file not shown.
@@ -0,0 +1,68 @@
|
||||
<schemalist>
|
||||
<schema id="org.gnome.shell.extensions.trayIconsReloaded" path="/org/gnome/shell/extensions/trayIconsReloaded/">
|
||||
<key name="tray-position" type="s">
|
||||
<default>"right"</default>
|
||||
<summary>Tray position</summary>
|
||||
</key>
|
||||
<key name="position-weight" type="i">
|
||||
<default>0</default>
|
||||
<summary>Position weight</summary>
|
||||
</key>
|
||||
<key name="tray-margin-left" type="i">
|
||||
<default>4</default>
|
||||
<summary>Tray icons left margin</summary>
|
||||
</key>
|
||||
<key name="tray-margin-right" type="i">
|
||||
<default>0</default>
|
||||
<summary>Tray icons left margin</summary>
|
||||
</key>
|
||||
<key name="icons-limit" type="i">
|
||||
<default>4</default>
|
||||
<summary>Icons limit</summary>
|
||||
</key>
|
||||
<key name="icon-size" type="i">
|
||||
<default>20</default>
|
||||
<summary>Icon size</summary>
|
||||
</key>
|
||||
<key name="icon-margin-vertical" type="i">
|
||||
<default>0</default>
|
||||
<summary>Icon margin vertical</summary>
|
||||
</key>
|
||||
<key name="icon-margin-horizontal" type="i">
|
||||
<default>4</default>
|
||||
<summary>Icon margin horizontal</summary>
|
||||
</key>
|
||||
<key name="icon-padding-vertical" type="i">
|
||||
<default>0</default>
|
||||
<summary>Icon padding vertical</summary>
|
||||
</key>
|
||||
<key name="icon-padding-horizontal" type="i">
|
||||
<default>16</default>
|
||||
<summary>Icon padding horizontal</summary>
|
||||
</key>
|
||||
<key name="icon-saturation" type="i">
|
||||
<default>0</default>
|
||||
<summary>Icon contrast</summary>
|
||||
</key>
|
||||
<key name="icon-contrast" type="i">
|
||||
<default>0</default>
|
||||
<summary>Icon contrast</summary>
|
||||
</key>
|
||||
<key name="icon-brightness" type="i">
|
||||
<default>0</default>
|
||||
<summary>Icon contrast</summary>
|
||||
</key>
|
||||
<key name="invoke-to-workspace" type="b">
|
||||
<default>true</default>
|
||||
<summary>Whether to invoke window to current workspace</summary>
|
||||
</key>
|
||||
<key name="wine-behavior" type="b">
|
||||
<default>true</default>
|
||||
<summary>Wine behavior</summary>
|
||||
</key>
|
||||
<key name="applications" type="s">
|
||||
<default>"[]"</default>
|
||||
<summary>Applications list</summary>
|
||||
</key>
|
||||
</schema>
|
||||
</schemalist>
|
||||
@@ -0,0 +1,11 @@
|
||||
.TrayIndicatorPopup StButton {
|
||||
padding: 8px;
|
||||
border-radius: 6px;
|
||||
transition-property: background-color;
|
||||
transition-duration: 0.1s;
|
||||
transition-timing-function: linear;
|
||||
}
|
||||
|
||||
.TrayIndicatorPopup StButton:hover {
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
Reference in New Issue
Block a user