onagre-launcher / onagre

A general purpose application launcher for X and wayland inspired by rofi/wofi and alfred
MIT License
511 stars 27 forks source link

Onagre launch requires working theme #35

Closed plum closed 2 years ago

plum commented 2 years ago

I'm keen to use onagre, because it seems exactly what is needed for wayland, and it looks like its well conceived and promising. I had been a long time user of rofi ( and recently LeBonn's version of Rofi for wayland).

I haven't been able to launch it however. I am using the arch package. The README states that onagre will fall back on the default theme if none is provided, but for me, launch fails with the error message: Unable to load user theme: Unable to find theme settings file /home/user/.config/onagre/theme.toml

Installing the default theme in ~/user/.config/onagre/theme.toml, I receive the error : thread 'main' panicked at 'Error in Surface::configure: invalid surface', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.11.0/src/backend/direct.rs:204:9

When I provide provide any of the themes given as examples, I receive errors concerning unknown variables 'width' and 'height'.

I am surprised because I understand people are able to use Onagre. Advice that may point me in the right direction to get it up and running would be gratefully received. I do understand it is early days yet!

Kind Regards, John

oknozor commented 2 years ago

Hey @plum thank you for trying onagre.

I have just updated the AUR package, can you try again and let me know how it goes. If it still fails can you try to install via cargo :

cargo install --git https://github.com/oknozor/onagre

You will need to install rust to get it. If this still fail via cargo. This might be a hardware issue and I will have to open an issue in iced.

Let me know how it goes.

plum commented 2 years ago

Hey, thank you OKnozor, for prompt suggestions in reply.

No difference woith updated aur package.

Having installed via cargo, I receive this similar error when running theme.toml:

Unable to load user theme: Theme format error : unknown field `width`, expected one of `background`, `text_color`, `border_color`, `border_radius`, `border_width`, `padding`, `lines`

A difference this time is that a terminal window was actually launched (whereas not so with the aur package), that had a white background; But, would receive no input from keyboard.

If I am to assume it is a misleading error report, and if what you suggest may be true, that it is a hardware issue, then for what reason could that be? I cannot imagine.

Set up: Running arch linix-lts 5.10.78-1 (latest version) on a thinkpad T440p

Regards, John

oknozor commented 2 years ago

Since onagre is starting, this not a hardware issue.

I guess you took this theme example which is outdated and should be replaced with a correct one.

Can you try with one of the theme from docs/theme_examples ?

plum commented 2 years ago

Can you try with one of the theme from [docs/theme_examples]

I installed the arc theme and the jetbains mono font for convenience and ran:

$ onagre -t ~/.config/onagre/theme-nord.toml A terminal was launched with a dark background, and received the following error. Unable to load theme config : Config format error : unknown fieldicons, expectedmodes``

Some more results:

⏎     onagre -t ~/.config/onagre/nord-rounded.toml
Unable to load theme config : Config format error : unknown field `icons`, expected `modes`
onagre -t ~/.config/onagre/simple-theme.toml
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotFound', src/style/font.rs:23:67
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
~ ❯❯❯ onagre -t ~/.config/onagre/murz-theme.toml
Unable to load user theme: Theme format error : unknown field `height`, expected one of `background`, `text_color`, `border_color`, `border_radius`, `border_width`, `padding`, `lines`

Regards, John

oknozor commented 2 years ago

@plum looking at the error, it's obvious you are running an older version of onagre. Can you remove your pacman/aur-helper cache and reinstall from the AUR ?

plum commented 2 years ago

The version given for onagre installed via cargo (not from aur) indicated simply Version 0.1.0 I uninstalled onagre form ~/.cargo using $ cargo uninstall onagre

I ran yay -Sc and, yay -S onagre-git.

/usr/bin/onagre Version: 0.1.0.r116.g6168926-1

The results below with specified themes indicate that local cargo installation is interfering with 'invalid surface..';

Deleting ~/.cargo made no difference, which seems strange. I cleared my system ram cache, and restarted, same error persisted. Cannnot deduce what to do about this.

~ ❯❯❯ onagre
Unable to load user theme: Theme format error : unknown field `height`, expected one of `background`, `text_color`, `border_color`, `border_radius`, `border_width`, `padding`, `lines`
thread 'main' panicked at 'Error in Surface::configure: invalid surface', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.11.0/src/backend/direct.rs:204:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
~ ❯❯❯ onagre -t ~/.config/onagre/nord-rounded.toml
thread 'main' panicked at 'Error in Surface::configure: invalid surface', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.11.0/src/backend/direct.rs:204:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
~ ❯❯❯ /usr/bin/onagre -t ~/.config/onagre/murze-theme.toml
Unable to load user theme: expected newline, found an identifier at line 10 column 24 in .config/onagre/murze-theme.toml
thread 'main' panicked at 'Error in Surface::configure: invalid surface', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.11.0/src/backend/direct.rs:204:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
oknozor commented 2 years ago

@plum have just double checked with another laptop and I cannot reproduce your issue.

I guess you have the correct version installed but somehow an old version is still used on your $PATH or some build cache still remains on your system.

Can you uninstall everything again an check there is no onagre bin remaining on your path :

❯ which onagre
onagre not found

Once it's done look for any remaining build cache. I just ran yay -Sc and I can confirm some cached build where still not removed after that. You can locate them with fd or find (i used fd here) :

❯ cd /

/🔒
❯ fd onagre
var/lib/archbuild/extra-x86_64/okno/build/onagre-git
var/lib/archbuild/extra-x86_64/okno/var/lib/pacman/local/onagre-git-0.1.0.r116.g6168926-1
var/lib/archbuild/extra-x86_64/okno/usr/bin/onagre

Then remove them :

sudo rm -rd var/lib/archbuild/extra-x86_64/okno/build/onagre-git
sudo rm -rd var/lib/archbuild/extra-x86_64/okno/var/lib/pacman/local/onagre-git-0.1.0.r116.g6168926-1
sudo rm -rd var/lib/archbuild/extra-x86_64/okno/usr/bin/onagre

Once you are absolutely sure your system has no more cached build you can run yay -S onagre-git. If you are actually installing the correct version you should see a cargo build during the installation process and It should take a little longer than the previous cached installation you made :

   Compiling iced v0.3.0 (https://github.com/hecrj/iced#20177e42)
   Compiling onagre v0.1.0 (/home/okno/.cache/yay/onagre-git/src/onagre)
    Finished release [optimized] target(s) in 3m 33s

For the sake of testing make sure you delete everything under $HOME/.config/onagre/, and create an empty config :

rm -rd $HOME/.config/onagre
mkdir $HOME/.config/onagre
touch $HOME/.config/onagre/theme.toml
touch $HOME/.config/onagre/config.toml

Now let's add a working theme :

❯ cat $HOME/.config/onagre/theme.toml
icon_theme = "Papyrus"
font = "JetBrains Mono,JetBrains Mono Medium"
size = [800, 280]
font_size = 18
background = "#2E3440"
border_color = "#00000000"
border_radius = 0.0
border_width = 0.0

[rows.lines.default]
background = "#2E3440"
text_color = "#81A1C1"
padding = 5

[rows.lines.selected]
background = "#2E3440"
text_color = "#EBCB8B"
padding = 5

[scrollable]
scrollbar_width = 0
scroller_width = 0

[search.bar]
background = "#3B4252"
value_color = "#8FBCBB"
placeholder_color = "#8FBCBB"
border_color = "#00ff00ff"
selection_color = "#fcfbfbff"
text_width = "fill"

[search]
background = "#3B4252"
height = 30

Let me know how it goes.

plum commented 2 years ago

Thanks Oknozor.

I followed your steps. Actually that was a repeat of what I had done previously, and reported in the last post. Nontheless I repeated. There were no build cache remaining, I checked this time.

I'll show what the problem is precisely:

I had previously deleted my ~/.cargo directory, but installing onagre-git installs a new ~/.cargo directory:

❯❯❯ onagre
thread 'main' panicked at 'Error in Surface::configure: invalid surface', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.11.0/src/backend/direct.rs:204:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

 ls /home/user/.cargo/registry/src/
github.com-1ecc6299db9ec823

~ ❯❯❯ sudo rm -R ~/.cargo

~ ❯❯❯ ls /home/chuee/.cargo/registry/src/
ls: cannot access '/home/user/.cargo/registry/src/': No such file or directory

~ ❯❯❯ onagre
thread 'main' panicked at 'Error in Surface::configure: invalid surface', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.11.0/src/backend/direct.rs:204:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

In calling onagre, somehow, contents of the former (now absent) directory ~/.cargo is being referenced.

Restarting and clearing system cache doesn't remove the problem.

Any ideas on this? I don't myself understand the meaning of 'Error in Surface::configure: invalid surface',

oknozor commented 2 years ago

Can you copy the output of RUST_LOG=debug RUST_BACKTRACE=1 onagre ?

plum commented 2 years ago

Sure I have attached it here in a file: onagre-rust_log.txt

Looking over the output, I wonder if the problems I am having are due to vulkan drivers. I understand that arch is supposed to have vulkan mesa inbuilt. I see I have spirv-tools 2021.3-1 installed from 'extra'.

I installed vulkan-tools, then ran:

$ ~ ❯❯❯ /usr/bin/vulkaninfo
Cannot create Vulkan instance.
This problem is often caused by a faulty installation of the Vulkan driver or attempting to use a GPU that does not support Vulkan.
ERROR at /build/vulkan-tools/src/Vulkan-Tools-1.2.199/vulkaninfo/vulkaninfo.h:687:vkCreateInstance failed with ERROR_INCOMPATIBLE_DRIVER

FURTHER INFORMATION ........................................... extra/mesa 21.2.5-1 [installed] extra/xf86-video-intel 1:2.99.917+916+g31486f40-2 (xorg-drivers) [installed] extra/spirv-tools 2021.3-1 (vulkan-devel) [installed]

~ ❯❯❯ uname -r
5.10.80-1-lts
❯❯❯ lspci -k
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller (rev 06)
    Subsystem: Lenovo ThinkPad T440p
    Kernel modules: ie31200_edac
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
    Subsystem: Lenovo ThinkPad T440p
    Kernel driver in use: i915
    Kernel modules: i915

/etc/mkinitcpio.conf: MODULES=(i915)

Thanks, John

oknozor commented 2 years ago

@plum I don't know how to solve this so I created an issue in iced. Let's wait and see.

plum commented 2 years ago

@plum I don't know how to solve this so I created an issue in iced. Let's wait and see.

Fair enough. Thanks, I'll be patient. We can consider it as an issue raised towards useful progress overall, ironing out any potential problems ahead.

I researched mesa/intel/linux default set ups for wayland; All seems to be correct with arch mesa drivers, the i915 kernal module for intel and, likewise on my setup.

Also, I can confirm that my hardware is new enough to support the i915 module, which was also ran under Xorg successfully. I have no other issues with that kernal module presently on Wayland that I know of. I switched to Wayland exclusively about four months ago. Running with Sway.

Here I found the best overview on gpu drivers for intel on wayland: https://www.askwoody.com/forums/topic/mesa-20-arrives-good-news-for-intel-graphics-users-on-linux/

Regards, John

hecrj commented 2 years ago

@plum Any chance you could try the wgpu examples? If the issue is there, then you should probably open a bug report in their repository.

plum commented 2 years ago

@plum Any chance you could try the wgpu examples? If the issue is there, then you should probably open a bug report in their repository.

OK hecrj, I'm working on it now. I assume I dont need to run Vulkan's Validation Layers for application development, and I should run the wgpu examples only? Information on the Vulkan's Validation Layers here: https://github.com/gfx-rs/wgpu/wiki/Getting-Started

plum commented 2 years ago

Hi, The (shortened) results are in attached file: I believe there is an issue there, Specifically:

  | ¦Running target/debug/examples/conservative-raster                                          
thread 'main' panicked at 'Adapter does not support required features for this example:         CONSERVATIVE_RASTERIZATION', wgpu/examples/conservative-raster/../framework.rs:147:5
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Sometimes a terminal with graphics didn't launch, but no error given; I cannot be sure if this was expected behaviour.

onagre-tests.md

oknozor commented 2 years ago

Hello @plum I think you should open an issue in wgpu and maybe link it to this issue.

plum commented 2 years ago

OK Will do Oknozor.

plum commented 2 years ago

Good news, I've solved the problem by installing vulkan-intel from the main arch repository. (-:

I am surprised because nowhere have I found that this should be necessary, and all the indications are that the i915 wayland driver is built in to kernel, and should be sufficient. So I wont be apologising for that! I had no prior such warnings in running wayland for several months. I have yet to find out what is happening with the drivers.

Running $ RUST_LOG=debug RUST_BACKTRACE=1 onagre &> onagre-rust_log-02.txt I find the following lines 15- 20 from the previously found errors before installing vulkan-intel have cleared:

15 [2021-11-26T21:01:51Z INFO  wgpu_hal::vulkan::instance] Unable to find extension:               VK_KHR_surface 
  16 [2021-11-26T21:01:51Z INFO  wgpu_hal::vulkan::instance] Unable to find extension:               VK_KHR_xlib_surface 
  17 [2021-11-26T21:01:51Z INFO  wgpu_hal::vulkan::instance] Unable to find extension:               VK_KHR_xcb_surface 
  18 [2021-11-26T21:01:51Z INFO  wgpu_hal::vulkan::instance] Unable to find extension:               VK_KHR_wayland_surface 
  19 [2021-11-26T21:01:51Z INFO  wgpu_hal::vulkan::instance] Unable to find extension:               VK_KHR_get_physical_device_properties2 
  20 [2021-11-26T21:01:51Z WARN  wgpu_hal::vulkan::instance] create_instance:                        VkError(ERROR_INCOMPATIBLE_DRIVER) 

The same error occurs however when running wpgpu --example conservative-raster (I suspect this is due to incomlpete implementation of Intel, as per waning when running onagre):


| ¦Running target/debug/examples/conservative-raster                                          
thread 'main' panicked at 'Adapter does not support required features for this example:         CONSERVATIVE_RASTERIZATION', wgpu/examples/conservative-raster/../framework.rs:147:5
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
>> onagre
MESA-INTEL: warning: Haswell Vulkan support is incomplete

Should others find themselves with similar problems, this effort may be useful to them.

plum commented 2 years ago

Onagre looks nice. Keep up the good work, and good luck! :+1:

oknozor commented 2 years ago

@plum thanks for your patience !

markstos commented 4 months ago

I just installed the AUR package and would say this is still an issue. The logs say failing to parse the theme file is an ERROR. Not a "warning", not "info", it's an "ERROR" not to have a theme file:

ERROR onagre::app::style: Failed to parse theme "/home/mark/.config/onagre/theme.scss": Failed to open config file

If the theme file does not exist and that's OK, it should not attempt to be parsed and not emit this error. It could still be useful to log:

INFO: "/home/mark/.config/onagre/theme.scss" was not found, falling back to default theme.

oknozor commented 4 months ago

@markstos thanks for your input but this is already fixed upstream. the AUR package is outdated and I am not the maintainer. Please wait for a stable release or install onagre from source.