Coder Social home page Coder Social logo

mdgaziur / findex Goto Github PK

View Code? Open in Web Editor NEW
549.0 4.0 20.0 12.42 MB

Findex is a highly customizable application finder written in Rust and uses GTK3

License: GNU General Public License v3.0

CSS 3.64% Rust 92.46% Shell 3.90%
gtk3 launcher rust free-palestine

findex's People

Contributors

dependabot[bot] avatar harisahmed05 avatar maix0 avatar mdgaziur avatar murlakatamenka avatar pinkcreeper100 avatar thblt avatar z-ww447 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

findex's Issues

Findex Rewrite

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:

  • Make GUI . It'll use Keybinder to bind keys
  • Find and fix performance issues

All of the development will be done in rewrite branch. Merged rewrite with development.

I'll update the issue to notify about the rewrite progress.

Findex using 100% of 1 cpu core

Description

Findex utilize a core at 100% when it runs

Do you already have Findex Installed? (If yes, how did you install?)

Details about your installation process.

To Reproduce

lanch findex and check htop

Expected behavior

not use 100% of a cpu core when not utilized

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • Distro: Nixos
  • Findex Version: 0.7.0

Output of 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

Log/Output (if applicable)

no logs

Additional context

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

More themes by default

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

typo ? leads to failure to compile

Description

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.

System information

  • Findex Version: 0.8.1

Output of 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

Log/Output (if applicable)

.findex-logs doesn't exist.

systemd unit unable to start properly

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.

Panics when there is a file without extension in `~/.local/share/applications`

Reason is here:

findex/src/query.rs

Lines 132 to 134 in e19403b

if app_path.extension().unwrap().to_str().unwrap() != "desktop" {
continue;
}

(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)

Can't get it to work. Please help :)

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?

[Bug] I cannot switch fcitx input method in telegram after running findex-deamon

Description

It is not a problem about keymap collision. I have tried other key bindings in both side and the problem is still unsolved.

Do you already have Findex Installed? (If yes, how did you install?)

$ paru -S findex-bin

To Reproduce

  1. Install fcitx on your system.
  2. Configure an input method.
  3. Install telegram and try to switch to the just installed input method.
  4. You will find that it cannot be switched.

Expected behavior

I should be switched successfully.

System information

  • Distro: Arch Linux 6.4.12-arch1-1
  • Findex Version: 0.7.2
  • Telegram-desktop Version: 4.9.5

Log/Output (if applicable)

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)

[Bug] broken symlink for .desktop

Description

findex skips a valid .desktop file if found a broken symlink with similar name

Do you already have Findex Installed? (If yes, how did you install?)

building from findex-0.8.0.tar.gz

To Reproduce

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.

Expected behavior

Just ignore the broken symlink and use the valid chromium.desktop.

Screenshots

no need for them

System information

  • Distro: Debian sid/unstable
  • Findex Version: 0.8.0

Output of 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

Log/Output (if applicable)

nothing relevant

Additional context

I have to restart findex-daemon after deleting the broken symlink.

Automatically resize window when number of options is smaller than min_score

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.

Display applications without writing

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.

Support for removal

Can you add support for uninstalling?
Maybe

./installer.sh remove

Or I can submit PR.

thread 'main' panicked

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>

[Bug] `ParseIntError` in `getpid`.

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.)

References

settings.toml isn't working

.config/findex/settings.toml isn't auto generated and has no effect when manually created.
only style.css is generated when launching findex.

  • Distro: Arch
  • Version: 0.4.0.-1

Match on 'exec' for finding applications

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.

[Bug] Findex panics when `ApplicationCommand::Command` variants `RString` is empty

Description

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.

Do you already have Findex Installed? (If yes, how did you install?)

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.

To Reproduce

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()
}])

Expected behavior

For the program to execute no command

System information

  • Distro: Ubuntu 22.04.2
  • Findex Version: development

Output of 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

Additional context

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.

Impossible Compile findex

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

Some assumptions don't hold on non-FHS distros

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.
  • The program crashes when an icon is missing in the current theme. This is probably an issue with my config, but crashing seems a bit of an extreme reaction :) (and such finders often are used in minimal setups, so missing icons will happen.

Regards,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.