user options: add search engine url

This commit is contained in:
end-4
2024-03-02 10:47:23 +07:00
parent 8ec23c9966
commit a546a32d79
3 changed files with 4 additions and 3 deletions
@@ -153,11 +153,11 @@ export const CustomCommandButton = ({ text = '' }) => searchItem({
export const SearchButton = ({ text = '' }) => searchItem({ export const SearchButton = ({ text = '' }) => searchItem({
materialIconName: 'travel_explore', materialIconName: 'travel_explore',
name: 'Search Google', name: 'Search the web',
actionName: 'Go', actionName: 'Go',
content: `${text}`, content: `${text}`,
onActivate: () => { onActivate: () => {
App.closeWindow('overview'); App.closeWindow('overview');
execAsync(['bash', '-c', `xdg-open 'https://www.google.com/search?q=${text} ${['', ...userOptions.search.excludedSites].join(' -site:')}' &`]).catch(print); execAsync(['bash', '-c', `xdg-open '${userOptions.search.engineBaseUrl}${text} ${['', ...userOptions.search.excludedSites].join(' -site:')}' &`]).catch(print);
}, },
}); });
@@ -140,7 +140,7 @@ export const SearchAndWindows = () => {
else { else {
App.closeWindow('overview'); App.closeWindow('overview');
execAsync(['bash', '-c', `xdg-open 'https://www.google.com/search?q=${text} ${['', ...userOptions.search.excludedSites].join(' -site:')}' &`]).catch(print); execAsync(['bash', '-c', `xdg-open '${userOptions.search.engineBaseUrl}${text} ${['', ...userOptions.search.excludedSites].join(' -site:')}' &`]).catch(print);
} }
}, },
onChange: (entry) => { // this is when you type onChange: (entry) => { // this is when you type
+1
View File
@@ -26,6 +26,7 @@ let userConfigOptions = {
'wsNumMarginScale': 0.07, 'wsNumMarginScale': 0.07,
}, },
'search': { 'search': {
'engineBaseUrl': 'https://www.google.com/search?q=',
'excludedSites': ['quora.com'], 'excludedSites': ['quora.com'],
}, },
'weather': { 'weather': {