forked from nix-community/home-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rofi: migrate to rasi configuration format (nix-community#1736)
* 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
- Loading branch information
1 parent
b4a93cc
commit 06c5c19
Showing
6 changed files
with
179 additions
and
51 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
rofi-valid-config = ./valid-config.nix; | ||
rofi-assert-on-both-theme-and-colors = ./assert-on-both-theme-and-colors.nix; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
configuration { | ||
bw: 1; | ||
color-normal: "argb:58455a64, #fafbfc, argb:58455a64, #00bcd4, #fafbfc"; | ||
color-window: "argb:583a4c54, argb:582a373e, #c3c6c8"; | ||
cycle: false; | ||
eh: 1; | ||
font: "Droid Sans Mono 14"; | ||
hide-scrollbar: false; | ||
kb-primary-paste: "Control+V,Shift+Insert"; | ||
kb-secondary-paste: "Control+v,Insert"; | ||
lines: 10; | ||
location: 0; | ||
modi: "drun,emoji,ssh"; | ||
padding: 400; | ||
separator-style: "solid"; | ||
terminal: "/some/path"; | ||
width: 100; | ||
xoffset: 0; | ||
yoffset: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
with lib; | ||
|
||
{ | ||
config = { | ||
programs.rofi = { | ||
enable = true; | ||
width = 100; | ||
lines = 10; | ||
borderWidth = 1; | ||
rowHeight = 1; | ||
padding = 400; | ||
font = "Droid Sans Mono 14"; | ||
scrollbar = true; | ||
terminal = "/some/path"; | ||
separator = "solid"; | ||
cycle = false; | ||
fullscren = true; | ||
colors = { | ||
window = { | ||
background = "argb:583a4c54"; | ||
border = "argb:582a373e"; | ||
separator = "#c3c6c8"; | ||
}; | ||
|
||
rows = { | ||
normal = { | ||
background = "argb:58455a64"; | ||
foreground = "#fafbfc"; | ||
backgroundAlt = "argb:58455a64"; | ||
highlight = { | ||
background = "#00bcd4"; | ||
foreground = "#fafbfc"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
window = { | ||
background = "background"; | ||
border = "border"; | ||
separator = "separator"; | ||
}; | ||
extraConfig = { | ||
modi = "drun,emoji,ssh"; | ||
kb-primary-paste = "Control+V,Shift+Insert"; | ||
kb-secondary-paste = "Control+v,Insert"; | ||
}; | ||
}; | ||
|
||
nmt.script = '' | ||
assertFileContent \ | ||
home-files/.config/rofi/config.rasi \ | ||
${./valid-config-expected.rasi} | ||
''; | ||
}; | ||
} |