Skip to content

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
  • Loading branch information
nlpsuge committed Apr 8, 2023
1 parent 4311cdb commit a609813
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +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.rules
sudo echo '# See:
# 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"' > /etc/udev/rules.d/60-awsm-ydotool-uinput.rules
sudo touch /etc/udev/rules.d/60-awsm-ydotool-uinput.
# 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
# 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
4 changes: 3 additions & 1 deletion closeSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,9 @@ var CloseSession = class {
Log.Log.getDefault().debug(`Finished to start ydotool.service. Started: ${started}`);
resolve(started);
} catch (error) {
Log.Log.getDefault().error(error, 'Failed to start ydotool.service');
const msg = 'Failed to start ydotool.service';
Log.Log.getDefault().error(error, msg);
global.notify_error(`${msg}`, `${error ? error.message : ''}`);
reject(false);
}
});
Expand Down
8 changes: 4 additions & 4 deletions prefsCloseWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ var UICloseWindows = GObject.registerClass(
enabled: false,
method: 'equals',
compareWith: 'wm_class',
enableWhenCloseWindows: false,
enableWhenLogout: false,
enableWhenCloseWindows: true,
enableWhenLogout: true,
});

let oldWhitelist = JSON.parse(oldCloseWindowsWhitelist);
Expand Down Expand Up @@ -167,8 +167,8 @@ var UICloseWindows = GObject.registerClass(
value: {},
enabled: false,
keyDelay: 0,
compareWith: 'title',
method: 'includes'
compareWith: 'wm_class',
method: 'equals'
});

let oldCloseWindowsRulesObj = JSON.parse(oldCloseWindowsRules);
Expand Down

0 comments on commit a609813

Please sign in to comment.