Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] -config path resolved differently from -theme path #2040

Open
2 tasks done
coloursofnoise opened this issue Oct 16, 2024 · 2 comments
Open
2 tasks done

[BUG] -config path resolved differently from -theme path #2040

coloursofnoise opened this issue Oct 16, 2024 · 2 comments
Labels

Comments

@coloursofnoise
Copy link

Rofi version (rofi -v)

Version: 1.7.5

Configuration

https://gist.github.com/coloursofnoise/9a0c574a1c50df9aad94e78ebb09407c#file-config-rasi

Theme

https://gist.github.com/coloursofnoise/9a0c574a1c50df9aad94e78ebb09407c#file-theme-rasi

Timing report

No response

Launch command

rofi -config test.rasi

Step to reproduce

% cat  > `$XDG_CONFIG_HOME/rofi/test.rasi` <<EOF
configuration {
    modes: [ "filebrowser" ];
}
EOF
% rofi -config test.rasi -dump-theme

Expected behavior

-dump-config output should include modes: "filebrowser";.

Actual behavior

-dump-config output only has default values (/* modes: "window,drun,run,ssh";*/).

Additional information

This behaviour differs from the -theme option, which does work with test.rasi.

Using wayland display server protocol

  • No, I don't use the wayland display server protocol

I've checked if the issue exists in the latest stable release

  • Yes, I have checked the problem exists in the latest stable version
@DaveDavenport
Copy link
Collaborator

I am not sure this is a bug, but more intended behavior.
We could change the behavior easily:

diff --git a/source/rofi.c b/source/rofi.c
index 9ebe28df..fb1224c7 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -328,7 +328,8 @@ static void print_main_application_options(int is_term) {
                  "Behave as a normal window. (experimental)", NULL, is_term);
   print_help_msg("-transient-window", "",
                  "Behave as a modal dialog that is transient to the currently "
-                 "focused window. (experimental)", NULL, is_term);
+                 "focused window. (experimental)",
+                 NULL, is_term);
   print_help_msg("-show", "[mode]",
                  "Show the mode 'mode' and exit. The mode has to be enabled.",
                  NULL, is_term);
@@ -1063,7 +1064,7 @@ int main(int argc, char *argv[]) {
       g_free(etc);
     }

-    if (config_path && g_file_test(config_path, G_FILE_TEST_IS_REGULAR)) {
+    if (config_path) {
       if (rofi_theme_parse_file(config_path)) {
         rofi_theme_free(rofi_theme);
         rofi_theme = NULL;

@coloursofnoise
Copy link
Author

One issue I could see is having the same filename in both $XDG_CONFIG_HOME/rofi and $XDG_CONFIG_HOME/rofi/themes, where presumably one would want -config to prioritize the former and -theme the latter. I think the distinction between config and theme is blurry enough that it shouldn't matter all that much though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants