* Eslint updates * linter fixes * Type fixes * More type fixes * Fix isvis * More type fixes * Type Fixes * Consolidate logic to manage options * Linter fixes * Package lock update * Update configs * Version checker * Debug pipeline * Package lock update * Update ci * Strict check * Revert ci * Eslint * Remove rule since it causes issues in CI * Actual matugen fix
41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
import options from 'src/options';
|
|
import { Module } from '../../shared/Module';
|
|
import { inputHandler } from 'src/components/bar/utils/helpers';
|
|
import { bind, Variable } from 'astal';
|
|
import { Astal } from 'astal/gtk3';
|
|
import { BarBoxChild } from 'src/lib/types/bar.types';
|
|
|
|
const { icon, leftClick, rightClick, middleClick, scrollUp, scrollDown } = options.bar.customModules.power;
|
|
|
|
export const Power = (): BarBoxChild => {
|
|
const powerModule = Module({
|
|
tooltipText: 'Power Menu',
|
|
textIcon: bind(icon),
|
|
showLabelBinding: bind(Variable(false)),
|
|
boxClass: 'powermodule',
|
|
props: {
|
|
setup: (self: Astal.Button) => {
|
|
inputHandler(self, {
|
|
onPrimaryClick: {
|
|
cmd: leftClick,
|
|
},
|
|
onSecondaryClick: {
|
|
cmd: rightClick,
|
|
},
|
|
onMiddleClick: {
|
|
cmd: middleClick,
|
|
},
|
|
onScrollUp: {
|
|
cmd: scrollUp,
|
|
},
|
|
onScrollDown: {
|
|
cmd: scrollDown,
|
|
},
|
|
});
|
|
},
|
|
},
|
|
});
|
|
|
|
return powerModule;
|
|
};
|