Giter Club home page Giter Club logo

yofi's Introduction

yofi

ci_badge

.. is a minimalistic menu for Wayland-based compositors.

Installation

Make sure you setup a wayland environment, in particularly WAYLAND_DISPLAY env var must be set. wlr_layer_shell protocol is not necessary but preferred. There are several installation options:

  • Pre-built release binaries are published at the Release page. Although these are built in Ubuntu environment it should also work for other Linux distributions.
  • [for Archlinux] there are yofi-bin and yofi-git AUR packages for binary and from-source builds.
  • Build last release version from crates.io with cargo install yofi.
  • Build with nix: nix profile install github:l4l/yofi.
  • Or you can manually build from sources.

User documentation

User documentation is located at Wiki pages. Feel free to open an issue if something is unclear, missing or outdated.

Building

Cargo

For building the project you need rust compiler and cargo package manager (usually distributed via rustup). Once installed you may build & run the project with the following command:

cargo run --release

Nix

You can build project using nix:

nix build

Contributing

Contributions are welcome, but make sure that:

  • [If that's a new feature or it changes the existing behavior] you've discussed it in the issue page before the implementation.
  • Your patch is not a refactoring.
  • rustfmt and clippy are checked.
  • [optionally] Added docs if necessary and an entry in CHANGELOG.md.

yofi's People

Contributors

anakael avatar cosmoduff avatar figsoda avatar filtsin avatar geekylthyosaur avatar jirutka avatar julianschuler avatar kuabem avatar l4l avatar mifom avatar rm1138 avatar sww13 avatar zachcoyle 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  avatar  avatar  avatar

yofi's Issues

Close window on outer region click

It would be nice to handle mouse clicks and touchpad devices touches so the app is closed on clicking/touching the outer region. There's no need for special handling, just calling exit(0) will do the thing.

Fails silently

If a .desktop file uses an invalid Exec yofi fails silently. It panics with:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Sys(ENOENT)', src/mode/apps.rs:92:41

What I expected was an error letting me know the application failed to launch.

What may be helpful for users debugging issues like this may be to include the .desktop file location in case they have an invalid override in their home folder like myself. Also the Exec that was trying to be run.

Layout configuration

For now layout is hardcoded and can only be change by changing code. These need to be configurable to fulfill the issue:

  • window position 5387c5f
  • window sizes b519971
  • arc radius of input block
  • margins of input block
  • margins of list as a whole
  • margins of list items

Rounding of corners

image
You can see the edges of the popup of yofi are sharp. Can I get the option to make them rounded?? I don't mean the rounding of the input block, that's fine with me. I'm talking about the whole window/popup.

Bad anti-aliasing

20210414_20h55m01s_grim
The anti-aliasing of the font and icons is so bad. Is there a way to fix this?? Or is it a bug??
And when I try to use a font that is not monospace, this happens:-
20210414_20h54m45s_grim
Also how do you make the corners rounded??

Dialog mode

i.e. it should be possible to define list items via standard input as in dmenu:

echo -e "first\nsecond\nthird" | dmenu

Paniced trying to unwrap Err(NoSuchGlyph)

Hi and sorry for not investigating this further. When I set my font as 'monospace' or 'Terminus' (should be the same thing as I created an alias in fonts.conf), I get the following panic when I try to launch. Running Arch Linux and the font in question is terminus-font from community (https://archlinux.org/packages/community/any/terminus-font/). Thanks for the awesome work so far!

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NoSuchGlyph', /home/gustafla/.cargo/git/checkouts/raqote-e2149927d9facb18/27cfc13/src/draw_target.rs:784:39
stack backtrace:
   0: rust_begin_unwind
             at /build/rust/src/rustc-1.49.0-src/library/std/src/panicking.rs:495:5
   1: core::panicking::panic_fmt
             at /build/rust/src/rustc-1.49.0-src/library/core/src/panicking.rs:92:14
   2: core::option::expect_none_failed
             at /build/rust/src/rustc-1.49.0-src/library/core/src/option.rs:1268:5
   3: core::result::Result<T,E>::unwrap
             at /build/rust/src/rustc-1.49.0-src/library/core/src/result.rs:973:23
   4: raqote::draw_target::DrawTarget::draw_text
             at /home/gustafla/.cargo/git/checkouts/raqote-e2149927d9facb18/27cfc13/src/draw_target.rs:784:22
   5: <yofi::draw::list_view::ListView<It> as yofi::draw::Drawable>::draw
             at ./src/draw/list_view.rs:198:17
   6: <yofi::draw::Widget<It> as yofi::draw::Drawable>::draw
             at ./src/draw.rs:63:34
   7: yofi::surface::Surface::redraw
             at ./src/surface.rs:161:32
   8: yofi::draw
             at ./src/main.rs:180:5
   9: yofi::main
             at ./src/main.rs:155:13
  10: core::ops::function::FnOnce::call_once
             at /build/rust/src/rustc-1.49.0-src/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace

ctrl+enter hotkey for fork then exec

It's useful to launch multiple apps. That somewhat tiresome to launch yofi each time, so it would be handy to handle a hotkey which can launch app without closing yofi. It can be simply done with forking right before an exec.

pinentry-support

Hi,

nice project! It would be cool to have pinentry support like bemenu has via pinentry-bemenu.

"Magics" support

Currently, apps are launched by their Exec=... entries in desktop files. Sometime it's useful to pass program arguments to the command. Thus "magics" are considered, which is an extension to the search field (e.g. somewhat inspired by dgg's bangs). Here's the sample list:

  • x !! y executes a program found by search string x with arguments listed in y;
  • x ~ y executes a program found by search string x with working directory y;
  • x # y executes a program found by search string x with env vars specified in y (e.g. MYVAR=xyz MYVAR2= MYVAR3=abc);
  • @ x executes a binary x as-is without any search;
  • ...anything else? (let it be discussed in another issues)

Local *.desktop files should have a higher priority than global ones

"Duplicate" of the following rofi issue: davatorium/rofi#579
TLDR:
Desktop entries in ~/.local/share/applications/ should take precedence over those in /usr/share/applications/.

For reference see Arch wiki - Desktop entries

As far as i can tell, in desktop.rs -> find_entries() both XDG_DATA_DIRS and XDG_DATA_HOME are already included.
But maybe the deduping or sorting does not prefer the ones in XDG_DATA_HOME?:

let mut dirs = xdg_dirs.get_data_dirs();
dirs.push(xdg_dirs.get_data_home());
let mut entries = vec![];
traverse_dirs(&mut entries, dirs);
entries.sort_unstable_by(|x, y| x.name.cmp(&y.name));
entries.dedup_by(|x, y| x.name == y.name);

Yofi launches through terminal but not through sway config

Other launchers like dmenu and rofi launch fine setting the $menu as the command that opens it from terminal.

Output of swaymsg exec yofi results [common/ipc-client.c:67] Unable to connect to /run/user/1001/sway-ipc.1001.1158.sock

Have exhausted my google-fu and don't know what next to do

yofi is blank and unresponsive

I just installed yofi, and can launch it from either shell or sway hotkey. However, it is blank and unresponsive. No text appears in the box, and it seems to respond only to escape, which closes it.

I am using sway version 1.7 on Arch LInux 5.16.18-hardened, and yofi is version 0.1.5.

Crash on launch "Initial roundtrip failed!: NoWaylandLib"

stack backtrace:
   0:     0x56133e43fdbb - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h04e1659590c75b7f
   1:     0x56133e2dcbfc - core::fmt::write::h934b5967ac569ed6
   2:     0x56133e42e784 - std::io::Write::write_fmt::h5ab422a8ac80f319
   3:     0x56133e4356f0 - std::panicking::default_hook::{{closure}}::h494c7f9d4414967f
   4:     0x56133e436022 - std::panicking::rust_panic_with_hook::h003457efeb6d6b49
   5:     0x56133e440158 - std::panicking::begin_panic_handler::{{closure}}::h251c8136df2fab02
   6:     0x56133e4400d6 - std::sys_common::backtrace::__rust_end_short_backtrace::h27a470ecec345006
   7:     0x56133e435a22 - rust_begin_unwind
   8:     0x56133e2510a0 - core::panicking::panic_fmt::h4fce74342b1c33c5
   9:     0x56133e251212 - core::result::unwrap_failed::h8c4993f73e62bc49
  10:     0x56133e535011 - yofi::main::hcd1b7123951e1917
  11:     0x56133e562b73 - std::sys_common::backtrace::__rust_begin_short_backtrace::h9a2b35493f4ade7f
  12:     0x56133e530a60 - main
  13:     0x7f379f4561d7 - __libc_start_call_main
  14:     0x7f379f456297 - __libc_start_main_impl
  15:     0x56133e263a01 - _start
  16:                0x0 - <unknown>```

blacklist

I saw that yofi has a blacklist, but how does it work, how do I add applications/.desktop to it?

Clipboard support

It might be handy to support clipboard.

  • Copy, as far as I know, won't work, because no other wayland client can get a buffer after exit. And since yofi is displayed as overlay no other window (except locking screen maybe) can get it. Therefore I don't feel like it make much sense to implement it.
  • Paste should work fine.

Support percent in config values

Currently number values for config can be only specified with exact pixels number. Would be handy to support percent values as well. For now it's fine to implement it for width & height

No allocator thread panicked

I just built yofi from master as well as the 0.1.5 tag and when executing yofi apps I get the following error:

โฏ yofi apps
thread '<unnamed>' panicked at 'Must provide allocators in no-stdlib code', /home/griff/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-decompressor-2.3.2/src/ffi/alloc_util.rs:185:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at 'Must provide allocators in no-stdlib code', /home/griff/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-decompressor-2.3.2/src/ffi/alloc_util.rs:185:13
thread '<unnamed>' panicked at 'Must provide allocators in no-stdlib code', /home/griff/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-decompressor-2.3.2/src/ffi/alloc_util.rs:185:13
thread '<unnamed>' panicked at 'Must provide allocators in no-stdlib code', /home/griff/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-decompressor-2.3.2/src/ffi/alloc_util.rs:185:13
thread '<unnamed>' panicked at 'Must provide allocators in no-stdlib code', /home/griff/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-decompressor-2.3.2/src/ffi/alloc_util.rs:185:13
[2022-04-27][20:48:47][yofi][ERROR] panic: Must provide allocators in no-stdlib code

I tracked down the crate generating the error. It is a dependency of allsorts_no_std which is a dependency of rust-fontconfig. The allsorts_no_std crate has brotli-decompressor as a dependency with default features off making it no_std and requiring that an allocator be set. It looks like allsorts_no_std may have moved to allsorts and likely might just need to be updated.

Let me know if you have any questions, need additional info, or would like me to assist in troubleshooting further.

Add font fallback or warning

If you run yofi and do not have the default font installed it does this
lol
After changing font in config with font = "/usr/share/fonts/noto/NotoSansDisplay-Thin.ttf"
lol

Use native icons

Some launchers take the icons from the app itself when the icon pack does not have the app icon, it would be nice to have this in yofi.

image

Sirula

image

yofi

Initial roundtrip failed!: NoCompositerListening

Hi,

I've successfully installed (and tried out) yofi from sources, but after some additional packages installation (on Ubuntu 21.04) and reboot I get this error, being unable to run yofi at all :/

RUST_BACKTRACE=full yofi --verbose
# note that the /tmp/yofi.log exists, but is empty

Resulting output of the command above is:

thread 'main' panicked at 'Initial roundtrip failed!: NoCompositorListening', src/main.rs:111:14
stack backtrace:
   0:     0x563bb5e1088a - std::backtrace_rs::backtrace::libunwind::trace::h72c2fb8038f1bbee
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/../../backtrace/src/backtrace/libunwind.rs:96
   1:     0x563bb5e1088a - std::backtrace_rs::backtrace::trace_unsynchronized::h1e3b084883f1e78c
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/../../backtrace/src/backtrace/mod.rs:66
   2:     0x563bb5e1088a - std::sys_common::backtrace::_print_fmt::h3bf6a7ebf7f0394a
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:79
   3:     0x563bb5e1088a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h2e8cb764b7fe02e7
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:58
   4:     0x563bb5cbd3ec - core::fmt::write::h7a1184eaee6a8644
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/fmt/mod.rs:1080
   5:     0x563bb5e0fff1 - std::io::Write::write_fmt::haeeb374d93a67eac
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/io/mod.rs:1516
   6:     0x563bb5e0f8fb - std::sys_common::backtrace::_print::h1d14a7f6ad632dc8
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:61
   7:     0x563bb5e0f8fb - std::sys_common::backtrace::print::h301abac8bb2e3e81
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:48
   8:     0x563bb5e0f8fb - std::panicking::default_hook::{{closure}}::hde0cb80358a6920a
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:208
   9:     0x563bb5e0f8fb - std::panicking::default_hook::h9b1a691049a0ec8f
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:227
  10:     0x563bb5e0f8fb - std::panicking::rust_panic_with_hook::h2bdec87b60580584
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:577
  11:     0x563bb5e2bc68 - std::panicking::begin_panic_handler::{{closure}}::h101ca09d9df5db47
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:484
  12:     0x563bb5e2bc34 - std::sys_common::backtrace::__rust_end_short_backtrace::h3bb85654c20113ca
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:153
  13:     0x563bb5e2bbed - rust_begin_unwind
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:483
  14:     0x563bb5cbab20 - core::panicking::panic_fmt::h48c31e1e3d550146
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/panicking.rs:85
  15:     0x563bb5cc19b2 - core::option::expect_none_failed::h6154dc750ae47ade
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/option.rs:1234
  16:     0x563bb5c2ee15 - yofi::main::hca3ac633ec3ea871
  17:     0x563bb5c249b3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h61ff76ebcd542a68
  18:     0x563bb5c50e35 - main
  19:     0x7f89e89a0565 - __libc_start_main
  20:     0x563bb5c2007e - _start
  21:                0x0 - <unknown>

It might be related, but I've installed tlp for power management and acpi-call-dkms.

thread 'main' panicked at '[calloop] Encountered an orphan event: wl_keyboard@19

Repro:

  1. Clone at head (rn thats 17edf90)
  2. LD_LIBRARY_PATH="$(nix eval --raw nixpkgs.wayland)/lib" cargo run

Crash:

thread 'main' panicked at '[calloop] Encountered an orphan event: wl_keyboard@19 : keymap', /home/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/smithay-client-toolkit-0.15.3/src/event_loop.rs:49:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[wayland-client error] A handler for wl_keyboard panicked.
Aborted (core dumped)

(The ld-preload nonsense is because im testing on nixOS - this lets the program find the wayland libraries on my system).

Icon support

Desktop files have Icon=xxx entries, so these can be displayed directly with/instead of program name.

Panic trying to run on wayland + gnome + manjaro

Hi,

first of all thank you for this initiative / project ๐Ÿ‘๐Ÿพ :). I can read rust and can try fix simple problems.

I tried to follow the instructions on README. I get this error

 Running `target/release/yofi`
thread 'main' panicked at '[SCTK] A missing global was required: zwlr_layer_shell_v1', /home/rajib/.cargo/registry/src/github.com-1ecc6299db9ec823/smithay-client-toolkit-0.12.1/src/environment.rs:183:21
stack backtrace:
   0:     0x564e6df41c7a - std::backtrace_rs::backtrace::libunwind::trace::h72c2fb8038f1bbee
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/../../backtrace/src/backtrace/libunwind.rs:96
   1:     0x564e6df41c7a - std::backtrace_rs::backtrace::trace_unsynchronized::h1e3b084883f1e78c
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/../../backtrace/src/backtrace/mod.rs:66
   2:     0x564e6df41c7a - std::sys_common::backtrace::_print_fmt::h3bf6a7ebf7f0394a
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:79
   3:     0x564e6df41c7a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h2e8cb764b7fe02e7
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:58
   4:     0x564e6de0937c - core::fmt::write::h7a1184eaee6a8644
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/fmt/mod.rs:1080
   5:     0x564e6df413e1 - std::io::Write::write_fmt::haeeb374d93a67eac
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/io/mod.rs:1516
   6:     0x564e6df40ceb - std::sys_common::backtrace::_print::h1d14a7f6ad632dc8
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:61
   7:     0x564e6df40ceb - std::sys_common::backtrace::print::h301abac8bb2e3e81
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:48
   8:     0x564e6df40ceb - std::panicking::default_hook::{{closure}}::hde0cb80358a6920a
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:208
   9:     0x564e6df40ceb - std::panicking::default_hook::h9b1a691049a0ec8f
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:227
  10:     0x564e6df40ceb - std::panicking::rust_panic_with_hook::h2bdec87b60580584
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:577
  11:     0x564e6df5d058 - std::panicking::begin_panic_handler::{{closure}}::h101ca09d9df5db47
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:484
  12:     0x564e6df5d024 - std::sys_common::backtrace::__rust_end_short_backtrace::h3bb85654c20113ca
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:153
  13:     0x564e6df5cfdd - rust_begin_unwind
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:483
  14:     0x564e6df5cfa0 - std::panicking::begin_panic_fmt::hf0503558fbe5b251
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:437
  15:     0x564e6dd99327 - yofi::main::h7f05fcf424576d39
  16:     0x564e6dd83223 - std::sys_common::backtrace::__rust_begin_short_backtrace::h14aaf3615dd2a315
  17:     0x564e6dda8605 - main
  18:     0x7fa16a09e152 - __libc_start_main
  19:     0x564e6dd7e0ae - _start
  20:                0x0 - <unknown>

Googling this zwlr_layer_shell_v1 - seems to have some issue with gnome. emersion/slurp#38 (comment)

Any ideas how to slove this ?

Can't launch gedit as "gedit"

Testing yofi snapshot (377497b) from 2020-12-30. I notice that I can't launch gedit by typing "gedit". I have to type something that matches "Text Editor" instead. Is yofi only checking the Name entries of desktop files?

I see the /usr/share/applications/org.gnome.gedit.desktop file on Arch Linux has the following:

Keywords[en_GB]=Text;Editor;Plaintext;Write;gedit;

Could it be possible add support for matching these keywords?

Navigate with mouse

Currently, the only to navigate in yofi is through the keyboard. This includes both scrolling and selecting an entry. It would be great if one could also scroll and select an entry with the mouse.

My current problem is that I want yofi to pop up when I click something in a taskbar, put then I need to let go of the mouse and type what I want, regardless of whether it's right there on the screen in front of me.

Letter distance flawed

Using the default config and yofi 0.1.3 the letter distance when opening yofi is flawed:
image

libsystemd error: No such file or directory (os error 2)"

Artix Linux s6 init
aur/yofi-git

โฏ yofi
[2022-03-05][13:50:29][yofi::desktop][WARN] cannot parse DirEntry("/home/user/.local/share/flatpak/exports/share/applications/mimeinfo.cache"): Error parings input: Tag at ``, skipping
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: SdError { kind: Generic, msg: "failed to print to journal at '/run/systemd/journal/socket': libsystemd error: No such file or directory (os error 2)" }', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/systemd-journal-logger-0.5.0/src/lib.rs:308:56
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The main configuration from the wiki doesn't work

Error message:

thread 'main' panicked at 'Invalid config: invalid type: string "60", expected f32 for key `list_items.action_left_margin` at line 56 column 22', src/config.rs:144:68
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

yofi 0.1.5

Setting font_color in input_text sets it for the entire menu.

The following configuration:

font_color = 0xf8f8f2ff

[input_text]
font_color = 0x00ff00ff

[list_items]
font_color = 0xf8f8f2ff

Results in:
image

However, looking at the configuration, I would expect that setting font_color to green under input_text would only affect the input text, and the listed items would remain white.

Maybe I am misunderstanding something about the configuration. If that's the case, I apologize.

Configuration: specifiy font size

First of all, looks quite nice what you got here! I like what I've seen after playing with it a bit

Anyway, I noticed that the font on my setup appears a notch too large and I'd like to use a smaller font size. I haven't seen a hint in the example config, so is this already possible through the config?

If not and you're interested in getting help, I'd like to give it a shoot and try implementing this feature.

Icon downscaling

For now, only a specified icon size can be used (except pixmaps). Some of the apps provide only big icons (e.g. 256x256), thus higher-resultion icons should be loaded, if there's no fit for exact match.

Publish on crates.io

Great project!

I'd like to be able to install it will cargo:

cargo install yofi

This means I can also update via cargo as well, rather than have to find the binary. Is that something you'd be willing to add to CI?

Running an arbitrary command panics

Running an arbitrary command (e.g.: firefox --no-remote) panics:

$ yofi
[type `firefox --no-remote` and hit enter]
thread 'main' panicked at 'Internal error: selected_item overflow', src/state.rs:28:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Favourites as a default list

Current implementation has empty output list, if input is empty (fxd in 6790c4a).

yofi should order apps based on the most-frequently-used metric.

decode_to_string_without_replacement not found

I get this error when trying to compile yofi

Running rust-1.54, cargo-1.54

error[E0599]: no method named `decode_to_string_without_replacement` found for struct `Decoder` in the current scope
  --> /home/kamiyaa/.cargo/registry/src/github.com-1ecc6299db9ec823/allsorts_no_std-0.5.2/src/get_name.rs:94:36
   |
94 |         let (res, _read) = decoder.decode_to_string_without_replacement(data, &mut s, true);
   |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: there is an associated function with a similar name: `decode_to_str_without_replacement`

crash when setting match_color in config file

I use the yofi 0.1.3 binaries for ubuntu 20.04 on manjaro linux (but also happens with the self-compiled one). If I use the default settings, all is working as it should. As soon as I configure match_color in ~/.config/yofi/yofi.config, yofi would suddenly crash in the middle of typing. Here is the result of starting yofi and typing the characters n and e:

env RUST_BACKTRACE=full yofi
thread 'main' panicked at 'assertion failed: r.end <= x.chars().count()', src/draw/list_view.rs:142:17
stack backtrace:
   0:     0x5558a572e69a - <unknown>
   1:     0x5558a56613ac - <unknown>
   2:     0x5558a572de01 - <unknown>
   3:     0x5558a572d70b - <unknown>
   4:     0x5558a582a8d3 - <unknown>
   5:     0x5558a582a8ac - <unknown>
   6:     0x5558a582a88a - <unknown>
   7:     0x5558a585e478 - <unknown>
   8:     0x5558a582d30b - <unknown>
   9:     0x5558a560c678 - <unknown>
  10:     0x5558a582a863 - <unknown>
  11:     0x5558a5613275 - <unknown>
  12:     0x7f3f74060152 - __libc_start_main
  13:     0x5558a55f10be - <unknown>
  14:                0x0 - <unknown>

I guess the exact characters depend on which programs are in my list, so I don't really know how I can describe how to reproduce it. For me it is 100% reproducible. Also happens if I just press p and for many other key sequences.

I am sorry that above stacktrace does not look very useful, how would I get a better one?

Some desktop files makes yofi crash

Hi,
I tried to use the default config file given in the wiki and I got this error : thread 'main' panicked at 'range start index 51 out of range for slice of length 39', src/icon.rs:86:34
After some investigations I found this file

[Desktop Entry]
Name=Code - OSS
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/bin/code-oss --unity-launch %F
Icon=com.visualstudio.code.oss.png
Type=Application
StartupNotify=false
StartupWMClass=Code
Categories=TextEditor;Development;IDE;
MimeType=text/plain;application/x-code-oss-workspace;
Actions=new-empty-window;
Keywords=vscode;

[Desktop Action new-empty-window]
Name=New Empty Window
Exec=/usr/bin/code-oss --new-window %F
Icon=com.visualstudio.code.oss.png

makes yofi crash.

X11 support

This should be done in a conflicting feature (i.e. binary either build with wayland support or with x11 but not both).

I believe (hope) sdl2 might nicely fit the current implementation. All that should be done:

  • main refactored a bit (i.e. wayland/x11 related things better be in other module);
  • rendering should be directed to Surface::without_lock_mut;
  • input events are mapped appropriately (i.e. sctk::seat::keyboard::Event to sdl2::event::Event).

Fix font kerning totally not accounted for.

Hello, I'd like to raise a issue about how this program does font rendering, as it seems that this program does no kerning (at least properly) at all. Font kerning, which you can read about here is the spacing between each letters specified by the font file. This must be obeyed if the text is desired to look properly.

For now, it seems that even the default font suffers from characters overwriting and overlapping each other producing less desirable menu to look at.

Example A:
image

You can see that the top of the letter "V" is cut off due to improper kerning and lack of character bitmap blending.

Example B (using the "Terminus TTF" font):
image

The text is not even legible with this font as the kerning is not obeyed at all. I chose this font as it can avoid text blending issues in the 1st example, where each character overrides one another as each character should (in theory) take it's own space and not share "the same pixel space".

I'd purpose that since the code already calculates character pixel offsets, that you also consider per font/character kerning so that the produced render doesn't look so garbled. I, unfortunately, can't help much because of my lack of experience in rust. Wish you the best in remedying this problem :)

Runtime error

Installed by cloning the repository and building with cargo build --release, and then ran using the command listed in the log below, this run-time error is emitted:

gavin@arch ~/yofi (master)> RUST_BACKTRACE=full cargo run --release
    Finished release [optimized] target(s) in 0.10s
     Running `target/release/yofi`
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/font/fdue.rs:65:14
stack backtrace:
   0:     0x563b53f96a65 - std::backtrace_rs::backtrace::libunwind::trace::h34055254b57d8e79
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x563b53f96a65 - std::backtrace_rs::backtrace::trace_unsynchronized::h8f1e3fbd9afff6ec
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x563b53f96a65 - std::sys_common::backtrace::_print_fmt::h3a99a796b770c360
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x563b53f96a65 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h32d1f94a80615d18
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x563b53e5154c - core::fmt::write::h306731c068f7162c
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/fmt/mod.rs:1110:17
   5:     0x563b53f95184 - std::io::Write::write_fmt::hd2fa90334eee2a21
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/io/mod.rs:1588:15
   6:     0x563b53f95c5b - std::sys_common::backtrace::_print::h5abaa2601a852287
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x563b53f95c5b - std::sys_common::backtrace::print::h8d81445442bb638f
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x563b53f95c5b - std::panicking::default_hook::{{closure}}::hcfe804496a9fa747
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:208:50
   9:     0x563b53f94d89 - std::panicking::default_hook::hbea8e3ccf2ba8901
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:225:9
  10:     0x563b53f94d89 - std::panicking::rust_panic_with_hook::h7ee9e1a2d0f8975a
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:622:17
  11:     0x563b53faeeee - std::panicking::begin_panic_handler::{{closure}}::h8ab3b4491718b2c7
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:517:13
  12:     0x563b53faee8c - std::sys_common::backtrace::__rust_end_short_backtrace::hd489062ffa586a9f
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/sys_common/backtrace.rs:141:18
  13:     0x563b53faee3d - rust_begin_unwind
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:515:5
  14:     0x563b53dc9970 - core::panicking::panic_fmt::hca6330e3e14086b4
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/panicking.rs:92:14
  15:     0x563b53dc98bc - core::panicking::panic::h1a48d878ff3dcd40
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/panicking.rs:50:5
  16:     0x563b540e0cd5 - <yofi::font::fdue::Font as yofi::font::FontBackend>::default::he4a2f9f4d1a13b7f
  17:     0x563b5409b3b4 - yofi::config::params::<impl core::convert::From<&yofi::config::Config> for yofi::draw::input_text::Params>::from::h5706ebf288026551
  18:     0x563b540c2f62 - yofi::draw::h39c75ad96fc7866d
  19:     0x563b540bf6b7 - yofi::main::h60d167a6e57d3f47
  20:     0x563b540dd363 - std::sys_common::backtrace::__rust_begin_short_backtrace::hfdec4b4d300533eb
  21:     0x563b540abb21 - main
  22:     0x7f5536bb7b25 - __libc_start_main
  23:     0x563b53ddbd4e - _start
  24:                0x0 - <unknown>
gavin@arch ~/yofi (master) [101]>

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.