fix some toggles; format

This commit is contained in:
end-4
2024-04-15 23:55:57 +07:00
parent c1d65beb42
commit f173fbb7ad
3 changed files with 5 additions and 8 deletions
@@ -72,7 +72,7 @@ const KeyboardControls = () => Box({
className: 'osk-control-button txt-norm icon-material', className: 'osk-control-button txt-norm icon-material',
onClicked: () => { onClicked: () => {
releaseAllKeys(); releaseAllKeys();
App.toggleWindow('osk'); App.toggleWindowOnAllMonitors('osk');
}, },
label: 'keyboard_hide', label: 'keyboard_hide',
}), }),
@@ -39,12 +39,9 @@ function substituteLang(str) {
{ from: 'javascript', to: 'js' }, { from: 'javascript', to: 'js' },
{ from: 'bash', to: 'sh' }, { from: 'bash', to: 'sh' },
]; ];
for (const { from, to } of subs) { for (const { from, to } of subs) {
if (from === str) if (from === str) return to;
return to;
} }
return str; return str;
} }
@@ -186,7 +186,7 @@ export const ModuleEditIcon = (props = {}) => Widget.Button({ // TODO: Make this
className: 'txt-small sidebar-iconbutton', className: 'txt-small sidebar-iconbutton',
onClicked: () => { onClicked: () => {
execAsync(['bash', '-c', 'XDG_CURRENT_DESKTOP="gnome" gnome-control-center', '&']); execAsync(['bash', '-c', 'XDG_CURRENT_DESKTOP="gnome" gnome-control-center', '&']);
App.toggleWindow('sideright'); App.closeWindow('sideright');
}, },
child: MaterialIcon('edit', 'norm'), child: MaterialIcon('edit', 'norm'),
setup: button => { setup: button => {
@@ -200,7 +200,7 @@ export const ModuleReloadIcon = (props = {}) => Widget.Button({
tooltipText: 'Reload Environment config', tooltipText: 'Reload Environment config',
onClicked: () => { onClicked: () => {
execAsync(['bash', '-c', 'hyprctl reload || swaymsg reload &']); execAsync(['bash', '-c', 'hyprctl reload || swaymsg reload &']);
App.toggleWindow('sideright'); App.closeWindow('sideright');
}, },
child: MaterialIcon('refresh', 'norm'), child: MaterialIcon('refresh', 'norm'),
setup: button => { setup: button => {
@@ -214,7 +214,7 @@ export const ModuleSettingsIcon = (props = {}) => Widget.Button({
tooltipText: 'Open Settings', tooltipText: 'Open Settings',
onClicked: () => { onClicked: () => {
execAsync(['bash', '-c', `${userOptions.apps.settings}`, '&']); execAsync(['bash', '-c', `${userOptions.apps.settings}`, '&']);
App.toggleWindow('sideright'); App.closeWindow('sideright');
}, },
child: MaterialIcon('settings', 'norm'), child: MaterialIcon('settings', 'norm'),
setup: button => { setup: button => {