[Launcher] fzf, cmd processing, args

This commit is contained in:
2025-03-30 08:00:10 +02:00
parent c0e9062230
commit 666a047814
3 changed files with 40 additions and 1 deletions

View File

@@ -8,6 +8,7 @@
*/
import subprocessRunner from "./subprocessRunner";
import fzf from "./fzf";
const preprocess = ( input: string ) => {
// Find out what kind of instruction to process
@@ -19,8 +20,11 @@ const preprocess = ( input: string ) => {
// Determine if entered string is calculation or not
// We can easily do that by asking qalc (qalculate cli) if this is fine
subprocessRunner.executeCommand( 'qalc "' + input + '"' ).then( out => {
// we get a calculation result here
print( out );
processCalculation( out );
} ).catch( err => {
processSearch( input );
print( err );
} );
}
@@ -30,7 +34,7 @@ const processSearch = ( input: string ) => {
}
const processCalculation = ( input: string ) => {
const processCalculation = ( output: string ) => {
}
@@ -41,3 +45,7 @@ const processCommand = ( cmd: string, args: string[] ) => {
const processBang = ( bang: string, input: string ) => {
}
export default {
preprocess
}