Skip to content

Commit 7225635

Browse files
authored
feat: linux support for application search (#330)
* feat: linux support for application search * docs: update changelog
1 parent ecc5757 commit 7225635

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

docs/content.en/docs/release-notes/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Information about release notes of Coco Server is provided here.
1313

1414
### Features
1515

16+
- Linux support for application search #330
17+
1618
### Bug fix
1719

1820
### Improvements

src-tauri/src/local/application.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,21 @@ impl ApplicationSearchSource {
3535
continue;
3636
}
3737

38-
let path = if cfg!(target_os = "macos") {
39-
app.app_desktop_path.clone()
40-
} else {
38+
let path = if cfg!(target_os = "windows") {
4139
app.app_path_exe
4240
.clone()
4341
.unwrap_or(PathBuf::from("Path not found"))
42+
} else {
43+
app.app_desktop_path.clone()
4444
};
4545
let search_word = name(path.clone()).await;
46-
let icon = icon(app_handle.clone(), path.clone(), Some(256))
47-
.await
48-
.map_err(|err| err.to_string())?;
46+
let icon = if cfg!(target_os = "linux") {
47+
app.icon_path.clone().unwrap_or(PathBuf::from(""))
48+
} else {
49+
icon(app_handle.clone(), path.clone(), Some(256))
50+
.await
51+
.map_err(|err| err.to_string())?
52+
};
4953
let path_string = path.to_string_lossy().into_owned();
5054

5155
if search_word.is_empty() || search_word.eq("coco-ai") {

src/components/Search/ContextMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ const ContextMenu = ({ hideCoco }: ContextMenuProps) => {
144144
<div
145145
ref={containerRef}
146146
className={clsx(
147-
"fixed bottom-[40px] right-[8px] min-w-[280px] scale-0 transition origin-bottom-right text-sm p-1 bg-white dark:bg-[#202126] rounded-lg shadow-xs border border-gray-200 dark:border-gray-700",
147+
"absolute bottom-[40px] right-[8px] min-w-[280px] scale-0 transition origin-bottom-right text-sm p-1 bg-white dark:bg-[#202126] rounded-lg shadow-xs border border-gray-200 dark:border-gray-700",
148148
{
149149
"!scale-100": visibleContextMenu,
150150
}

0 commit comments

Comments
 (0)