diff --git a/.config/ags/widgets/overview/searchbuttons.js b/.config/ags/widgets/overview/searchbuttons.js index 475cbaf9..bd43ca81 100644 --- a/.config/ags/widgets/overview/searchbuttons.js +++ b/.config/ags/widgets/overview/searchbuttons.js @@ -4,7 +4,7 @@ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; const { execAsync, exec } = Utils; import { searchItem } from './searchitem.js'; -import { execAndClose, startsWithNumber, launchCustomCommand } from './miscfunctions.js'; +import { execAndClose, couldBeMath, launchCustomCommand } from './miscfunctions.js'; export const DirectoryButton = ({ parentPath, name, type, icon }) => { const actionText = Widget.Revealer({ diff --git a/.config/ags/widgets/overview/windowcontent.js b/.config/ags/widgets/overview/windowcontent.js index f10dd784..e61250f5 100644 --- a/.config/ags/widgets/overview/windowcontent.js +++ b/.config/ags/widgets/overview/windowcontent.js @@ -5,7 +5,7 @@ import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import Applications from 'resource:///com/github/Aylur/ags/service/applications.js'; const { execAsync, exec } = Utils; -import { execAndClose, expandTilde, hasUnterminatedBackslash, startsWithNumber, launchCustomCommand, ls } from './miscfunctions.js'; +import { execAndClose, expandTilde, hasUnterminatedBackslash, couldBeMath, launchCustomCommand, ls } from './miscfunctions.js'; import { CalculationResultButton, CustomCommandButton, DirectoryButton, DesktopEntryButton, ExecuteCommandButton, SearchButton @@ -104,7 +104,7 @@ export const SearchAndWindows = () => { const isAction = text.startsWith('>'); const isDir = (['/', '~'].includes(entry.text[0])); - if (startsWithNumber(text)) { // Eval on typing is dangerous, this is a workaround + if (couldBeMath(text)) { // Eval on typing is dangerous, this is a workaround try { const fullResult = eval(text); // copy @@ -166,7 +166,7 @@ export const SearchAndWindows = () => { _appSearchResults = Applications.query(text); // Calculate - if (startsWithNumber(text)) { // Eval on typing is dangerous; this is a small workaround. + if (couldBeMath(text)) { // Eval on typing is dangerous; this is a small workaround. try { const fullResult = eval(text); resultsBox.add(CalculationResultButton({ result: fullResult, text: text }));