Compare commits

...

5 Commits

Author SHA1 Message Date
Elnu e42f845f09 Use substituteAll for fcitx5 theming
1 year ago
Elnu a548fbba06 Rename colors to theme, clean up color usage
1 year ago
Elnu 5d9fc8f4f3 Switch to nixpkgs pureref
1 year ago
Elnu 14b83dfac1 flake.lock: Update
1 year ago
Elnu 03314adbb7 Delete TODO
1 year ago

@ -1,8 +0,0 @@
### TODO
- Make startpage fully generic for both Nord and Everforest
### Needs checking
- Fix issue where wireless connection dies after suspend, even after restarting NetworkManager: not an issue on T430, still problem on X220?
- Fix/map media keys (already declared within [`i3.nix`](i3.nix) but are non-functional: not an issue on T430, still problem on X220?

@ -1,7 +1,7 @@
{ pkgs, ... }: { pkgs, ... }:
let with import ../theme; let
themeFolder = ".local/share/fcitx5/themes/Theme/"; themeFolder = ".local/share/fcitx5/themes/${theme}/";
in in
{ {
i18n.inputMethod = { i18n.inputMethod = {
@ -10,9 +10,13 @@ in
}; };
home.file = { home.file = {
"${themeFolder}theme.conf".text = import ./theme.nix; "${themeFolder}theme.conf".source = with colors; pkgs.substituteAll ({
src = ./theme.conf;
background = "${bg1}80";
highlight = bg0;
} // colors);
"${themeFolder}arrow.png".source = ./arrow.png; "${themeFolder}arrow.png".source = ./arrow.png;
"${themeFolder}radio.png".source = ./radio.png; "${themeFolder}radio.png".source = ./radio.png;
".config/fcitx5/conf/classicui.conf".text = "Theme=Theme"; ".config/fcitx5/conf/classicui.conf".text = "Theme=${theme}";
}; };
} }

@ -1,19 +1,12 @@
# Modified from https://github.com/tonyfettes/fcitx5-nord
let
colors = import ../colors;
background = "${colors.bg1}80";
highlight = "${colors.bg0}";
in
''
[Metadata] [Metadata]
ScaleWithDPI=True ScaleWithDPI=True
[InputPanel] [InputPanel]
Font=Sans 13 Font=Sans 13
NormalColor=${colors.fg0} NormalColor=@fg0@
HighlightCandidateColor=${colors.fg1}; HighlightCandidateColor=@fg1@;
HighlightColor=${colors.undefined} HighlightColor=@undefined@
HighlightBackgroundColor=${colors.undefined} HighlightBackgroundColor=@undefined@
Spacing=3 Spacing=3
[InputPanel/TextMargin] [InputPanel/TextMargin]
@ -23,7 +16,7 @@ Top=6
Bottom=6 Bottom=6
[InputPanel/Background] [InputPanel/Background]
Color=${background} Color=@background@
[InputPanel/Background/Margin] [InputPanel/Background/Margin]
Left=2 Left=2
@ -32,7 +25,7 @@ Top=2
Bottom=2 Bottom=2
[InputPanel/Highlight] [InputPanel/Highlight]
Color=${highlight} Color=@highlight@
[InputPanel/Highlight/Margin] [InputPanel/Highlight/Margin]
Left=10 Left=10
@ -42,11 +35,11 @@ Bottom=7
[Menu] [Menu]
Font=Sans 10 Font=Sans 10
NormalColor=${colors.fg0} NormalColor=@fg0@
Spacing=3 Spacing=3
[Menu/Background] [Menu/Background]
Color=${background} Color=@background@
[Menu/Background/Margin] [Menu/Background/Margin]
Left=2 Left=2
@ -61,7 +54,7 @@ Top=2
Bottom=2 Bottom=2
[Menu/Highlight] [Menu/Highlight]
Color=${highlight} Color=@highlight@
[Menu/Highlight/Margin] [Menu/Highlight/Margin]
Left=10 Left=10
@ -70,7 +63,7 @@ Top=5
Bottom=5 Bottom=5
[Menu/Separator] [Menu/Separator]
Color=${highlight} Color=@highlight@
[Menu/CheckBox] [Menu/CheckBox]
Image=radio.png Image=radio.png
@ -83,4 +76,3 @@ Left=5
Right=5 Right=5
Top=5 Top=5
Bottom=5 Bottom=5
''

@ -8,11 +8,11 @@
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1674250603, "lastModified": 1674556204,
"narHash": "sha256-SBolFspxBHpW3hCCDNAFXUiO2mucmkVmf17UmSIK3Cs=", "narHash": "sha256-HCRmkZsq01h2Evch08zpgE9jeHdMtGdT1okWotyvuhY=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "275ab728912006eecb549338a50f24f294a7cfb7", "rev": "c59f0eac51da91c6989fd13a68e156f63c0e60b6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -23,11 +23,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1674120619, "lastModified": 1674459583,
"narHash": "sha256-xLT1FQl7/jNPOEq5q/vmc3AExt1V9LtcjM+QY2+MUpA=", "narHash": "sha256-L0UZl/u2H3HGsrhN+by42c5kNYeKtdmJiPzIRvEVeiM=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d7705c01ef0a39c8ef532d1033bace8845a07d35", "rev": "1b1f50645af2a70dc93eae18bfd88d330bfbcf7f",
"type": "github" "type": "github"
}, },
"original": { "original": {

@ -1,7 +1,7 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let let
colors = import ../colors; theme = import ../theme;
in in
{ {
services = { services = {
@ -13,9 +13,9 @@ in
enable = true; enable = true;
greeters.gtk = { greeters.gtk = {
enable = true; enable = true;
theme = colors.gtkTheme pkgs; theme = theme.gtkTheme pkgs;
}; };
background = ../wallpapers/${colors.wallpaper}; background = ../wallpapers/${theme.wallpaper};
}; };
defaultSession = "none+i3"; defaultSession = "none+i3";
}; };
@ -32,7 +32,7 @@ in
environment.sessionVariables = { environment.sessionVariables = {
# GTK Theme won't display with GTK4 (e.g. nautilus) otherwise # GTK Theme won't display with GTK4 (e.g. nautilus) otherwise
# Doesn't work in some scenarios, such as open containing folder in Firefox, when declared in home.sessionVariables # Doesn't work in some scenarios, such as open containing folder in Firefox, when declared in home.sessionVariables
GTK_THEME = (colors.gtkTheme pkgs).name; GTK_THEME = (theme.gtkTheme pkgs).name;
}; };
# Enable OpenTabletDriver, GUI configurator is otd-gui # Enable OpenTabletDriver, GUI configurator is otd-gui

@ -1,7 +1,7 @@
{ config, pkgs, user, ... }: { config, pkgs, user, ... }:
let let
colors = import ../colors; theme = import ../theme;
in in
{ {
imports = [ imports = [
@ -19,7 +19,7 @@ in
../emacs ../emacs
]; ];
home.file."./.background-image".source = ../wallpapers/${colors.wallpaper}; home.file."./.background-image".source = ../wallpapers/${theme.wallpaper};
programs.home-manager.enable = true; programs.home-manager.enable = true;
@ -49,8 +49,8 @@ in
gtk = { gtk = {
enable = true; enable = true;
iconTheme = colors.gtkIconTheme pkgs; iconTheme = theme.gtkIconTheme pkgs;
theme = colors.gtkTheme pkgs; theme = theme.gtkTheme pkgs;
gtk3 = { gtk3 = {
bookmarks = let bookmarks = let
home = "file://${config.home.homeDirectory}/"; home = "file://${config.home.homeDirectory}/";
@ -114,7 +114,7 @@ in
inkscape inkscape
obs-studio obs-studio
qbittorrent qbittorrent
(pkgs.callPackage ../pureref.nix { }) pureref
libreoffice libreoffice
gnome.ghex gnome.ghex
tudu tudu

@ -1,9 +1,9 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
let let
colors = import ./colors; theme = import ./theme;
mod = "Mod4"; mod = "Mod4";
in { in with theme.colors; {
# Dependencies # Dependencies
home.packages = with pkgs; [ home.packages = with pkgs; [
playerctl # pactl comes with PulseAudio playerctl # pactl comes with PulseAudio
@ -19,8 +19,8 @@ in {
showStartupLaunchMessage = false; showStartupLaunchMessage = false;
showHelp = false; showHelp = false;
showSidePanelButton = false; showSidePanelButton = false;
uiColor = "${colors.bg1}"; uiColor = "${bg1}";
contrastUiColor = "${colors.bg0}"; contrastUiColor = "${bg0}";
drawColor = "#ffffff"; drawColor = "#ffffff";
}; };
}; };
@ -37,25 +37,25 @@ in {
}; };
colors = { colors = {
focused = { focused = {
border = "${colors.bg1}"; border = "${bg1}";
background = "${colors.bg1}"; background = "${bg1}";
text = "${colors.fg0}"; text = "${fg0}";
indicator = "${colors.undefined}"; indicator = "${undefined}";
childBorder = "${colors.undefined}"; childBorder = "${undefined}";
}; };
focusedInactive = { focusedInactive = {
border = "${colors.bg1}"; border = "${bg1}";
background = "${colors.bg1}"; background = "${bg1}";
text = "${colors.fg0}"; text = "${fg0}";
indicator = "${colors.undefined}"; indicator = "${undefined}";
childBorder = "${colors.undefined}"; childBorder = "${undefined}";
}; };
unfocused = { unfocused = {
border = "${colors.bg0}"; border = "${bg0}";
background = "${colors.bg0}"; background = "${bg0}";
text = "${colors.fg0}"; text = "${fg0}";
indicator = "${colors.undefined}"; indicator = "${undefined}";
childBorder = "${colors.undefined}"; childBorder = "${undefined}";
}; };
}; };
startup = [ startup = [

@ -1,8 +1,8 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
let let
colors = import ../colors; theme = import ../theme;
in in with theme.colors;
{ {
# Dependencies # Dependencies
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -21,15 +21,15 @@ in
tray-position = "right"; tray-position = "right";
font-0 = "Noto Sans Mono;2"; font-0 = "Noto Sans Mono;2";
font-1 = "M+ 2p;2"; font-1 = "M+ 2p;2";
background = "${colors.bg0}"; background = "${bg0}";
foreground = "${colors.fg0}"; foreground = "${fg0}";
width = "100%"; width = "100%";
height = "24pt"; height = "24pt";
line-size = "3pt"; line-size = "3pt";
padding-right = 1; padding-right = 1;
module-margin = 1; module-margin = 1;
separator = "|"; separator = "|";
separator-foreground = "${colors.disabled}"; separator-foreground = "${disabled}";
cursor-click = "pointer"; cursor-click = "pointer";
cursor-scroll = "ns-resize"; cursor-scroll = "ns-resize";
modules-left = [ modules-left = [
@ -51,16 +51,16 @@ in
"module/xworkspaces" = { "module/xworkspaces" = {
type = "internal/xworkspaces"; type = "internal/xworkspaces";
label-active-background = "${colors.bg1}"; label-active-background = "${bg1}";
label-active-underline = "${colors.primary}"; label-active-underline = "${primary}";
label-active-padding-right = 1; label-active-padding-right = 1;
label-occupied-padding-right = 1; label-occupied-padding-right = 1;
label-urgent-background = "${colors.alert}"; label-urgent-background = "${alert}";
label-urgent-padding-right = 1; label-urgent-padding-right = 1;
label-empty-foreground = "${colors.disabled}"; label-empty-foreground = "${disabled}";
label-empty-padding-right = 1; label-empty-padding-right = 1;
}; };
"module/xwindow" = { "module/xwindow" = {
@ -88,18 +88,18 @@ in
interval = 25; interval = 25;
mount-0 = "/"; mount-0 = "/";
label-mounted = "%{F${colors.primary}}%mountpoint%%{F-} %percentage_used%%"; label-mounted = "%{F${primary}}%mountpoint%%{F-} %percentage_used%%";
label-unmounted = "%mountpoint% not mounted"; label-unmounted = "%mountpoint% not mounted";
label-unmounted-foreground = "${colors.disabled}"; label-unmounted-foreground = "${disabled}";
}; };
"module/pulseaudio" = { "module/pulseaudio" = {
type = "internal/pulseaudio"; type = "internal/pulseaudio";
format-volume-prefix = "VOL "; format-volume-prefix = "VOL ";
format-volume-prefix-foreground = "${colors.primary}"; format-volume-prefix-foreground = "${primary}";
label-muted = "muted"; label-muted = "muted";
label-muted-foreground = "${colors.disabled}"; label-muted-foreground = "${disabled}";
}; };
"module/memory" = { "module/memory" = {
type = "internal/memory"; type = "internal/memory";
@ -107,7 +107,7 @@ in
interval = 2; interval = 2;
format-prefix = "RAM "; format-prefix = "RAM ";
format-prefix-foreground = "${colors.primary}"; format-prefix-foreground = "${primary}";
}; };
"module/cpu" = { "module/cpu" = {
type = "internal/cpu"; type = "internal/cpu";
@ -115,7 +115,7 @@ in
interval = 2; interval = 2;
format-prefix = "CPU "; format-prefix = "CPU ";
format-prefix-foreground = "${colors.primary}"; format-prefix-foreground = "${primary}";
}; };
"module/date" = { "module/date" = {
type = "internal/date"; type = "internal/date";
@ -125,7 +125,7 @@ in
date = "%H:%M"; date = "%H:%M";
date-alt = "%Y-%m-%d %H:%M:%S"; date-alt = "%Y-%m-%d %H:%M:%S";
label-foreground = "${colors.primary}"; label-foreground = "${primary}";
}; };
}; };
}; };

@ -1,25 +0,0 @@
{ lib, appimageTools, requireFile }:
appimageTools.wrapType1 rec {
pname = "pureref";
version = "1.11.1";
src = requireFile {
name = "PureRef-${version}_x64.Appimage";
sha256 = "05naywdgykqrsgc3xybskr418cyvbx7vqs994yv9w8zf98gxvbvm";
url = "https://www.pureref.com/download.php";
};
extraInstallCommands = ''
mv $out/bin/${pname}-${version} $out/bin/${pname}
'';
meta = with lib; {
description = "Reference Image Viewer";
homepage = "https://www.pureref.com";
license = licenses.unfree;
maintainers = with maintainers; [ elnudev ];
platforms = [ "x86_64-linux" ];
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
};
}

@ -1,8 +1,8 @@
{ pkgs, ... }: { pkgs, ... }:
let let
colors = import ../colors; _theme = import ../theme;
theme = colors.theme; theme = _theme.theme; # Theme name
in { in {
home.packages = with pkgs; [ home.packages = with pkgs; [
(pkgs.callPackage ./power.nix { }) (pkgs.callPackage ./power.nix { })
@ -14,5 +14,5 @@ in {
}; };
home.file.".config/rofi/${theme}.rasi".source = pkgs.substituteAll ({ home.file.".config/rofi/${theme}.rasi".source = pkgs.substituteAll ({
src = ./theme.rasi; src = ./theme.rasi;
} // colors.colors); } // _theme.colors);
} }

@ -1,7 +1,7 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
let let
colors = import ../colors; theme = import ../theme;
startpageDir = import ./dir.nix; startpageDir = import ./dir.nix;
out = "${startpageDir}.tmp/"; out = "${startpageDir}.tmp/";
in in
@ -11,7 +11,7 @@ in
source = ./html; source = ./html;
recursive = true; recursive = true;
}; };
"${out}colors.css".text = ":root {\n" + (colors.css lib) + "\n}"; "${out}colors.css".text = ":root {\n" + (theme.css lib) + "\n}";
}; };
# Make files not symlinks, this causes issues displaying in Firefox # Make files not symlinks, this causes issues displaying in Firefox
home.activation.startpage = lib.hm.dag.entryAfter["writeBoundary"] '' home.activation.startpage = lib.hm.dag.entryAfter["writeBoundary"] ''

@ -1,13 +1,13 @@
{ ... }: { ... }:
let let
colors = import ./colors; theme = import ./theme;
in in
{ {
programs.kitty = { programs.kitty = {
enable = true; enable = true;
# https://github.com/kovidgoyal/kitty-themes/blob/master/themes.json # https://github.com/kovidgoyal/kitty-themes/blob/master/themes.json
theme = "${colors.kitty-theme}"; theme = "${theme.kitty-theme}";
font = { font = {
name = "FiraCode Nerd Font Mono"; name = "FiraCode Nerd Font Mono";
size = 12; size = 12;

@ -8,5 +8,4 @@ in
{ {
css = lib: lib.strings.concatStringsSep "\n" (lib.attrValues (lib.mapAttrs (k: v: " --${k}: ${v};") theme.colors)); css = lib: lib.strings.concatStringsSep "\n" (lib.attrValues (lib.mapAttrs (k: v: " --${k}: ${v};") theme.colors));
} }
// colors // theme.colors # Root colors // theme // { colors = theme.colors // colors; }
// theme // { colors = theme.colors // colors; } # Dedicated color set
Loading…
Cancel
Save