@@ -6,7 +6,7 @@ import { RevealerTransitionMap } from 'src/lib/constants/options.js';
6
6
import { App , Gtk } from 'astal/gtk3' ;
7
7
import Separator from 'src/components/shared/Separator.js' ;
8
8
import AstalApps from 'gi://AstalApps?version=0.1'
9
- import { icon , launchApp } from 'src/lib/utils.js' ;
9
+ import { bash , icon } from 'src/lib/utils.js' ;
10
10
import { Entry , EntryProps , Scrollable } from 'astal/gtk3/widget' ;
11
11
12
12
import PopupWindow from '../shared/popup/index.js' ;
@@ -24,9 +24,19 @@ interface ApplicationItemProps {
24
24
onLaunched ?: ( ) => void ;
25
25
}
26
26
27
+ function launch ( app : AstalApps . Application ) : void {
28
+ const exe = app . executable
29
+ . split ( / \s + / )
30
+ . filter ( ( str ) => ! str . startsWith ( '%' ) && ! str . startsWith ( '@' ) )
31
+ . join ( ' ' ) ;
32
+
33
+ bash ( `hyprctl dispatch exec ${ exe } ` ) ;
34
+ app . frequency += 1 ;
35
+ }
36
+
27
37
const ApplicationItem = ( { app, onLaunched } : ApplicationItemProps ) : JSX . Element => {
28
38
return (
29
- < button className = "notification-card" halign = { Gtk . Align . FILL } valign = { Gtk . Align . START } onClick = { ( ) => { launchApp ( app ) ; onLaunched ?.( ) } } >
39
+ < button className = "notification-card" halign = { Gtk . Align . FILL } valign = { Gtk . Align . START } onClick = { ( ) => { launch ( app ) ; onLaunched ?.( ) } } >
30
40
< box spacing = { 5 } >
31
41
< icon className = "notification-card-image icon" margin = { 5 } halign = { Gtk . Align . CENTER } valign = { Gtk . Align . CENTER } vexpand = { false } icon = { icon ( app . iconName ) } />
32
42
< label halign = { Gtk . Align . START } valign = { Gtk . Align . CENTER } label = { app . name } hexpand vexpand truncate wrap />
@@ -93,7 +103,7 @@ const ApplicationLauncher = ({ visible, onLaunched }: ApplicationLauncherProps):
93
103
const onFilterReturn = ( ) => {
94
104
const first = list . get ( ) [ 0 ]
95
105
if ( ! first ) return ;
96
- launchApp ( first )
106
+ launch ( first ) ;
97
107
onLaunched ?.( )
98
108
}
99
109
0 commit comments