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

rofi: migrate to rasi configuration format #1736

Merged
merged 4 commits into from
Jan 23, 2021

Conversation

thiagokokada
Copy link
Contributor

@thiagokokada thiagokokada commented Jan 20, 2021

Description

The Xresources configuration format is deprecated in Rofi. For example, using Rofi from unstable (1.6.1 as of now) you get the following warnings when starting the application:

(process:9272): Rofi-WARNING **: 01:38:48.596: The old Xresources based configuration format is deprecated.

(process:9272): Rofi-WARNING **: 01:38:48.596: Please upgrade: rofi -upgrade-config.

So this commit migrates it for its new configuration format, called rasi instead.

This new implementation uses attrsets manipulation instead of using strings, making the code clearer and also fixing some bugs found during the way. This is mostly an implementation detail though, since this change is mostly backwards compatible with the old one (the only option that is not backwards compatible is programs.rofi.extraConfig, but this would break anyway since the textual format changed). To make sure everything is right, I also created some tests.

If someone wants to validate if the generated config is correct, just run in terminal:

$ rofi -dump-config

And rofi will dump the current configuration file, including all unsetted options.

Closes issue #1593.

Checklist

  • Change is backwards compatible. (mostly, except for programs.rofi.extraConfig that is documented)

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.

    • Added myself and the module files to .github/CODEOWNERS.

@@ -72,20 +72,14 @@ let
};

valueToString = value:
if isBool value then (if value then "true" else "else") else toString value;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a bug in the old code, when you set the value to false it wrote else to config instead.

@thiagokokada
Copy link
Contributor Author

Don't know what is failing in CI, both rofi related tests works in my machine.

@berbiche
Copy link
Member

Don't know what is failing in CI, both rofi related tests works in my machine.

Yes, this is/was an issue on nixpkgs-unstable with kakoune due to a treewide refactor of stdenv.lib -> lib, the failing CI will only be resolved when the nixpkgs channel used in the CI is updated (which is automatic IIRC).

@thiagokokada
Copy link
Contributor Author

Removed the unnecessary blank lines from the result config file, also changed some function names to match their names in the lib.generators. I think this PR is ready to review.

The Xresources configuration format is deprecated in Rofi. For example,
using Rofi from unstable (1.6.1 as of now) you get the following
warnings when starting the application:

```
(process:9272): Rofi-WARNING **: 01:38:48.596: The old Xresources based configuration format is deprecated.

(process:9272): Rofi-WARNING **: 01:38:48.596: Please upgrade: rofi -upgrade-config.
``````

So this commit migrates it for its new configuration format, called rasi
instead.

This new implementation uses attrsets manipulation instead of using
strings, making the code clearer and also fixing some bugs found during
the way. To make sure everything is right, I also created some tests.

If someone wants to validate if the generated config is correct, just
run in terminal:

```
$ rofi -dump-config
```

And rofi will dump the current configuration file, including all
unsetted options.
@thiagokokada
Copy link
Contributor Author

thiagokokada commented Jan 21, 2021

Rebased with master and add myself as maintainer. I think now the tests should pass.

.github/CODEOWNERS Outdated Show resolved Hide resolved
@thiagokokada thiagokokada force-pushed the migrate-rofi-to-rasi branch 2 times, most recently from cb7de66 to 75fab73 Compare January 22, 2021 12:34
@teto teto merged commit 6f7074d into nix-community:master Jan 23, 2021
@thiagokokada thiagokokada deleted the migrate-rofi-to-rasi branch January 23, 2021 15:36
thiagokokada added a commit to thiagokokada/home-manager that referenced this pull request Feb 10, 2021
* rofi: migrate to rasi configuration format

The Xresources configuration format is deprecated in Rofi. For example,
using Rofi from unstable (1.6.1 as of now) you get the following
warnings when starting the application:

```
(process:9272): Rofi-WARNING **: 01:38:48.596: The old Xresources based configuration format is deprecated.

(process:9272): Rofi-WARNING **: 01:38:48.596: Please upgrade: rofi -upgrade-config.
``````

So this commit migrates it for its new configuration format, called rasi
instead.

This new implementation uses attrsets manipulation instead of using
strings, making the code clearer and also fixing some bugs found during
the way. To make sure everything is right, I also created some tests.

If someone wants to validate if the generated config is correct, just
run in terminal:

```
$ rofi -dump-config
```

And rofi will dump the current configuration file, including all
unsetted options.

* docs: document programs.rofi.extraConfig changes

* rofi: add thiagokokada as maintainer

* rofi: add toRasi function
malte-v pushed a commit to malte-v/home-manager that referenced this pull request Feb 24, 2021
* rofi: migrate to rasi configuration format

The Xresources configuration format is deprecated in Rofi. For example,
using Rofi from unstable (1.6.1 as of now) you get the following
warnings when starting the application:

```
(process:9272): Rofi-WARNING **: 01:38:48.596: The old Xresources based configuration format is deprecated.

(process:9272): Rofi-WARNING **: 01:38:48.596: Please upgrade: rofi -upgrade-config.
``````

So this commit migrates it for its new configuration format, called rasi
instead.

This new implementation uses attrsets manipulation instead of using
strings, making the code clearer and also fixing some bugs found during
the way. To make sure everything is right, I also created some tests.

If someone wants to validate if the generated config is correct, just
run in terminal:

```
$ rofi -dump-config
```

And rofi will dump the current configuration file, including all
unsetted options.

* docs: document programs.rofi.extraConfig changes

* rofi: add thiagokokada as maintainer

* rofi: add toRasi function
aakropotkin pushed a commit to aakropotkin/home-manager that referenced this pull request Feb 28, 2021
* rofi: migrate to rasi configuration format

The Xresources configuration format is deprecated in Rofi. For example,
using Rofi from unstable (1.6.1 as of now) you get the following
warnings when starting the application:

```
(process:9272): Rofi-WARNING **: 01:38:48.596: The old Xresources based configuration format is deprecated.

(process:9272): Rofi-WARNING **: 01:38:48.596: Please upgrade: rofi -upgrade-config.
``````

So this commit migrates it for its new configuration format, called rasi
instead.

This new implementation uses attrsets manipulation instead of using
strings, making the code clearer and also fixing some bugs found during
the way. To make sure everything is right, I also created some tests.

If someone wants to validate if the generated config is correct, just
run in terminal:

```
$ rofi -dump-config
```

And rofi will dump the current configuration file, including all
unsetted options.

* docs: document programs.rofi.extraConfig changes

* rofi: add thiagokokada as maintainer

* rofi: add toRasi function
cab404 pushed a commit to cab404/home-manager that referenced this pull request Apr 23, 2021
* rofi: migrate to rasi configuration format

The Xresources configuration format is deprecated in Rofi. For example,
using Rofi from unstable (1.6.1 as of now) you get the following
warnings when starting the application:

```
(process:9272): Rofi-WARNING **: 01:38:48.596: The old Xresources based configuration format is deprecated.

(process:9272): Rofi-WARNING **: 01:38:48.596: Please upgrade: rofi -upgrade-config.
``````

So this commit migrates it for its new configuration format, called rasi
instead.

This new implementation uses attrsets manipulation instead of using
strings, making the code clearer and also fixing some bugs found during
the way. To make sure everything is right, I also created some tests.

If someone wants to validate if the generated config is correct, just
run in terminal:

```
$ rofi -dump-config
```

And rofi will dump the current configuration file, including all
unsetted options.

* docs: document programs.rofi.extraConfig changes

* rofi: add thiagokokada as maintainer

* rofi: add toRasi function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants