l4l / yofi Goto Github PK
View Code? Open in Web Editor NEWyofi is a minimalistic menu for wayland
Home Page: https://crates.io/crates/yofi
License: MIT License
yofi is a minimalistic menu for wayland
Home Page: https://crates.io/crates/yofi
License: MIT License
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`
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.
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
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.
Desktop files have Icon=xxx
entries, so these can be displayed directly with/instead of program name.
"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);
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
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
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>```
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?
Hi,
nice project! It would be cool to have pinentry support like bemenu has via pinentry-bemenu.
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.
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.
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.
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.
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.
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):
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 :)
I saw that yofi has a blacklist, but how does it work, how do I add applications/.desktop to it?
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
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
Current implementation has empty output list, if input is empty (fxd in 6790c4a).
yofi should order apps based on the most-frequently-used metric.
XDG_DATA_DIRS
is set to /usr/local/share /usr/share $HOME/.local/share/ $HOME//.local/share/flatpak/exports/share
, but Yofi isn't finding their desktop files.
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;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 ?
Repro:
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).
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?
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
.
Similar to wofi -P
, rofi -dmenu -password
or bemenu -x
. It replace text entry in the dialog box with either *
or no visible entry, depending on the application.
This would be useful for projects like keepmenu and bitwarden-menu.
Wayland-compatible dmenu-style launchers are hard to find!
Thanks!
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?
It might be handy to support clipboard.
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:
Surface::without_lock_mut
;sctk::seat::keyboard::Event
to sdl2::event::Event
).Related: #39
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.
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.
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]>
The current format is kind of cumbersome, because most color pickers provide the color in hexadecimal format.
The following configuration:
font_color = 0xf8f8f2ff
[input_text]
font_color = 0x00ff00ff
[list_items]
font_color = 0xf8f8f2ff
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.
A single Desktop Entry can have multiple Desktop Actions (see e.g. https://github.com/swaywm/sway/wiki/Tricks#take-screenshots-and-open-them-in-annotation-tool)
It would be nice if this was somehow supported by yofi itself. How much effort would that be?
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.
Another small suggestion for the dialog mode to allow setting a title (prompt) for a set of options. This would be the same as the dmenu -p
or bemenu --prompt
option.
Thanks!
i.e. it should be possible to define list items via standard input as in dmenu:
echo -e "first\nsecond\nthird" | dmenu
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
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.