forked from Shinonome/dots-hyprland
raw input: input:accel_profile instead of input:force_no_accel, as advised by hl wiki
This commit is contained in:
@@ -13,7 +13,16 @@ export function hasUnterminatedBackslash(inputString) {
|
|||||||
export function launchCustomCommand(command) {
|
export function launchCustomCommand(command) {
|
||||||
const args = command.split(' ');
|
const args = command.split(' ');
|
||||||
if (args[0] == '>raw') { // Mouse raw input
|
if (args[0] == '>raw') { // Mouse raw input
|
||||||
execAsync([`bash`, `-c`, `hyprctl keyword input:force_no_accel $(( 1 - $(hyprctl getoption input:force_no_accel -j | gojq ".int") ))`, `&`]).catch(print);
|
Utils.execAsync('hyprctl -j getoption input:accel_profile')
|
||||||
|
.then((output) => {
|
||||||
|
const value = JSON.parse(output)["str"].trim();
|
||||||
|
if (value != "[[EMPTY]]" && value != "") {
|
||||||
|
execAsync(['bash', '-c', `hyprctl keyword input:accel_profile '[[EMPTY]]'`]).catch(print);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
execAsync(['bash', '-c', `hyprctl keyword input:accel_profile flat`]).catch(print);
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
else if (args[0] == '>img') { // Change wallpaper
|
else if (args[0] == '>img') { // Change wallpaper
|
||||||
execAsync([`bash`, `-c`, `${App.configDir}/scripts/color_generation/switchwall.sh`, `&`]).catch(print);
|
execAsync([`bash`, `-c`, `${App.configDir}/scripts/color_generation/switchwall.sh`, `&`]).catch(print);
|
||||||
|
|||||||
@@ -130,6 +130,36 @@ export const ModuleInvertColors = async (props = {}) => {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const ModuleRawInput = async (props = {}) => {
|
||||||
|
try {
|
||||||
|
const Hyprland = (await import('resource:///com/github/Aylur/ags/service/hyprland.js')).default;
|
||||||
|
return Widget.Button({
|
||||||
|
className: 'txt-small sidebar-iconbutton',
|
||||||
|
tooltipText: 'Raw input',
|
||||||
|
onClicked: (button) => {
|
||||||
|
Hyprland.messageAsync('j/getoption input:accel_profile')
|
||||||
|
.then((output) => {
|
||||||
|
const value = JSON.parse(output)["str"].trim();
|
||||||
|
if (value != "[[EMPTY]]" && value != "") {
|
||||||
|
execAsync(['bash', '-c', `hyprctl keyword input:accel_profile '[[EMPTY]]'`]).catch(print);
|
||||||
|
button.toggleClassName('sidebar-button-active', false);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Hyprland.messageAsync(`j/keyword input:accel_profile flat`)
|
||||||
|
.catch(print);
|
||||||
|
button.toggleClassName('sidebar-button-active', true);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
child: MaterialIcon('mouse', 'norm'),
|
||||||
|
setup: setupCursorHover,
|
||||||
|
...props,
|
||||||
|
})
|
||||||
|
} catch {
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export const ModuleIdleInhibitor = (props = {}) => Widget.Button({ // TODO: Make this work
|
export const ModuleIdleInhibitor = (props = {}) => Widget.Button({ // TODO: Make this work
|
||||||
attribute: {
|
attribute: {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ import {
|
|||||||
ModuleEditIcon,
|
ModuleEditIcon,
|
||||||
ModuleReloadIcon,
|
ModuleReloadIcon,
|
||||||
ModuleSettingsIcon,
|
ModuleSettingsIcon,
|
||||||
ModulePowerIcon
|
ModulePowerIcon,
|
||||||
|
ModuleRawInput
|
||||||
} from "./quicktoggles.js";
|
} from "./quicktoggles.js";
|
||||||
import ModuleNotificationList from "./notificationlist.js";
|
import ModuleNotificationList from "./notificationlist.js";
|
||||||
import { ModuleCalendar } from "./calendar.js";
|
import { ModuleCalendar } from "./calendar.js";
|
||||||
@@ -51,7 +52,7 @@ const togglesBox = Widget.Box({
|
|||||||
children: [
|
children: [
|
||||||
ToggleIconWifi(),
|
ToggleIconWifi(),
|
||||||
ToggleIconBluetooth(),
|
ToggleIconBluetooth(),
|
||||||
await HyprToggleIcon('mouse', 'Raw input', 'input:force_no_accel', {}),
|
await ModuleRawInput(),
|
||||||
await HyprToggleIcon('front_hand', 'No touchpad while typing', 'input:touchpad:disable_while_typing', {}),
|
await HyprToggleIcon('front_hand', 'No touchpad while typing', 'input:touchpad:disable_while_typing', {}),
|
||||||
ModuleNightLight(),
|
ModuleNightLight(),
|
||||||
await ModuleInvertColors(),
|
await ModuleInvertColors(),
|
||||||
|
|||||||
Reference in New Issue
Block a user