mdgaziur / findex Goto Github PK
View Code? Open in Web Editor NEWFindex is a highly customizable application finder written in Rust and uses GTK3
License: GNU General Public License v3.0
Findex is a highly customizable application finder written in Rust and uses GTK3
License: GNU General Public License v3.0
Findex will be rewritten to support stuff like background process keeping information about .desktop
files, custom search backends.
Here's a list of what will be done:
All of the development will be done in Merged rewrite
branch.rewrite
with development
.
I'll update the issue to notify about the rewrite progress.
Findex utilize a core at 100% when it runs
Details about your installation process.
lanch findex and check htop
not use 100% of a cpu core when not utilized
If applicable, add screenshots to help explain your problem.
rustc --version --verbose
(if you compiled findex on your machine):rustc 1.66.0 (69f9c33d7 2022-12-12)
binary: rustc
commit-hash: 69f9c33d71c871fc16ac445211281c6e7a340943
commit-date: 2022-12-12
host: x86_64-unknown-linux-gnu
release: 1.66.0
LLVM version: 15.0.2
no logs
I am on Wayland using sway.
I trigger findex with this command echo "" > $HOME/.config/findex/toggle_file
and I have set the keybind trigger to an empty string.
I tried to get some info about which function ran with cargo flamegraph but since I know nothing about gtk/findex internals it didn't help me.
If you need the flamegraph I'll be happy to send it
Is your feature request related to a problem? Please describe.
I don't know if what I'm experiencing is a bug, but the findex with the default style.css doesn't look anything like the one in the README.
Describe the solution you'd like
Add more themes to style Findex
Tried to install using installer.sh. Repeatedly, resulted in two errors. First was that config directory wasn't created. After I created one manually, the installer made it past that error.
However, then failed at the stage where ld is gathering items. ld was unable to find keybinder-3.0("note: /usr/bin/ld: cannot find -lkeybinder-3.0"), which I believe is actually one of the following:
/usr/lib64/libkeybinder-3.0.so.0.0.0
/usr/lib64/libkeybinder-3.0.so.0
/usr/lib64/girepository-1.0/Keybinder-3.0.typelib
probably the last, in Fedora 38.
rustc --version --verbose
:rustc 1.76.0 (07dca489a 2024-02-04)
binary: rustc
commit-hash: 07dca489ac2d933c78d3c5158e3f43beefeb02ce
commit-date: 2024-02-04
host: x86_64-unknown-linux-gnu
release: 1.76.0
LLVM version: 17.0.6
.findex-logs doesn't exist.
Hi,
The current version installed using aur fails to boot under systemd:
systemd[1187]: Started Findex.
findex[14968]: [ERROR] Only X11 is supported
systemd[1187]: findex.service: Main process exited, code=exited, status=1/FAILURE
systemd[1187]: findex.service: Failed with result 'exit-code'.
systemd[1187]: Stopped Findex.
The program works fine when ran manually or added to session startup.
Trying to add fuzzy search into this application. Currently I am trying to use fuse-rust.
Trying with default values. Any suggestions for getting better results?
Reason is here:
Lines 132 to 134 in e19403b
(unwrapping empty extension)
I'd suggest using something like walkdir
or jwalk
for easy iteration over looked for .desktop
entries.
Quick fix can be (checked with Rust 1.56):
if app_path.extension().unwrap_or_default() != "desktop" {
continue;
}
(sorry, too late right now to make a PR)
Hey! Running findex on terminal does nothing for me. The process keeps on running, no errors are diplayed, no windows pop up. I tried bare and ls | findex. (I've copied style.css to .config/findex)
I'd like to check it out and see what this is about. I'm using arch + xmonad. What am I missing?
It is not a problem about keymap collision. I have tried other key bindings in both side and the problem is still unsolved.
$ paru -S findex-bin
I should be switched successfully.
0.7.2
4.9.5
findex-deamon.log
[WARN] Inotify error: Resource temporarily unavailable (os error 11)
....(Many same errors)
[WARN] Inotify error: Resource temporarily unavailable (os error 11)
[WARN] Inotify error: Resource temporarily unavailable (os error 11)
[WARN] Inotify error: Resource temporarily unavailable (os error 11)
[WARN] Inotify error: Resource temporarily unavailable (os error 11)
(pot:2812): Gdk-CRITICAL **: 09:30:10.389: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
[WARN] Inotify error: Resource temporarily unavailable (os error 11)
[WARN] Inotify error: Resource temporarily unavailable (os error 11)
....(Many same errors)
[WARN] Inotify error: Resource temporarily unavailable (os error 11)
I run Arch personally so it wasn't an issue for me, but it'd be better to move the AUR instructions to a subsection dedicated to the distro
findex skips a valid .desktop file if found a broken symlink with similar name
building from findex-0.8.0.tar.gz
There is a valid /usr/share/applications/chromium.desktop
and a broken symlink at ~/.local/share/applications/chromium.desktop
.
findex doesn't find anything "chromium" until I remove the broken symlink.
Just ignore the broken symlink and use the valid chromium.desktop.
no need for them
rustc --version --verbose
(if you compiled findex on your machine):rustc 1.70.0
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.70.0
LLVM version: 16.0.6
nothing relevant
I have to restart findex-daemon after deleting the broken symlink.
When the number of options is smaller than min_score, the window should be resized to accomodate only the number of options.
Example:
Say your min_score is set to 5. If you search for "firefox" and it only shows 1 entry, then the window size should be such that only that entry fits. As it is, the window retains the size for the 5 entries.
As you can see here. When no text is entered, no applications show up so there is only one column open
https://i.imgur.com/6Cei3FA.png
Now in this screenshot multiple columns of applications are here
https://i.imgur.com/VcrUpQz.png
The jump between one row and multiple and then back to one when finding your app is quite visually unappealing as the size rapidly changes as you type. There are currently maximum of 7 rows displayed at once. I think it would be better if you make it so 7 rows are always displayed even with nothing typed so theyre just placeholders so the size doesnt keep changing.
Can you add support for uninstalling?
Maybe
./installer.sh remove
Or I can submit PR.
When I try to run it I just get this crash
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/query.rs:148:41
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
And if this is of any help with RUST_BACKTRACE=full
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/query.rs:148:41
stack backtrace:
0: 0x564cc34c616d - <unknown>
1: 0x564cc344949c - <unknown>
2: 0x564cc34c57d4 - <unknown>
3: 0x564cc34c5613 - <unknown>
4: 0x564cc34e4a56 - <unknown>
5: 0x564cc34e49f6 - <unknown>
6: 0x564cc34e49b2 - <unknown>
7: 0x564cc3423530 - <unknown>
8: 0x564cc342368c - <unknown>
9: 0x564cc3460451 - <unknown>
10: 0x564cc345d0d6 - <unknown>
11: 0x564cc342b3f7 - <unknown>
12: 0x564cc343148e - <unknown>
13: 0x7f1dec3add8f - g_closure_invoke
14: 0x7f1dec3c9718 - <unknown>
15: 0x7f1dec3cadd9 - g_signal_emit_valist
16: 0x7f1dec3cb330 - g_signal_emit
17: 0x7f1deb843739 - <unknown>
18: 0x7f1deb84e28a - g_application_run
19: 0x564cc3434990 - <unknown>
20: 0x564cc3431263 - <unknown>
21: 0x564cc34336bd - <unknown>
22: 0x7f1deb457b25 - __libc_start_main
23: 0x564cc342805e - <unknown>
24: 0x0 - <unknown>
When I run findex-daemon
even though there are a few instances of findex
running, I get the following error:
thread 'main' panicked at crates/findex-daemon/src/main.rs:32:28:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
After digging in, I realised that the pidof
command uses a space to separate multiple PIDs by default (see man), while getpid
splits the output using newline bytes. A simple solution is to split using spaces:
--- crates/findex-daemon/src/main.rs.old 2023-10-29 15:20:31.918921390 +0800
+++ crates/findex-daemon/src/main.rs 2023-10-29 15:20:38.391694935 +0800
@@ -24 +24 @@
- .split('\n')
+ .split(' ')
However, this feels like a naive way as not all Linux systems have procps-ng
out of the box. Instead, you could use the processes_by_name
method of the sysinfo
crate. Of course, that comes at the expense of the binary size. (But this is Rust after all, right?)
Of course, the simpler way would be to store the PIDs in the filesystem (like in /var/run
). This way, we would not have to execute syscalls repeatedly. When the process exits, the PID can be removed from the store. (If that is too hard to implement, you could simple use kill(2)
with a 0 signal to check if there a process with that PID is running.)
.config/findex/settings.toml
isn't auto generated and has no effect when manually created.
only style.css
is generated when launching findex.
I came across the project by coincidence and after testing I noticed something that was bugging me a bit. I was trying to find GIMP
but there weren't any results, which is because you only match on the name from the .desktop
file.
On Fedora - and presumably other Distributions as well - the name for GIMP
is GNU Image Manipulation Program which explains the empty results list.
When passing an empty Rstring
to ApplicationCommand::Command
in the return RVec<FResult>
of a plugins handle_query
function, Findex panics at crates/findex/src/gui/result_list_row.rs:136:42
.
I have installed Findex with the automated method detailed in INSTALLATION.md.
Also, to test and attempt to fix the issue, I cloned the repo and ran Findex in release mode.
Return this from a plugins handle_query
function:
RVec::from(vec![FResult {
cmd: ApplicationCommand::Command(RString::new()),
name: "No Command",
desc: RNone,
score: size::MAX,
icon: RString::new()
}])
For the program to execute no command
rustc --version --verbose
(if you compiled findex on your machine):rustc 1.73.0 (cc66ad468 2023-10-03)
binary: rustc
commit-hash: cc66ad468955717ab92600c770da8c1601a4ff33
commit-date: 2023-10-03
host: x86_64-unknown-linux-gnu
release: 1.73.0
LLVM version: 17.0.2
To fix this issue, I added the below code above result_list_row.rs:132:
if cmd.is_empty() {
return;
}
I'm not sure if returning when the cmd
RString
is empty would be the most optimal solution. Adding a None
variant to the ApplicationCommand
enum or wrapping cmd
in an ROption
could be better options. Both would break plugins, either requiring recompilation or rewriting and recompilation, though.
Hi all
i'm have always compiled findex successfully but now i see this error with the latest code downloaded from github:
Compiling atk-sys v0.15.1
Compiling pango-sys v0.15.10
Compiling gtk-sys v0.15.3
Compiling glib v0.15.12
Compiling findex-plugin v0.1.0 (/app/findex/crates/findex-plugin)
Compiling cairo-rs v0.15.12
Compiling pango v0.15.10
Compiling atk v0.15.1
Compiling gdk-pixbuf v0.15.11
Compiling gdk v0.15.4
Compiling findex v0.6.0 (/app/findex/crates/findex)
error[E0658]: let...else
statements are unstable
--> crates/findex/src/gui/result_list_row.rs:95:5
|
95 | / let Some(cmd) = split(unsafe { row.data::("app-cmd").unwrap().as_ref() }) else {
96 | | show_dialog("Error", "Failed to launch application", MessageType::Error);
97 | | return;
98 | | };
| |______^
|
= note: see issue #87335 rust-lang/rust#87335 for more information
For more information about this error, try rustc --explain E0658
.
error: could not compile findex
due to previous error
How can i solve?
Thanks
best regards
Hey,
I've tried to play a bit with Findex on NixOS (a non-FHS linux distribution), and hit two bugs:
query.rs:13
hardcodes /usr/share/applications/
, which doesn't exist on Nix/Guix. I'm not sure what's the portable way to find this path, I suspect it's something like enumerating $XDG_DATA_DIRS
.Regards,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.