[Launcher] fzf, cmd processing, args
This commit is contained in:
parent
c0e9062230
commit
666a047814
@ -7,4 +7,13 @@ App.start({
|
|||||||
main() {
|
main() {
|
||||||
App.get_monitors().map(Bar)
|
App.get_monitors().map(Bar)
|
||||||
},
|
},
|
||||||
|
requestHandler(request, res) {
|
||||||
|
if ( request === 'open' ) {
|
||||||
|
res( 'ok' );
|
||||||
|
} else if ( request === 'close' ) {
|
||||||
|
res( 'ok' );
|
||||||
|
} else if ( request === 'toggle' ) {
|
||||||
|
res( 'ok' );
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* dotfiles - fzf.ts
|
||||||
|
*
|
||||||
|
* Created by Janis Hutz 03/30/2025, Licensed under the GPL V3 License
|
||||||
|
* https://janishutz.com, development@janishutz.com
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
import AstalApps from "gi://AstalApps?version=0.1"
|
||||||
|
|
||||||
|
// TODO: For all astal apps, read a global colours config file
|
||||||
|
const fzfApplication = ( query: string ) => {
|
||||||
|
const apps = new AstalApps.Apps()
|
||||||
|
return apps.fuzzy_query( query );
|
||||||
|
}
|
||||||
|
|
||||||
|
const fzfCmd = ( query: string ) => {}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
fzfApplication
|
||||||
|
}
|
@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import subprocessRunner from "./subprocessRunner";
|
import subprocessRunner from "./subprocessRunner";
|
||||||
|
import fzf from "./fzf";
|
||||||
|
|
||||||
const preprocess = ( input: string ) => {
|
const preprocess = ( input: string ) => {
|
||||||
// Find out what kind of instruction to process
|
// Find out what kind of instruction to process
|
||||||
@ -19,8 +20,11 @@ const preprocess = ( input: string ) => {
|
|||||||
// Determine if entered string is calculation or not
|
// Determine if entered string is calculation or not
|
||||||
// We can easily do that by asking qalc (qalculate cli) if this is fine
|
// We can easily do that by asking qalc (qalculate cli) if this is fine
|
||||||
subprocessRunner.executeCommand( 'qalc "' + input + '"' ).then( out => {
|
subprocessRunner.executeCommand( 'qalc "' + input + '"' ).then( out => {
|
||||||
|
// we get a calculation result here
|
||||||
print( out );
|
print( out );
|
||||||
|
processCalculation( out );
|
||||||
} ).catch( err => {
|
} ).catch( err => {
|
||||||
|
processSearch( input );
|
||||||
print( err );
|
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 ) => {
|
const processBang = ( bang: string, input: string ) => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
preprocess
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user