Replaced the underlying structure of Hypridle inhibitor to the Astal Idle Inhibitor module. (#776)
* Update hypridle module to be an all-purpose idle inhibitor module using Astal inhibiting. * Fix types and module code. * Update note * Removed lingering comment. * Remove hypridle from dependencies.
This commit is contained in:
@@ -71,6 +71,44 @@ export const utilityCommands: Command[] = [
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'isInhibiting',
|
||||
aliases: ['isi'],
|
||||
description: 'Returns the status of the Idle Inhibitor.',
|
||||
category: 'Utility',
|
||||
args: [],
|
||||
handler: (): boolean => {
|
||||
try {
|
||||
return idleInhibit.get();
|
||||
} catch (error) {
|
||||
errorHandler(error);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'idleInhibit',
|
||||
aliases: ['idi'],
|
||||
description: 'Enables/Disables the Idle Inhibitor. Toggles the Inhibitor if no parameter is provided.',
|
||||
category: 'Utility',
|
||||
args: [
|
||||
{
|
||||
name: 'shouldInhibit',
|
||||
description: 'The boolean value that enables/disables the inhibitor.',
|
||||
type: 'boolean',
|
||||
required: false,
|
||||
},
|
||||
],
|
||||
handler: (args: Record<string, unknown>): boolean => {
|
||||
try {
|
||||
const shouldInhibit = args['shouldInhibit'] ?? !idleInhibit.get();
|
||||
idleInhibit.set(Boolean(shouldInhibit));
|
||||
|
||||
return idleInhibit.get();
|
||||
} catch (error) {
|
||||
errorHandler(error);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'migrateConfig',
|
||||
aliases: ['mcfg'],
|
||||
|
||||
Reference in New Issue
Block a user