Skip to content

Commit

Permalink
1. Bump version to 38 2. Support Gnome Shell 44
Browse files Browse the repository at this point in the history
  • Loading branch information
nlpsuge committed Apr 8, 2023
1 parent 1e98ba0 commit 8e6a31c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,16 @@ sudo dnf install ydotool

#Check the permission of `/dev/uinput`, if it's `crw-rw----+`, you can skip step 2
# 2. Get permission to access to `/dev/uinput` as the normal user
sudo touch /etc/udev/rules.d/60-awsm-ydotool-uinput.
sudo touch /etc/udev/rules.d/60-awsm-ydotool-uinput.rules
# Here we use `tee`, not redirect(>), to avoid `warning: An error occurred while redirecting file '/etc/udev/rules.d/60-awsm-ydotool-uinput.rules' open: Permission denied`
# See: https://www.shellhacks.com/sudo-echo-to-file-permission-denied/
echo '# See:
# https://github.com/ValveSoftware/steam-devices/blob/master/60-steam-input.rules
# https://github.com/ReimuNotMoe/ydotool/issues/25
# https://github.com/ValveSoftware/steam-devices/blob/master/60-steam-input.rules
# https://github.com/ReimuNotMoe/ydotool/issues/25
# ydotool udev write access
KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess", OPTIONS+="static_node=uinput"' | sudo tee --append /etc/udev/rules.d/60-awsm-ydotool-uinput.rules

# ydotool udev write access
KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess", OPTIONS+="static_node=uinput"' | sudo tee --append /etc/udev/rules.d/60-awsm-ydotool-uinput.rules
cat /etc/udev/rules.d/60-awsm-ydotool-uinput.rules
#Remove executable permission (a.k.a. x)
sudo chmod 644 /etc/udev/rules.d/60-awsm-ydotool-uinput.rules
Expand Down
5 changes: 3 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"40",
"41",
"42",
"43"
"43",
"44"
],
"url": "https://github.com/nlpsuge/gnome-shell-extension-another-window-session-manager",
"uuid": "[email protected]",
"version": 37
"version": 38
}
20 changes: 3 additions & 17 deletions prefsCloseWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,12 +541,7 @@ const RuleRow = GObject.registerClass({

const frame = new Gtk.Frame();
frame.set_child(box);
const cssProvider = new Gtk.CssProvider();
cssProvider.load_from_data(
"frame { border-style: dashed; }");
frame.get_style_context().add_provider(cssProvider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);

PrefsWidgets.updateStyle(frame, 'frame { border-style: dashed; }');
parentWidget.append(frame);
}

Expand Down Expand Up @@ -788,11 +783,7 @@ const RuleRowByApp = GObject.registerClass({
});
label.set_tooltip_text(displayName);
if (!appInfo) {
const cssProvider = new Gtk.CssProvider();
cssProvider.load_from_data(
"label { color: red; }");
label.get_style_context().add_provider(cssProvider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
PrefsWidgets.updateStyle(label, 'label { color: red; }');
}
this.boxLeft.insert_child_after(label, icon);

Expand Down Expand Up @@ -880,10 +871,6 @@ const RuleRowByKeyword = GObject.registerClass({
_init(ruleDetail) {
super._init(ruleDetail);

const icon = new Gtk.Image({
gicon: IconFinder.find('empty-symbolic.svg'),
pixel_size: 32,
});
const compareWithDropDown = this._newCompareWithDropDown();
const methodDropDown = this._newMethodDropDown();
const pickableEntry = new PrefsWindowPickableEntry.WindowPickableEntry({
Expand All @@ -898,8 +885,7 @@ const RuleRowByKeyword = GObject.registerClass({
this._compareWithDropDown = compareWithDropDown;
this._methodDropDown = methodDropDown;

this.boxLeft.insert_child_after(icon, this._enabledCheckButton);
this.boxLeft.insert_child_after(compareWithDropDown, icon);
this.boxLeft.insert_child_after(compareWithDropDown, this._enabledCheckButton);
this.boxLeft.insert_child_after(methodDropDown, compareWithDropDown);
this.boxLeft.insert_child_after(pickableEntry, methodDropDown);

Expand Down
12 changes: 11 additions & 1 deletion prefsWidgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

const { Gtk, GLib, GObject } = imports.gi;

const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();

const GnomeVersion = Me.imports.utils.gnomeVersion;


var boxProperties = {
spacing: 0,
margin_start: 6,
Expand Down Expand Up @@ -43,7 +49,11 @@ var newLabelSwitch = function(text, tooltipText, active) {

var updateStyle = function(widget, css) {
const cssProvider = new Gtk.CssProvider();
cssProvider.load_from_data(css);
if (GnomeVersion.isLessThan44()) {
cssProvider.load_from_data(css);
} else {
cssProvider.load_from_data(css, -1);
}
widget.get_style_context().add_provider(cssProvider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
}

Expand Down
8 changes: 5 additions & 3 deletions utils/gnomeVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ const Config = imports.misc.config;
const GNOME_VERSION = parseFloat(Config.PACKAGE_VERSION);


function isLessThan42() {
return GNOME_VERSION < 42;
function isLessThan44() {
return GNOME_VERSION < 44;
}

function isLessThan43() {
return GNOME_VERSION < 43;
}


function isLessThan42() {
return GNOME_VERSION < 42;
}

0 comments on commit 8e6a31c

Please sign in to comment.