refactor: better modularise arturm/configs/qutebrowser
There are other changes too, such as some tiny refactors to make some things a small bit more readable. For example: I added a variable in `cityseventeen/apps.nix` to make environment variables a small bit easier to read. It is pretty much the same case in `cityseventeen/themes.nix` except I used map to get each attribute set with package instead of mapAttrs. There are also some minor tweaks here and there but it isn't worth talking about.
This commit is contained in:
parent
cddcce6db9
commit
ea7dd98c09
8 changed files with 81 additions and 60 deletions
|
@ -1,15 +1,16 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
env = config.environment.variables;
|
||||
in
|
||||
{
|
||||
environment = {
|
||||
shellAliases.e = "${env.EDITOR}";
|
||||
systemPackages = [ pkgs.amadaluzian-zsh ];
|
||||
sessionVariables.EDITOR = "emacsclient -c";
|
||||
shellAliases = {
|
||||
"e" = "$EDITOR";
|
||||
};
|
||||
};
|
||||
|
||||
alqueva = {
|
||||
|
@ -45,8 +46,8 @@
|
|||
emacs = {
|
||||
enable = true;
|
||||
package = inputs.pankomacs.packages.${pkgs.system}.pgtk;
|
||||
startWithGraphical = true;
|
||||
install = true;
|
||||
defaultEditor = true;
|
||||
};
|
||||
rsyncd.enable = true;
|
||||
};
|
||||
|
|
|
@ -17,6 +17,7 @@ let
|
|||
package = pkgs.rose-pine-cursor;
|
||||
};
|
||||
};
|
||||
themePackages = map (subset: subset.package) (builtins.attrValues themes);
|
||||
in
|
||||
{
|
||||
alqueva.system.dconf = {
|
||||
|
@ -40,5 +41,7 @@ in
|
|||
"L+ %h/.config/gtk-4.0 - - - - ${themes.gtk.package}/share/themes/${themes.gtk.name}/gtk-4.0"
|
||||
];
|
||||
|
||||
environment.systemPackages = builtins.attrValues (builtins.mapAttrs (_: v: v.package) themes);
|
||||
# This is really just to please the functor.
|
||||
# Any value can be used in null's place.
|
||||
environment.systemPackages = themePackages;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
def darkmode_on(config, pages):
|
||||
for p in pages:
|
||||
config.set("colors.webpage.darkmode.enabled", True, p)
|
|
@ -1,4 +1,25 @@
|
|||
def load_theme(c, palette):
|
||||
class Palettes:
|
||||
rose_pine = {
|
||||
"base00": "#191724",
|
||||
"base01": "#1f1d2e",
|
||||
"base02": "#26233a",
|
||||
"base03": "#6e6a86",
|
||||
"base04": "#908caa",
|
||||
"base05": "#e0def4",
|
||||
"base06": "#e0def4",
|
||||
"base07": "#524f67",
|
||||
"base08": "#eb6f92",
|
||||
"base09": "#f6c177",
|
||||
"base0A": "#ebbcba",
|
||||
"base0B": "#31748f",
|
||||
"base0C": "#9ccfd8",
|
||||
"base0D": "#c4a7e7",
|
||||
"base0E": "#f6c177",
|
||||
"base0F": "#524f67",
|
||||
}
|
||||
|
||||
|
||||
def load_colours(c, palette):
|
||||
c.colors.completion.fg = palette["base05"]
|
||||
c.colors.completion.odd.bg = palette["base01"]
|
||||
c.colors.completion.even.bg = palette["base00"]
|
|
@ -1,37 +1,30 @@
|
|||
from theme import load_theme
|
||||
from colours.themes import load_colours, Palettes
|
||||
from colours.darkmode import darkmode_on
|
||||
|
||||
config.load_autoconfig()
|
||||
|
||||
theme = {
|
||||
"base00": "#191724",
|
||||
"base01": "#1f1d2e",
|
||||
"base02": "#26233a",
|
||||
"base03": "#6e6a86",
|
||||
"base04": "#908caa",
|
||||
"base05": "#e0def4",
|
||||
"base06": "#e0def4",
|
||||
"base07": "#524f67",
|
||||
"base08": "#eb6f92",
|
||||
"base09": "#f6c177",
|
||||
"base0A": "#ebbcba",
|
||||
"base0B": "#31748f",
|
||||
"base0C": "#9ccfd8",
|
||||
"base0D": "#c4a7e7",
|
||||
"base0E": "#f6c177",
|
||||
"base0F": "#524f67",
|
||||
}
|
||||
def main():
|
||||
# leave this alone!
|
||||
config.load_autoconfig()
|
||||
|
||||
load_theme(c, theme)
|
||||
# rose-pine
|
||||
load_colours(c, Palettes.rose_pine)
|
||||
|
||||
c.colors.webpage.preferred_color_scheme = "dark"
|
||||
c.tabs.position = "top"
|
||||
c.tabs.width = 32
|
||||
c.fonts.default_size = "13pt"
|
||||
c.fonts.default_family = "sans-serif"
|
||||
c.tabs.padding = {
|
||||
"bottom": 4,
|
||||
"top": 4,
|
||||
"left": 6,
|
||||
"right": 6,
|
||||
}
|
||||
c.tabs.indicator.width = 0
|
||||
darkmode_on(config, ["about:blank"])
|
||||
|
||||
c.colors.webpage.darkmode.enabled = False
|
||||
c.colors.webpage.preferred_color_scheme = "dark"
|
||||
c.tabs.position = "top"
|
||||
c.tabs.width = 32
|
||||
c.fonts.default_size = "13pt"
|
||||
c.fonts.default_family = "sans-serif"
|
||||
c.tabs.padding = {
|
||||
"bottom": 4,
|
||||
"top": 4,
|
||||
"left": 6,
|
||||
"right": 6,
|
||||
}
|
||||
c.tabs.indicator.width = 0
|
||||
c.url.start_pages = "about:blank"
|
||||
|
||||
|
||||
main()
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
}:
|
||||
{
|
||||
alqueva.users.arturm = {
|
||||
shell = pkgs.zsh;
|
||||
shell = pkgs.amadaluzian-zsh;
|
||||
tmpfiles = [
|
||||
"L+ %h/.config/qutebrowser/config.py - - - - ${./configs/qutebrowser/config.py}"
|
||||
"L+ %h/.config/qutebrowser/theme - - - - ${./configs/qutebrowser/theme}"
|
||||
"L+ %h/.config/qutebrowser/colours - - - - ${./configs/qutebrowser/colours}"
|
||||
"L+ %h/.config/kanshi/ - - - - ${./configs/kanshi}"
|
||||
"L+ %h/.config/mako/ - - - - ${./configs/mako}"
|
||||
"L+ %h/.config/niri/ - - - - ${./configs/niri}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue